BasicCollider class Physics
Pure-Dart Collider implementation registered with the ancestor BasicPhysicsWorld on mount.
Carries a Shape plus surface properties and a local pose. Used for raycasting, overlap queries, and trigger events. Attaching one without a BasicKinematicBody on the same node yields a static collider (the basic backend has no dynamics solver).
Constructors
- BasicCollider({required Shape shape, PhysicsMaterial material = PhysicsMaterial.defaultMaterial, int collisionLayer = 0xFFFFFFFF, int collisionMask = 0xFFFFFFFF, bool isTrigger = false, Matrix4? localPose})
Properties
- collisionLayer ↔ int
-
Bitmask identifying this collider's layer. A contact is generated
only when each side's collisionLayer is set in the other side's
collisionMask.
getter/setter pairoverride
- collisionMask ↔ int
-
Bitmask of layers this collider responds to.
getter/setter pairoverride
- enabled ↔ bool
-
Whether this component's update hook runs each frame.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAttached → bool
-
Whether this component is currently attached to a node.
no setterinherited
- isLoaded → bool
-
Whether onLoad has completed.
no setterinherited
- isMounted → bool
-
Whether the owning node is part of a live scene graph.
no setterinherited
- isTrigger ↔ bool
-
When
true, this collider emits TriggerEntered / TriggerExited events but does not produce a contact response.getter/setter pairoverride - localPose ↔ Matrix4
-
Pose of the collider relative to its owning Node. Used when one
node carries multiple colliders, or when the collision volume is
offset from the node's origin.
getter/setter pairoverride
- material ↔ PhysicsMaterial
-
getter/setter pairoverride
- node → Node
-
The node this component is attached to.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shape ↔ Shape
-
getter/setter pairoverride
- worldPose → Matrix4
-
Concatenated
node.globalTransform * localPose. Used by the world when computing world-space bounding volumes and intersection tests.no setter
Methods
-
fixedUpdate(
double fixedDt) → void -
Called once per fixed physics step while the component is mounted,
enabled, and loaded.
fixedDtis the fixed timestep of the surrounding PhysicsWorld, not the frame interval.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onAttach(
) → void -
Called when this component is added to a node.
inherited
-
onDetach(
) → void -
Called when this component is removed from a node.
inherited
-
onLoad(
) → Future< void> -
Optional asynchronous setup, such as loading an asset.
inherited
-
onMount(
) → void -
Called when the owning node enters a live scene graph.
override
-
onUnmount(
) → void -
Called when the owning node leaves a live scene graph.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
double deltaSeconds) → void -
Called once per frame while the component is mounted, enabled, and
loaded.
deltaSecondsis the elapsed time since the previous tick.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited