Collider3D class
The shape of its entity's RigidBody3D — or, without one, of a static body made for it. It follows the entity's scale. Set to ColliderShape3D.matchShape it takes the shape its entity is drawn as.
Constructors
-
Collider3D({ColliderShape3D shape = ColliderShape3D.box, Vector3? size, double radius = 0.5, double height = 2.0, String model = '', String meshName = '', List<
double> ? heights, int heightFieldSize = 0, double cellSize = 1.0, Vector3? offset, Vector3? rotation, Vector3? scale}) - A 1 m box, by default.
Properties
- cellSize ↔ double
-
Height field: metres between samples.
getter/setter pair
- componentType → Type
-
Type identifier for this component
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- height ↔ double
-
Capsule: its whole height, caps included. Cylinder: its height.
getter/setter pair
- heightFieldSize ↔ int
-
Height field: samples along each side; at least 4.
getter/setter pair
-
heights
↔ List<
double> -
Height field: heightFieldSize rows of heightFieldSize heights,
each how far up the ground is at that sample.
getter/setter pair
- meshName ↔ String
-
Convex hull and mesh: the model's mesh to use; empty for all of them.
getter/setter pair
- model ↔ String
-
Convex hull and mesh: the model (
.glb,.gltf) whose triangles it takes, loaded through the engine's assets.getter/setter pair - naturalSize → Vector3
-
The shape's size before any scale, for an editor's outline:
sizefor a box,2 × radius(and height) for the round ones.no setter - offset ↔ Vector3
-
Where the shape sits in its entity's space.
getter/setter pair
- radius ↔ double
-
Sphere, capsule and cylinder: the radius.
getter/setter pair
- rotation ↔ Vector3
-
How the shape is turned in its entity's space (Euler angles, radians).
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scale ↔ Vector3
-
The shape's own scale, on top of its entity's.
getter/setter pair
- shape ↔ ColliderShape3D
-
Which shape.
getter/setter pair
- size ↔ Vector3
-
Box: its full size along X, Y and Z.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onAttach(
EntityId entityId) → void -
Called when this component is added to an entity.
inherited
-
onDetach(
EntityId entityId) → void -
Called when this component is removed from an entity.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited