BodySettings3D class final
Everything about a new body but its shape.
Constructors
- BodySettings3D({Vector3? position, Quaternion? rotation, Vector3? linearVelocity, Vector3? angularVelocity, BodyType3D type = BodyType3D.dynamic, MotionQuality3D motionQuality = MotionQuality3D.discrete, int layer = 0, bool isSensor = false, bool allowSleeping = true, bool lockRotation = false, double friction = 0.5, double restitution = 0.0, double linearDamping = 0.05, double angularDamping = 0.05, double gravityFactor = 1.0, double mass = 0.0, int userData = 0})
- A body with the given settings; the defaults are a dynamic body on layer 0 that may sleep.
Properties
- allowSleeping → bool
-
Whether it may fall asleep once at rest.
final
- angularDamping → double
-
How quickly it loses velocity and spin by itself.
final
- angularVelocity → Vector3
-
Spin it starts with (rad/s).
final
- friction → double
-
Surface friction, usually 0–1.
final
- gravityFactor → double
-
How strongly gravity pulls it; 0 floats.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isSensor → bool
-
Whether it only reports what enters and leaves it, never colliding.
final
- layer → int
-
Collision layer, 0–15 (see PhysicsWorldSettings3D.layerMasks).
final
- linearDamping → double
-
How quickly it loses velocity and spin by itself.
final
- linearVelocity → Vector3
-
Velocity it starts with (m/s).
final
- lockRotation → bool
-
Whether it never turns (a crate that only slides, an upright enemy).
final
- mass → double
-
Mass in kg; 0 works it out from the shape's volume.
final
- motionQuality → MotionQuality3D
-
Discrete or continuous collision.
final
- position → Vector3
-
Where it starts, in metres.
final
- restitution → double
-
Bounciness, 0–1.
final
- rotation → Quaternion
-
How it starts turned.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → BodyType3D
-
Static, kinematic or dynamic.
final
- userData → int
-
Any number the game wants back with the body (an entity id, say).
final
Methods
-
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