src/etc/CharacterBounds.js
/**
	* Returns the intesection point if the given ray hits one of the bounding volumes.
	* If no intersection is detected, null is returned.
	*
	* @param {Ray} ray - The ray.
	* @param {Vector3} intersectionPoint - The intersection point.
	* @return {Vector3} The intersection point.
	*/
Returns the intesection point if the given ray hits one of the bounding volumes.
If no intersection is detected, null is returned.

@param {Ray} ray - The ray.
@param {Vector3} intersectionPoint - The intersection point.
@return {Vector3} The intersection point.
Returns the intesection point if the given ray hits one of the bounding volumes . If no intersection is detected null is returned . @param { Ray } ray - The ray . @param { Vector3 } intersectionPoint - The intersection point . @return { Vector3 } The intersection point .
intersectRay( ray, intersectionPoint ) {
		if ( ray.intersectAABB( this._outerHitbox, intersectionPoint ) ) {
			const hitboxes = this._innerHitboxes;
			for ( let i = 0, l = hitboxes.length; i < l; i ++ ) {
				const hitbox = hitboxes[ i ];
				const bone = hitbox.bone;
				const inverseBoneMatrix = this._getInverseBoneMatrix( bone );
				rayBindSpace.copy( ray ).applyMatrix4( inverseBoneMatrix );
				rayBindSpace.applyMatrix4( hitbox.bindMatrix );
				if ( rayBindSpace.intersectAABB( hitbox.aabb, intersectionPoint ) ) {
					intersectionPoint.applyMatrix4( hitbox.bindMatrixInverse ).applyMatrix4( bone.matrixWorld );
					return intersectionPoint;
				}
			}
		}
		return null;
	}
intersectRay ( ray , intersectionPoint ) { if ( ray . intersectAABB ( this . _outerHitbox , intersectionPoint ) ) { const hitboxes = this . _innerHitboxes ; for ( let i = 0 , l = hitboxes . length ; i < l ; i ++ ) { const hitbox = hitboxes [ i ] ; const bone = hitbox . bone ; const inverseBoneMatrix = this . _getInverseBoneMatrix ( bone ) ; rayBindSpace . copy ( ray ) . applyMatrix4 ( inverseBoneMatrix ) ; rayBindSpace . applyMatrix4 ( hitbox . bindMatrix ) ; if ( rayBindSpace . intersectAABB ( hitbox . aabb , intersectionPoint ) ) { intersectionPoint . applyMatrix4 ( hitbox . bindMatrixInverse ) . applyMatrix4 ( bone . matrixWorld ) ; return intersectionPoint ; } } } return null ; }
Returns the intesection point if the given ray hits one of the bounding volumes.
Returns the intesection point if the given ray hits one of the bounding volumes .
// first text outer hitbox // now test with inner hitboxes // transform the ray from world space to local space of the bone // transform the ray from local space of the bone to its bind space (T-Pose) // now perform the intersection test // since the intersection point is in bind space, it's necessary to convert back to world space