Documentation
¶
Overview ¶
RigidBody2D implements full 2D physics. It cannot be controlled directly, instead, you must apply forces to it (gravity, impulses, etc.), and the physics simulation will calculate the resulting movement, rotation, react to collisions, and affect other physics bodies in its path.
The body's behavior can be adjusted via LockRotation, Freeze, and FreezeMode. By changing various properties of the object, such as Mass, you can control how the physics simulation acts on it.
A rigid body will always maintain its shape and size, even when forces are applied to it. It is useful for objects that can be interacted with in an environment, such as a tree that can be knocked over or a stack of crates that can be pushed around.
If you need to directly affect the body, prefer IntegrateForces as it allows you to directly access the physics state.
If you need to override the default physics behavior, you can write a custom force integration function. See CustomIntegrator.
Note: Changing the 2D transform or LinearVelocity of a RigidBody2D very often may lead to some unpredictable behaviors. This also happens when a RigidBody2D is the descendant of a constantly moving node, like another RigidBody2D, as that will cause its global transform to be set whenever its ancestor moves.
Index ¶
- type Advanced
- type Any
- type CCDMode
- type CenterOfMassMode
- type DampMode
- type Expanded
- type Extension
- func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance
- func (self *Extension[T]) AsCollisionObject2D() CollisionObject2D.Instance
- func (self *Extension[T]) AsNode() Node.Instance
- func (self *Extension[T]) AsNode2D() Node2D.Instance
- func (self *Extension[T]) AsObject() [1]gd.Object
- func (self *Extension[T]) AsPhysicsBody2D() PhysicsBody2D.Instance
- func (self *Extension[T]) AsRigidBody2D() Instance
- type FreezeMode
- type ID
- type Implementation
- type Instance
- func (self Instance) AddConstantCentralForce(force Vector2.XY)
- func (self Instance) AddConstantForce(force Vector2.XY)
- func (self Instance) AddConstantTorque(torque Float.X)
- func (self Instance) AngularDamp() Float.X
- func (self Instance) AngularDampMode() DampMode
- func (self Instance) AngularVelocity() Float.X
- func (self Instance) ApplyCentralForce(force Vector2.XY)
- func (self Instance) ApplyCentralImpulse()
- func (self Instance) ApplyForce(force Vector2.XY)
- func (self Instance) ApplyImpulse(impulse Vector2.XY)
- func (self Instance) ApplyTorque(torque Float.X)
- func (self Instance) ApplyTorqueImpulse(torque Float.X)
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsCollisionObject2D() CollisionObject2D.Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode2D() Node2D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsPhysicsBody2D() PhysicsBody2D.Instance
- func (self Instance) AsRigidBody2D() Instance
- func (self Instance) CanSleep() bool
- func (self Instance) CenterOfMass() Vector2.XY
- func (self Instance) CenterOfMassMode() CenterOfMassMode
- func (self Instance) ConstantForce() Vector2.XY
- func (self Instance) ConstantTorque() Float.X
- func (self Instance) ContactMonitor() bool
- func (self Instance) ContinuousCd() CCDMode
- func (self Instance) CustomIntegrator() bool
- func (self Instance) Freeze() bool
- func (self Instance) FreezeMode() FreezeMode
- func (self Instance) GetCollidingBodies() []Node2D.Instance
- func (self Instance) GetContactCount() int
- func (self Instance) GravityScale() Float.X
- func (self Instance) ID() ID
- func (self Instance) Inertia() Float.X
- func (self Instance) LinearDamp() Float.X
- func (self Instance) LinearDampMode() DampMode
- func (self Instance) LinearVelocity() Vector2.XY
- func (self Instance) LockRotation() bool
- func (self Instance) Mass() Float.X
- func (self Instance) MaxContactsReported() int
- func (self Instance) MoreArgs() MoreArgs
- func (self Instance) OnBodyEntered(cb func(body Node.Instance), flags ...Signal.Flags)
- func (self Instance) OnBodyExited(cb func(body Node.Instance), flags ...Signal.Flags)
- func (self Instance) OnBodyShapeEntered(cb func(body_rid RID.Any, body Node.Instance, body_shape_index int, ...), ...)
- func (self Instance) OnBodyShapeExited(cb func(body_rid RID.Any, body Node.Instance, body_shape_index int, ...), ...)
- func (self Instance) OnSleepingStateChanged(cb func(), flags ...Signal.Flags)
- func (self Instance) PhysicsMaterialOverride() PhysicsMaterial.Instance
- func (self Instance) SetAngularDamp(value Float.X)
- func (self Instance) SetAngularDampMode(value DampMode)
- func (self Instance) SetAngularVelocity(value Float.X)
- func (self Instance) SetAxisVelocity(axis_velocity Vector2.XY)
- func (self Instance) SetCanSleep(value bool)
- func (self Instance) SetCenterOfMass(value Vector2.XY)
- func (self Instance) SetCenterOfMassMode(value CenterOfMassMode)
- func (self Instance) SetConstantForce(value Vector2.XY)
- func (self Instance) SetConstantTorque(value Float.X)
- func (self Instance) SetContactMonitor(value bool)
- func (self Instance) SetContinuousCd(value CCDMode)
- func (self Instance) SetCustomIntegrator(value bool)
- func (self Instance) SetFreeze(value bool)
- func (self Instance) SetFreezeMode(value FreezeMode)
- func (self Instance) SetGravityScale(value Float.X)
- func (self Instance) SetInertia(value Float.X)
- func (self Instance) SetLinearDamp(value Float.X)
- func (self Instance) SetLinearDampMode(value DampMode)
- func (self Instance) SetLinearVelocity(value Vector2.XY)
- func (self Instance) SetLockRotation(value bool)
- func (self Instance) SetMass(value Float.X)
- func (self Instance) SetMaxContactsReported(value int)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetPhysicsMaterialOverride(value PhysicsMaterial.Instance)
- func (self Instance) SetSleeping(value bool)
- func (self Instance) Sleeping() bool
- func (self Instance) Virtual(name string) reflect.Value
- type Interface
- type MoreArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type CCDMode ¶
type CCDMode int //gd:RigidBody2D.CCDMode
const ( // Continuous collision detection disabled. This is the fastest way to detect body collisions, but can miss small, fast-moving objects. CcdModeDisabled CCDMode = 0 // Continuous collision detection enabled using raycasting. This is faster than shapecasting but less precise. CcdModeCastRay CCDMode = 1 // Continuous collision detection enabled using shapecasting. This is the slowest CCD method and the most precise. CcdModeCastShape CCDMode = 2 )
type CenterOfMassMode ¶
type CenterOfMassMode int //gd:RigidBody2D.CenterOfMassMode
const ( // In this mode, the body's center of mass is calculated automatically based on its shapes. This assumes that the shapes' origins are also their center of mass. CenterOfMassModeAuto CenterOfMassMode = 0 // In this mode, the body's center of mass is set through [CenterOfMass]. Defaults to the body's origin position. // // [CenterOfMass]: https://pkg.go.dev/graphics.gd/classdb/#Instance.CenterOfMass CenterOfMassModeCustom CenterOfMassMode = 1 )
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this [Extension]See Interface for methods that can be overridden by T.
func (*Extension[T]) AsCanvasItem ¶
func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance
func (*Extension[T]) AsCollisionObject2D ¶
func (self *Extension[T]) AsCollisionObject2D() CollisionObject2D.Instance
func (*Extension[T]) AsPhysicsBody2D ¶
func (self *Extension[T]) AsPhysicsBody2D() PhysicsBody2D.Instance
func (*Extension[T]) AsRigidBody2D ¶
type FreezeMode ¶
type FreezeMode int //gd:RigidBody2D.FreezeMode
const ( // Static body freeze mode (default). The body is not affected by gravity and forces. It can be only moved by user code and doesn't collide with other bodies along its path. FreezeModeStatic FreezeMode = 0 // Kinematic body freeze mode. Similar to [FreezeModeStatic], but collides with other bodies along its path when moved. Useful for a frozen body that needs to be animated. FreezeModeKinematic FreezeMode = 1 )
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Implementation ¶
type Implementation = implementation
Implementation implements Interface with empty methods.
type Instance ¶
type Instance [1]gdclass.RigidBody2D
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddConstantCentralForce ¶
Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with constant_force = Vector2(0, 0).
This is equivalent to using AddConstantForce at the body's center of mass.
func (Instance) AddConstantForce ¶
Adds a constant positioned force to the body that keeps being applied over time until cleared with constant_force = Vector2(0, 0).
'position' is the offset from the body origin in global coordinates.
func (Instance) AddConstantTorque ¶
Adds a constant rotational force without affecting position that keeps being applied over time until cleared with constant_torque = 0.
func (Instance) AngularDamp ¶
Damps the body's rotation. By default, the body will use the ProjectSettings "physics/2d/default_angular_damp" setting or any value override set by an Area2D the body is in. Depending on AngularDampMode, you can set AngularDamp to be added to or to replace the body's damping value.
See ProjectSettings "physics/2d/default_angular_damp" for more details about damping.
func (Instance) AngularDampMode ¶
Defines how AngularDamp is applied.
func (Instance) AngularVelocity ¶
The body's rotational velocity in radians per second.
func (Instance) ApplyCentralForce ¶
Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update.
This is equivalent to using ApplyForce at the body's center of mass.
func (Instance) ApplyCentralImpulse ¶
func (self Instance) ApplyCentralImpulse()
Applies a directional impulse without affecting rotation.
An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
This is equivalent to using ApplyImpulse at the body's center of mass.
func (Instance) ApplyForce ¶
Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update.
'position' is the offset from the body origin in global coordinates.
func (Instance) ApplyImpulse ¶
Applies a positioned impulse to the body.
An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
'position' is the offset from the body origin in global coordinates.
func (Instance) ApplyTorque ¶
Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update.
Note: Inertia is required for this to work. To have Inertia, an active CollisionShape2D must be a child of the node, or you can manually set Inertia.
func (Instance) ApplyTorqueImpulse ¶
Applies a rotational impulse to the body without affecting the position.
An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
Note: Inertia is required for this to work. To have Inertia, an active CollisionShape2D must be a child of the node, or you can manually set Inertia.
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance
func (Instance) AsCollisionObject2D ¶
func (self Instance) AsCollisionObject2D() CollisionObject2D.Instance
func (Instance) AsPhysicsBody2D ¶
func (self Instance) AsPhysicsBody2D() PhysicsBody2D.Instance
func (Instance) AsRigidBody2D ¶
func (Instance) CanSleep ¶
If true, the body can enter sleep mode when there is no movement. See Sleeping.
func (Instance) CenterOfMass ¶
The body's custom center of mass, relative to the body's origin position, when CenterOfMassMode is set to CenterOfMassModeCustom. This is the balanced point of the body, where applied forces only cause linear acceleration. Applying forces outside of the center of mass causes angular acceleration.
When CenterOfMassMode is set to CenterOfMassModeAuto (default value), the center of mass is automatically determined, but this does not update the value of CenterOfMass.
func (Instance) CenterOfMassMode ¶
func (self Instance) CenterOfMassMode() CenterOfMassMode
Defines the way the body's center of mass is set.
func (Instance) ConstantForce ¶
The body's total constant positional forces applied during each physics update.
See AddConstantForce and AddConstantCentralForce.
func (Instance) ConstantTorque ¶
The body's total constant rotational forces applied during each physics update.
See AddConstantTorque.
func (Instance) ContactMonitor ¶
If true, the RigidBody2D will emit signals when it collides with another body.
Note: By default the maximum contacts reported is set to 0, meaning nothing will be recorded, see MaxContactsReported.
func (Instance) ContinuousCd ¶
Continuous collision detection mode.
Continuous collision detection tries to predict where a moving body will collide instead of moving it and correcting its movement after collision. Continuous collision detection is slower, but more precise and misses fewer collisions with small, fast-moving objects. Raycasting and shapecasting methods are available.
func (Instance) CustomIntegrator ¶
If true, the standard force integration (like gravity or damping) will be disabled for this body. Other than collision response, the body will only move as determined by the IntegrateForces method, if that virtual method is overridden.
Setting this property will call the method PhysicsServer2D.BodySetOmitForceIntegration internally.
func (Instance) Freeze ¶
If true, the body is frozen. Gravity and forces are not applied anymore.
See FreezeMode to set the body's behavior when frozen.
For a body that is always frozen, use StaticBody2D or AnimatableBody2D instead.
func (Instance) FreezeMode ¶
func (self Instance) FreezeMode() FreezeMode
The body's freeze mode. Can be used to set the body's behavior when Freeze is enabled.
For a body that is always frozen, use StaticBody2D or AnimatableBody2D instead.
func (Instance) GetCollidingBodies ¶
Returns a list of the bodies colliding with this one. Requires ContactMonitor to be set to true and MaxContactsReported to be set high enough to detect all the collisions.
Note: The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead.
func (Instance) GetContactCount ¶
Returns the number of contacts this body has with other bodies. By default, this returns 0 unless bodies are configured to monitor contacts (see ContactMonitor).
Note: To retrieve the colliding bodies, use GetCollidingBodies.
func (Instance) GravityScale ¶
Multiplies the gravity applied to the body. The body's gravity is calculated from the ProjectSettings "physics/2d/default_gravity" project setting and/or any additional gravity vector applied by Area2Ds.
func (Instance) Inertia ¶
The body's moment of inertia. This is like mass, but for rotation: it determines how much torque it takes to rotate the body. The moment of inertia is usually computed automatically from the mass and the shapes, but this property allows you to set a custom value.
If set to 0, inertia is automatically computed (default value).
Note: This value does not change when inertia is automatically computed. Use PhysicsServer2D to get the computed inertia.
func (Instance) LinearDamp ¶
Damps the body's movement. By default, the body will use the ProjectSettings "physics/2d/default_linear_damp" setting or any value override set by an Area2D the body is in. Depending on LinearDampMode, you can set LinearDamp to be added to or to replace the body's damping value.
See ProjectSettings "physics/2d/default_linear_damp" for more details about damping.
func (Instance) LinearDampMode ¶
Defines how LinearDamp is applied.
func (Instance) LinearVelocity ¶
The body's linear velocity in pixels per second. Can be used sporadically, but don't set this every frame, because physics may run in another thread and runs at a different granularity. Use IntegrateForces as your process loop for precise control of the body state.
func (Instance) LockRotation ¶
If true, the body cannot rotate. Gravity and forces only apply linear movement.
func (Instance) MaxContactsReported ¶
The maximum number of contacts that will be recorded. Requires a value greater than 0 and ContactMonitor to be set to true to start to register contacts. Use GetContactCount to retrieve the count or GetCollidingBodies to retrieve bodies that have been collided with.
Note: The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end), and collisions between parallel faces will result in four contacts (one at each corner).
func (Instance) MoreArgs ¶
MoreArgs enables certain functions to be called with additional 'optional' arguments.
func (Instance) OnBodyEntered ¶
Emitted when a collision with another PhysicsBody2D or TileMap occurs. Requires ContactMonitor to be set to true and MaxContactsReported to be set high enough to detect all the collisions. TileMaps are detected if the TileSet has Collision Shape2Ds.
'body' the Node, if it exists in the tree, of the other PhysicsBody2D or TileMap.
func (Instance) OnBodyExited ¶
Emitted when the collision with another PhysicsBody2D or TileMap ends. Requires ContactMonitor to be set to true and MaxContactsReported to be set high enough to detect all the collisions. TileMaps are detected if the TileSet has Collision Shape2Ds.
'body' the Node, if it exists in the tree, of the other PhysicsBody2D or TileMap.
func (Instance) OnBodyShapeEntered ¶
func (self Instance) OnBodyShapeEntered(cb func(body_rid RID.Any, body Node.Instance, body_shape_index int, local_shape_index int), flags ...Signal.Flags)
Emitted when one of this RigidBody2D's Shape2Ds collides with another PhysicsBody2D or TileMap's Shape2Ds. Requires ContactMonitor to be set to true and MaxContactsReported to be set high enough to detect all the collisions. TileMaps are detected if the TileSet has Collision Shape2Ds.
'body_rid' the Resource.ID of the other PhysicsBody2D or TileSet's CollisionObject2D used by the PhysicsServer2D.
'body' the Node, if it exists in the tree, of the other PhysicsBody2D or TileMap.
'body_shape_index' the index of the Shape2D of the other PhysicsBody2D or TileMap used by the PhysicsServer2D. Get the CollisionShape2D node with body.shape_owner_get_owner(body.shape_find_owner(body_shape_index)).
'local_shape_index' the index of the Shape2D of this RigidBody2D used by the PhysicsServer2D. Get the CollisionShape2D node with self.shape_owner_get_owner(self.shape_find_owner(local_shape_index)).
func (Instance) OnBodyShapeExited ¶
func (self Instance) OnBodyShapeExited(cb func(body_rid RID.Any, body Node.Instance, body_shape_index int, local_shape_index int), flags ...Signal.Flags)
Emitted when the collision between one of this RigidBody2D's Shape2Ds and another PhysicsBody2D or TileMap's Shape2Ds ends. Requires ContactMonitor to be set to true and MaxContactsReported to be set high enough to detect all the collisions. TileMaps are detected if the TileSet has Collision Shape2Ds.
'body_rid' the Resource.ID of the other PhysicsBody2D or TileSet's CollisionObject2D used by the PhysicsServer2D.
'body' the Node, if it exists in the tree, of the other PhysicsBody2D or TileMap.
'body_shape_index' the index of the Shape2D of the other PhysicsBody2D or TileMap used by the PhysicsServer2D. Get the CollisionShape2D node with body.shape_owner_get_owner(body.shape_find_owner(body_shape_index)).
'local_shape_index' the index of the Shape2D of this RigidBody2D used by the PhysicsServer2D. Get the CollisionShape2D node with self.shape_owner_get_owner(self.shape_find_owner(local_shape_index)).
func (Instance) OnSleepingStateChanged ¶
Emitted when the physics engine changes the body's sleeping state.
Note: Changing the value Sleeping will not trigger this signal. It is only emitted if the sleeping state is changed by the physics engine or emit_signal("sleeping_state_changed") is used.
func (Instance) PhysicsMaterialOverride ¶
func (self Instance) PhysicsMaterialOverride() PhysicsMaterial.Instance
The physics material override for the body.
If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one.
func (Instance) SetAngularDamp ¶
SetAngularDamp sets the property returned by [GetAngularDamp].
func (Instance) SetAngularDampMode ¶
SetAngularDampMode sets the property returned by [GetAngularDampMode].
func (Instance) SetAngularVelocity ¶
SetAngularVelocity sets the property returned by [GetAngularVelocity].
func (Instance) SetAxisVelocity ¶
Sets the body's velocity on the given axis. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior.
func (Instance) SetCanSleep ¶
SetCanSleep sets the property returned by [IsAbleToSleep].
func (Instance) SetCenterOfMass ¶
SetCenterOfMass sets the property returned by [GetCenterOfMass].
func (Instance) SetCenterOfMassMode ¶
func (self Instance) SetCenterOfMassMode(value CenterOfMassMode)
SetCenterOfMassMode sets the property returned by [GetCenterOfMassMode].
func (Instance) SetConstantForce ¶
SetConstantForce sets the property returned by [GetConstantForce].
func (Instance) SetConstantTorque ¶
SetConstantTorque sets the property returned by [GetConstantTorque].
func (Instance) SetContactMonitor ¶
SetContactMonitor sets the property returned by [IsContactMonitorEnabled].
func (Instance) SetContinuousCd ¶
SetContinuousCd sets the property returned by [GetContinuousCollisionDetectionMode].
func (Instance) SetCustomIntegrator ¶
SetCustomIntegrator sets the property returned by [IsUsingCustomIntegrator].
func (Instance) SetFreezeMode ¶
func (self Instance) SetFreezeMode(value FreezeMode)
SetFreezeMode sets the property returned by [GetFreezeMode].
func (Instance) SetGravityScale ¶
SetGravityScale sets the property returned by [GetGravityScale].
func (Instance) SetInertia ¶
SetInertia sets the property returned by [GetInertia].
func (Instance) SetLinearDamp ¶
SetLinearDamp sets the property returned by [GetLinearDamp].
func (Instance) SetLinearDampMode ¶
SetLinearDampMode sets the property returned by [GetLinearDampMode].
func (Instance) SetLinearVelocity ¶
SetLinearVelocity sets the property returned by [GetLinearVelocity].
func (Instance) SetLockRotation ¶
SetLockRotation sets the property returned by [IsLockRotationEnabled].
func (Instance) SetMaxContactsReported ¶
SetMaxContactsReported sets the property returned by [GetMaxContactsReported].
func (Instance) SetPhysicsMaterialOverride ¶
func (self Instance) SetPhysicsMaterialOverride(value PhysicsMaterial.Instance)
SetPhysicsMaterialOverride sets the property returned by [GetPhysicsMaterialOverride].
func (Instance) SetSleeping ¶
SetSleeping sets the property returned by [IsSleeping].
func (Instance) Sleeping ¶
If true, the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the ApplyImpulse or ApplyForce methods.
type Interface ¶
type Interface interface { // Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it is called before the standard force integration, but the [CustomIntegrator] property allows you to disable the standard force integration and do fully custom force integration for a body. // // [CustomIntegrator]: https://pkg.go.dev/graphics.gd/classdb/RigidBody2D#Instance.CustomIntegrator IntegrateForces(state PhysicsDirectBodyState2D.Instance) }
type MoreArgs ¶
type MoreArgs [1]gdclass.RigidBody2D
MoreArgs is a container for Instance functions with additional 'optional' arguments.
func (MoreArgs) AddConstantForce ¶
Adds a constant positioned force to the body that keeps being applied over time until cleared with constant_force = Vector2(0, 0).
'position' is the offset from the body origin in global coordinates.
func (MoreArgs) ApplyCentralImpulse ¶
Applies a directional impulse without affecting rotation.
An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
This is equivalent to using ApplyImpulse at the body's center of mass.
func (MoreArgs) ApplyForce ¶
Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update.
'position' is the offset from the body origin in global coordinates.
func (MoreArgs) ApplyImpulse ¶
Applies a positioned impulse to the body.
An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
'position' is the offset from the body origin in global coordinates.