File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,17 @@ export function createMeshesFromMultiMaterialMesh(mesh: Mesh): Group;
15
15
16
16
export function sortInstancedMesh ( mesh : InstancedMesh , compareFn : ( a : number , b : number ) => number ) : void ;
17
17
18
+ /**
19
+ * Akin to Array.prototype.reduce(), but operating on the vertices of all the visible descendant objects, in world space.
20
+ * Additionally, it can operate as a transform-reduce, returning a different type T than the Vector3 input.
21
+ * This can be useful for e.g. fitting a viewing frustum to the scene.
22
+ *
23
+ * @param object - The object to traverse (uses traverseVisible internally).
24
+ * @param func - The binary function applied for the reduction.
25
+ * Must have the signature: (value: T, vertex: Vector3): T.
26
+ * @param initialValue - The value to initialize the reduction with.
27
+ * This is required as it also sets the reduction type, which is not required to be Vector3.
28
+ */
18
29
export function reduceVertices < TValue > (
19
30
object : Object3D ,
20
31
func : ( value : TValue , vertex : Vector3 ) => TValue ,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { Raycaster } from './../core/Raycaster';
3
3
import { Object3D } from './../core/Object3D' ;
4
4
import { BufferGeometry } from '../core/BufferGeometry' ;
5
5
import { Intersection } from '../core/Raycaster' ;
6
+ import { Vector3 } from '../math/Vector3' ;
6
7
7
8
export class Mesh <
8
9
TGeometry extends BufferGeometry = BufferGeometry ,
@@ -18,5 +19,12 @@ export class Mesh<
18
19
type : string ;
19
20
20
21
updateMorphTargets ( ) : void ;
22
+
23
+ /**
24
+ * Get the current position of the indicated vertex in local space,
25
+ * taking into account the current animation state of both morph targets and skinning.
26
+ */
27
+ getVertexPosition ( vert : number , target : Vector3 ) : Vector3 ;
28
+
21
29
raycast ( raycaster : Raycaster , intersects : Intersection [ ] ) : void ;
22
30
}
You can’t perform that action at this time.
0 commit comments