RigidBody class
Constructors
RigidBody.new ({Vector3? position , Quaternion? orientation , List <Shape > ? shapes , String ? name , RigidBodyType type = RigidBodyType.static , bool allowSleep = true , bool isSleeping = false , bool adjustPosition = true , Vector3? linearVelocity , Vector3? angularVelocity , double ? mass , bool isTrigger = false })
Properties
addedToIsland
↔ bool
I indicates rigid body whether it has been added to the simulation Island.
getter/setter pair
allowSleep
↔ bool
It shows how to sleep rigid body.
getter/setter pair
angularVelocity
↔ Vector3
Is the angular velocity.
getter/setter pair
collide
↔ void Function(RigidBody body ) ?
getter/setter pair
contactLink
↔ ContactLink ?
getter/setter pair
fixedRotation
↔ bool
getter/setter pair
hashCode
→ int
The hash code for this object.
no setter inherited
id
↔ int
getter/setter pair
initAngularVelocity
↔ Vector3
getter/setter pair
initLinearVelocity
↔ Vector3
getter/setter pair
initOrientation
↔ Quaternion
getter/setter pair
initPosition
↔ Vector3
Initilized parameters
getter/setter pair
inverseInertia
↔ Matrix3
It is the inverse of the inertia tensor in the world system.
getter/setter pair
inverseLocalInertia
↔ Matrix3
It is the inverse of the inertia tensor in the initial state.
getter/setter pair
inverseMass
↔ double
It is the reciprocal of the mass.
getter/setter pair
invScale
↔ double
getter/setter pair
isDynamic
→ bool
I indicates that this rigid body to determine whether it is a rigid body dynamic.
no setter
isKinematic
→ bool
no setter
isStatic
→ bool
I will show this rigid body to determine whether it is a rigid body static.
no setter
isTrigger
↔ bool
getter/setter pair
jointLink
↔ JointLink ?
It is the link array of joint that is connected to the rigid body.
getter/setter pair
linearVelocity
↔ Vector3
Is the translational velocity.
getter/setter pair
localInertia
↔ Matrix3
It is the inertia tensor in the initial state.
getter/setter pair
mass
↔ double
This is the weight.
getter/setter pair
massInfo
↔ MassInfo
getter/setter pair
name
↔ String
getter/setter pair
next
↔ RigidBody ?
getter/setter pair
numContacts
↔ int
getter/setter pair
numJoints
↔ int
The number of joints that are connected to the rigid body.
getter/setter pair
numShapes
↔ int
The number of shapes that are included in the rigid body.
getter/setter pair
orientation
↔ Quaternion
getter/setter pair
parent
↔ World ?
It is a world that rigid body has been added.
getter/setter pair
position
↔ Vector3
getter/setter pair
prev
↔ RigidBody ?
The maximum number of shapes that can be added to a one rigid.
getter/setter pair
rotation
↔ Matrix3
It is a rotation matrix representing the orientation.
getter/setter pair
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
scale
↔ double
getter/setter pair
shapes
↔ Shape ?
An array of shapes that are included in the rigid body.
getter/setter pair
sleeping
↔ bool
I shows rigid body to determine whether it is a sleep state.
getter/setter pair
sleepOrientation
↔ Quaternion
It is a quaternion that represents the attitude of sleep just before.
getter/setter pair
sleepPosition
↔ Vector3
It is the world coordinate of the center of gravity in the sleep just before.
getter/setter pair
sleepTime
↔ double
This is the time from when the rigid body at rest.
getter/setter pair
tmpInertia
↔ Matrix3
getter/setter pair
type
↔ RigidBodyType
getter/setter pair
Methods
addShape (Shape shape )
→ void
I'll add a shape to rigid body.
If you add a shape, please call the setupMass method to step up to the start of the next.
shape
shape to Add
applyImpulse (Vector3 position , Vector3 force )
→ void
applyTorque (Vector3 torque )
→ void
awake ()
→ void
Awake the rigid body.
override
checkContact (dynamic name )
→ void
dispose ()
→ void
Dispose of the body
override
getAxis ()
→ Vector3
isLonely ()
→ bool
Get whether the rigid body has not any connection with others.
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove ()
→ void
Remove the body
override
removeShape (Shape shape )
→ void
I will delete the shape from the rigid body.
If you delete a shape, please call the setupMass method to step up to the start of the next.
shape
shape to delete
resetPosition (double x , double y , double z )
→ void
resetQuaternion (Quaternion q )
→ void
resetRotation (double x , double y , double z )
→ void
rotateInertia (Matrix3 rot , Matrix3 inertia , Matrix3 out )
→ void
setParent (World world )
→ void
Set the parent of the body
override
setPosition (Vector3 pos )
→ void
setQuaternion (Quaternion q )
→ void
setRotation (Quaternion rot )
→ void
setupInertia (Vector3 tmpV , bool adjustPosition )
→ void
setupMass ([bool adjustPosition = true ])
→ void
Calulates mass datas(center of gravity, mass, moment inertia, etc...).
If the parameter type is set to BODY_STATIC, the rigid body will be fixed to the space.
If the parameter adjustPosition is set to true, the shapes' relative positions and
the rigid body's position will be adjusted to the center of gravity.
type type of rigid body
adjustPosition
sleep ()
→ void
Sleep the rigid body.
override
syncShapes ()
→ void
testWakeUp ()
→ void
toString ()
→ String
A string representation of this object.
inherited
updatePosition (double timeStep )
→ void
The time integration of the motion of a rigid body, you can update the information such as the shape.
This method is invoked automatically when calling the step of the World,
There is no need to call from outside usually.