File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
org.mixedrealitytoolkit.input/Visualizers/PlatformHandVisualizer Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -118,14 +118,20 @@ protected void Update()
118118 || meshInfo . ChangeState == MeshChangeState . Updated )
119119 {
120120 meshSubsystem . GenerateMeshAsync ( meshInfo . MeshId , meshFilter . mesh ,
121- null , MeshVertexAttributes . Normals , result => { } ) ;
122-
123- handRenderer . enabled = true ;
124-
125- // This hand mesh is provided pre-translated from the world origin,
126- // so we want to ensure the mesh is "centered" at the world origin
127- PlayspaceUtilities . XROrigin . CameraFloorOffsetObject . transform . GetPositionAndRotation ( out Vector3 position , out Quaternion rotation ) ;
128- transform . SetPositionAndRotation ( position , rotation ) ;
121+ null , MeshVertexAttributes . Normals , result =>
122+ {
123+ if ( result . Status == MeshGenerationStatus . Success )
124+ {
125+ transform . SetWorldPose ( PlayspaceUtilities . TransformPose ( new Pose ( result . Position , result . Rotation ) ) ) ;
126+ transform . localScale = result . Scale ;
127+
128+ handRenderer . enabled = true ;
129+ }
130+ else if ( result . Status != MeshGenerationStatus . GenerationAlreadyInProgress )
131+ {
132+ handRenderer . enabled = false ;
133+ }
134+ } , MeshGenerationOptions . ConsumeTransform ) ;
129135 }
130136 }
131137#if MROPENXR_PRESENT && ( UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_ANDROID )
You can’t perform that action at this time.
0 commit comments