소스 검색

SkeletonViewer: Removed null check.

Reimund Järnfors 5 년 전
부모
커밋
e8757a09ca
1개의 변경된 파일16개의 추가작업 그리고 18개의 파일을 삭제
  1. 16 18
      src/Debug/skeletonViewer.ts

+ 16 - 18
src/Debug/skeletonViewer.ts

@@ -754,28 +754,26 @@ export class SkeletonViewer {
             return;
         }
         
-        if (this._utilityLayer) {
-            const targetScene = this._utilityLayer.utilityLayerScene;
-            const size = displayOptions.localAxesSize || 0.075;
+        const targetScene = this._utilityLayer!.utilityLayerScene;
+        const size = displayOptions.localAxesSize || 0.075;
 
-            for (let b of this.skeleton.bones) {
-                if (b._index === -1 || (!this._boneIndices.has(b.getIndex()) && !this.options.useAllBones)) {
-                    continue;
-                }
-            
-                let axisX = Mesh.CreateLines('axisX', [Vector3.Zero(), new Vector3(size, 0, 0)], targetScene, true);
-                let axisY = Mesh.CreateLines('axisY', [Vector3.Zero(), new Vector3(0, size, 0)], targetScene, true);
-                let axisZ = Mesh.CreateLines('axisZ', [Vector3.Zero(), new Vector3(0, 0, size)], targetScene, true);
+        for (let b of this.skeleton.bones) {
+            if (b._index === -1 || (!this._boneIndices.has(b.getIndex()) && !this.options.useAllBones)) {
+                continue;
+            }
+        
+            let axisX = Mesh.CreateLines('axisX', [Vector3.Zero(), new Vector3(size, 0, 0)], targetScene, true);
+            let axisY = Mesh.CreateLines('axisY', [Vector3.Zero(), new Vector3(0, size, 0)], targetScene, true);
+            let axisZ = Mesh.CreateLines('axisZ', [Vector3.Zero(), new Vector3(0, 0, size)], targetScene, true);
 
-                axisX.color = new Color3(1, 0, 0);
-                axisY.color = new Color3(0, 1, 0);
-                axisZ.color = new Color3(0, 0, 1);
+            axisX.color = new Color3(1, 0, 0);
+            axisY.color = new Color3(0, 1, 0);
+            axisZ.color = new Color3(0, 0, 1);
 
-                axisX.parent = axisY.parent = axisZ.parent = b;
-                axisX.renderingGroupId = axisY.renderingGroupId = axisZ.renderingGroupId = this.renderingGroupId;
+            axisX.parent = axisY.parent = axisZ.parent = b;
+            axisX.renderingGroupId = axisY.renderingGroupId = axisZ.renderingGroupId = this.renderingGroupId;
 
-                this._localAxes.push(axisX, axisY, axisZ);
-            }	
+            this._localAxes.push(axisX, axisY, axisZ);
         }
     }