MeshSurfaceSampler class

Utility class for sampling weighted random points on the surface of a mesh.

Building the sampler is a one-time O(n) operation. Once built, any number of random samples may be selected in O(logn) time. Memory usage is O(n).

References:

Constructors

MeshSurfaceSampler(dynamic mesh)

Properties

colorAttribute ↔ BufferAttribute<NativeArray<num>>
getter/setter pair
distribution ↔ Float32Array?
getter/setter pair
geometry ↔ BufferGeometry
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
positionAttribute ↔ BufferAttribute<NativeArray<num>>
getter/setter pair
randomFunction Function
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
weightAttribute ↔ BufferAttribute<NativeArray<num>>?
getter/setter pair

Methods

binarySearch(dynamic x) → dynamic
build() → dynamic
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sample(dynamic targetPosition, dynamic targetNormal, dynamic targetColor) → dynamic
sampleFace(dynamic faceIndex, dynamic targetPosition, dynamic targetNormal, dynamic targetColor) → dynamic
setRandomGenerator(dynamic randomFunction) → dynamic
setWeightAttribute(dynamic name) → dynamic
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited