Skip to content

Commit

Permalink
XRHandPrimitiveModel: Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Apr 23, 2021
1 parent c179013 commit b3df09a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/jsm/webxr/XRHandPrimitiveModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import {
Vector3
} from '../../../build/three.module.js';

const _matrix = new Matrix4();
const _vector = new Vector3();

class XRHandPrimitiveModel {

constructor( handModel, controller, path, handedness, options ) {
Expand Down Expand Up @@ -64,9 +67,6 @@ class XRHandPrimitiveModel {
'pinky-finger-tip'
];

this.tempMat = new Matrix4();
this.tempVec = new Vector3();

}

updateMesh() {
Expand All @@ -82,9 +82,9 @@ class XRHandPrimitiveModel {

if ( joint.visible ) {

this.tempVec.setScalar( joint.jointRadius || defaultRadius );
this.tempMat.compose( joint.position, joint.quaternion, this.tempVec );
this.handMesh.setMatrixAt( i, this.tempMat );
_vector.setScalar( joint.jointRadius || defaultRadius );
_matrix.compose( joint.position, joint.quaternion, _vector );
this.handMesh.setMatrixAt( i, _matrix );

count ++;

Expand Down

0 comments on commit b3df09a

Please sign in to comment.