|
@@ -14,6 +14,8 @@ const _vector3 = /*@__PURE__*/ new Vector3();
|
|
|
const _matrix4 = /*@__PURE__*/ new Matrix4();
|
|
|
const _vertex = /*@__PURE__*/ new Vector3();
|
|
|
|
|
|
+const _sphere = /*@__PURE__*/ new Sphere();
|
|
|
+
|
|
|
class SkinnedMesh extends Mesh {
|
|
|
|
|
|
constructor( geometry, material ) {
|
|
@@ -95,6 +97,29 @@ class SkinnedMesh extends Mesh {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ raycast( raycaster, intersects ) {
|
|
|
+
|
|
|
+ if ( this.boundingSphere === null ) this.computeBoundingSphere();
|
|
|
+
|
|
|
+ _sphere.copy( this.boundingSphere );
|
|
|
+ _sphere.applyMatrix4( this.matrixWorld );
|
|
|
+
|
|
|
+ if ( raycaster.ray.intersectsSphere( _sphere ) === false ) return;
|
|
|
+
|
|
|
+ this._computeIntersections( raycaster, intersects );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ getVertexPosition( index, target ) {
|
|
|
+
|
|
|
+ super.getVertexPosition( index, target );
|
|
|
+
|
|
|
+ this.applyBoneTransform( index, target );
|
|
|
+
|
|
|
+ return target;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
bind( skeleton, bindMatrix ) {
|
|
|
|
|
|
this.skeleton = skeleton;
|