ColliderShapes3D class final

Turns Collider3Ds into physics-engine Shape3Ds, following the entity's scale. Mesh and hull shapes are kept by model, mesh and scale, height fields by their heights and scale, and shapes matching an entity's look by that look's key and scale, so every body asking for the same one gets the same lists — and the physics engine shares one native shape between them. Each kind keeps its most recently used few (modelLimit, fieldLimit, solidLimit); a shape dropped is made again when next asked for.

Constructors

ColliderShapes3D({ColliderGeometry3D? geometry})
Shapes whose triangles come from geometry.

Properties

geometry → ColliderGeometry3D?
Where mesh and hull colliders get their triangles; without it they make no shape.
final
hashCode → int
The hash code for this object.
no setterinherited
length → int
How many shapes it keeps now, of every kind.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(Collider3D collider, Vector3 entityScale, {SolidShapeSource? source}) → Shape3D?
collider's shape at entityScale; null while its triangles are not there yet, or when it cannot make one — a collider matching the shape of an entity with none (source null).
clear() → void
Forgets every shape it made.
forgetModel(String model) → void
Forgets the shapes made from model, and what geometry kept of it when that is an AssetColliderGeometry3D: after the model was loaded again, its colliders take its new triangles (PhysicsSystem3D.reloadModel calls this).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

solidPart(SolidPart part, double sx, double sy, double sz) → Shape3D?
part scaled by (sx, sy, sz) as a physics-engine shape, placed where it is; null for a hull of too few points.

Constants

fieldLimit → const int
How many height-field shapes are kept before the least recently used go.
minExtent → const double
The smallest size a primitive gets, so a zero scale makes a tiny shape rather than an invalid one.
modelLimit → const int
How many mesh and hull shapes are kept before the least recently used go: each holds a scaled copy of its model's triangles.
solidLimit → const int
How many shapes matching a look are kept before the least recently used go.