BasicKinematicBody class Physics
Pure-Dart RigidBody implementation. Always BodyType.kinematic; the user moves the owning node's transform directly and the body records velocity for components that read it. There is no dynamics solver in the basic backend, so force and impulse APIs are no-ops.
For fully simulated rigid bodies, depend on a backend package that ships a constraint solver. The constructor rejects BodyType.dynamic_ with a clear error to make the limitation obvious instead of silently producing wrong results.
Constructors
- BasicKinematicBody({BodyType type = BodyType.kinematic, double? mass, Matrix3? inertiaTensor, Vector3? linearVelocity, Vector3? angularVelocity, double linearDamping = 0, double angularDamping = 0, bool useGravity = false, bool ccdEnabled = false, Vector3? linearAxisLocks, Vector3? angularAxisLocks})
Properties
- angularAxisLocks ↔ Vector3
-
Per-axis angular motion factors. See linearAxisLocks.
getter/setter pairoverride
- angularDamping ↔ double
-
Per-step angular velocity damping in
[0, 1].0is no damping.getter/setter pairoverride - angularVelocity ↔ Vector3
-
getter/setter pairoverride
- ccdEnabled ↔ bool
-
When
true, the backend uses continuous collision detection to prevent fast-moving bodies from tunneling through thin colliders.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
- inertiaTensor ↔ Matrix3?
-
Local-space inertia tensor. When null, derived from the owning
colliders.
getter/setter pairoverride
- 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
- isSleeping → bool
-
no setteroverride
- linearAxisLocks ↔ Vector3
-
Per-axis linear motion factors. Each component is in
[0, 1]:1leaves the axis free,0locks it. Use to constrain motion to a plane (for example(1, 1, 0)for 2D-style motion in XY).getter/setter pairoverride - linearDamping ↔ double
-
Per-step linear velocity damping in
[0, 1].0is no damping.getter/setter pairoverride - linearVelocity ↔ Vector3
-
getter/setter pairoverride
- mass ↔ double?
-
Mass in kilograms. When null, the backend derives mass from the
owning colliders' shapes and material densities.
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
- type → BodyType
-
no setteroverride
- useGravity ↔ bool
-
getter/setter pairoverride
Methods
-
applyAngularImpulse(
Vector3 impulse) → void -
override
-
applyForce(
Vector3 force, {Vector3? atWorldPoint}) → void -
No-op in the basic backend. There is no constraint solver, so
applied forces have nowhere to integrate. Kept on the API surface
for portability: code written against the abstract RigidBody
works against any backend.
override
-
applyImpulse(
Vector3 impulse, {Vector3? atWorldPoint}) → void -
override
-
applyTorque(
Vector3 torque) → void -
override
-
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
-
putToSleep(
) → void -
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 -
wakeUp(
) → void -
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited