提交 629cfbcb 编写于 作者: M Mr.doob

LDrawLoader: Clean up.

上级 cf55a470
......@@ -1174,36 +1174,36 @@ THREE.LDrawLoader = ( function () {
type = lp.getToken();
currentParseScope.triangles = [];
currentParseScope.lineSegments = [];
currentParseScope.conditionalSegments = [];
currentParseScope.type = type;
currentParseScope.triangles = [];
currentParseScope.lineSegments = [];
currentParseScope.conditionalSegments = [];
currentParseScope.type = type;
var isRoot = ! parentParseScope.isFromParse;
if ( isRoot || scope.separateObjects && ! isPrimitiveType( type ) ) {
var isRoot = ! parentParseScope.isFromParse;
if ( isRoot || scope.separateObjects && ! isPrimitiveType( type ) ) {
currentParseScope.groupObject = new THREE.Group();
currentParseScope.groupObject = new THREE.Group();
currentParseScope.groupObject.userData.startingConstructionStep = currentParseScope.startingConstructionStep;
currentParseScope.groupObject.userData.startingConstructionStep = currentParseScope.startingConstructionStep;
}
}
// If the scale of the object is negated then the triangle winding order
// needs to be flipped.
var matrix = currentParseScope.matrix;
if (
matrix.determinant() < 0 && (
scope.separateObjects && isPrimitiveType( type ) ||
! scope.separateObjects
) ) {
// If the scale of the object is negated then the triangle winding order
// needs to be flipped.
var matrix = currentParseScope.matrix;
if (
matrix.determinant() < 0 && (
scope.separateObjects && isPrimitiveType( type ) ||
! scope.separateObjects
) ) {
currentParseScope.inverted = ! currentParseScope.inverted;
currentParseScope.inverted = ! currentParseScope.inverted;
}
}
triangles = currentParseScope.triangles;
lineSegments = currentParseScope.lineSegments;
conditionalSegments = currentParseScope.conditionalSegments;
triangles = currentParseScope.triangles;
lineSegments = currentParseScope.lineSegments;
conditionalSegments = currentParseScope.conditionalSegments;
break;
......
......@@ -1192,36 +1192,36 @@ var LDrawLoader = ( function () {
type = lp.getToken();
currentParseScope.triangles = [];
currentParseScope.lineSegments = [];
currentParseScope.conditionalSegments = [];
currentParseScope.type = type;
currentParseScope.triangles = [];
currentParseScope.lineSegments = [];
currentParseScope.conditionalSegments = [];
currentParseScope.type = type;
var isRoot = ! parentParseScope.isFromParse;
if ( isRoot || scope.separateObjects && ! isPrimitiveType( type ) ) {
var isRoot = ! parentParseScope.isFromParse;
if ( isRoot || scope.separateObjects && ! isPrimitiveType( type ) ) {
currentParseScope.groupObject = new Group();
currentParseScope.groupObject = new Group();
currentParseScope.groupObject.userData.startingConstructionStep = currentParseScope.startingConstructionStep;
currentParseScope.groupObject.userData.startingConstructionStep = currentParseScope.startingConstructionStep;
}
}
// If the scale of the object is negated then the triangle winding order
// needs to be flipped.
var matrix = currentParseScope.matrix;
if (
matrix.determinant() < 0 && (
scope.separateObjects && isPrimitiveType( type ) ||
! scope.separateObjects
) ) {
// If the scale of the object is negated then the triangle winding order
// needs to be flipped.
var matrix = currentParseScope.matrix;
if (
matrix.determinant() < 0 && (
scope.separateObjects && isPrimitiveType( type ) ||
! scope.separateObjects
) ) {
currentParseScope.inverted = ! currentParseScope.inverted;
currentParseScope.inverted = ! currentParseScope.inverted;
}
}
triangles = currentParseScope.triangles;
lineSegments = currentParseScope.lineSegments;
conditionalSegments = currentParseScope.conditionalSegments;
triangles = currentParseScope.triangles;
lineSegments = currentParseScope.lineSegments;
conditionalSegments = currentParseScope.conditionalSegments;
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册