Bläddra i källkod

lint and final hopeful fixes

Andrew V Butt Sr 5 år sedan
förälder
incheckning
442e828daf

+ 2 - 2
inspector/src/components/actionTabs/tabs/propertyGrids/meshes/meshPropertyGridComponent.tsx

@@ -236,7 +236,7 @@ export class MeshPropertyGridComponent extends React.Component<IMeshPropertyGrid
             if (!mesh.reservedDataStore.displayBoneIndex) {
                 mesh.reservedDataStore.displayBoneIndex = this.state.displayBoneIndex;
             }
-            if(mesh.skeleton){
+            if (mesh.skeleton){
                 const boneWeightsShader = SkeletonViewer.CreateBoneWeightShader({skeleton:mesh.skeleton}, scene)
                 boneWeightsShader.reservedDataStore = { hidden: true };
                 mesh.material = boneWeightsShader;
@@ -261,7 +261,7 @@ export class MeshPropertyGridComponent extends React.Component<IMeshPropertyGrid
             if (!mesh.reservedDataStore.originalMaterial) {
                 mesh.reservedDataStore.originalMaterial = mesh.material;
             }  
-            if(mesh.skeleton){
+            if (mesh.skeleton){
                 const skeletonMapShader = SkeletonViewer.CreateSkeletonMapShader({skeleton:mesh.skeleton}, scene)
                 skeletonMapShader.reservedDataStore = { hidden: true };
                 mesh.material = skeletonMapShader;

+ 0 - 3
src/Debug/ISkeletonViewer.ts

@@ -22,9 +22,6 @@ export interface ISkeletonViewerOptions{
 
    /** Flag ignore non weighted bones */
    useAllBones: boolean;
-
-   /** Flag to say that the current pose of the bones is the rest pose */
-   currentStateIsRestPose: boolean;
 }
 
 /**

+ 4 - 15
src/Debug/skeletonViewer.ts

@@ -1,4 +1,4 @@
-import { Vector3, Matrix, TmpVectors, Quaternion } from "../Maths/math.vector";
+import { Vector3, Matrix, TmpVectors } from "../Maths/math.vector";
 import { Color3 } from '../Maths/math.color';
 import { Scene } from "../scene";
 import { Nullable } from "../types";
@@ -387,8 +387,7 @@ export class SkeletonViewer {
 
         //Defaults
         options.pauseAnimations = options.pauseAnimations ?? true;
-        options.currentStateIsRestPose = options.currentStateIsRestPose ?? false;
-        options.returnToRest = (options.currentStateIsRestPose) ? false : options.returnToRest ?? (options.currentStateIsRestPose) ? false : true;
+        options.returnToRest = options.returnToRest ?? true;
         options.displayMode = options.displayMode ?? SkeletonViewer.DISPLAY_LINES;
         options.displayOptions = options.displayOptions ?? {};
         options.displayOptions.midStep = options.displayOptions.midStep ?? 0.235;
@@ -585,18 +584,8 @@ export class SkeletonViewer {
                 scene.animationsEnabled = false;
             }
 
-            if (this.options.currentStateIsRestPose) {
-                let _s = Vector3.Zero();
-                let _r = Quaternion.Identity();
-                let _t = Vector3.Zero();
-                this.skeleton.bones.forEach((b) => {
-                    b.getLocalMatrix().decompose(_s, _r, _t);
-                    b.setRestPose(Matrix.Compose(_s, _r, _t));
-                 });
-            }else {
-                if (this.options.returnToRest) {
-                    this.skeleton.returnToRest();
-                }
+            if (this.options.returnToRest) {
+                this.skeleton.returnToRest();
             }
 
             if (this.autoUpdateBonesMatrices) {