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(Mesh mesh)
Properties
- colorAttribute ↔ Float32BufferAttribute?
-
getter/setter pair
- distribution ↔ Float32List?
-
getter/setter pair
- geometry ↔ BufferGeometry
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- positionAttribute ↔ Float32BufferAttribute
-
getter/setter pair
- randomFunction ↔ double Function()
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- weightAttribute ↔ Float32BufferAttribute?
-
getter/setter pair
Methods
-
binarySearch(
dynamic x) → int -
build(
) → MeshSurfaceSampler -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sample(
Vector3 targetPosition, [Vector3? targetNormal, Color? targetColor]) → MeshSurfaceSampler -
sampleFace(
int faceIndex, Vector3 targetPosition, [Vector3? targetNormal, Color? targetColor]) → MeshSurfaceSampler -
setRandomGenerator(
dynamic randomFunction) → MeshSurfaceSampler -
setWeightAttribute(
String? name) → MeshSurfaceSampler -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited