data_object Properties 51

AngularDamping
float
Generic angular damping, i.e. how much the physics body will slow down on its own.
AngularDrag
obsoletefloat
AngularVelocity
Vector3
Angular velocity of this body in world space.
AutoSleep
bool
Whether this body is allowed to automatically go into "sleep" after a certain amount of time of inactivity.
BodyType
PhysicsBodyType
Movement type of physics body, either Static, Keyframed, Dynamic
Component
Component
The component that created this body
Density
float
Returns average of densities for all physics shapes of this body.
DragEnabled
obsoletebool
EnableCollisionSounds
bool
Whether to play collision sounds
Enabled
bool
Whether this body is enabled or not.
EnableSolidCollisions
bool
Sets Sandbox.PhysicsShape.EnableSolidCollisions on all shapes of this body.
EnableTouch
bool
Enables Touch callbacks on all PhysicsShapes of this body.
EnableTouchPersists
bool
Sets Sandbox.PhysicsShape.EnableTouchPersists on all shapes of this body.
EnhancedCcd
bool
Enable enhanced continuous collision detection (CCD) for this body.
GameObject
GameObject
The GameObject that created this body
GravityEnabled
bool
Whether gravity is enabled for this body or not.
GravityScale
float
Scale the gravity relative to Sandbox.PhysicsWorld.Gravity. 2 is double the gravity, etc.
GroupIndex
int
Return the index of this body in its PhysicsGroup
GroupName
string
What is this body called in the group?
Inertia
Vector3
The diagonal elements of the local inertia tensor matrix.
InertiaRotation
Rotation
The orientation of the principal axes of local inertia tensor matrix.
IsValid
bool
LastWaterEffect
RealTimeSince
Time since last water splash effect. Used internally.
LinearDamping
float
Generic linear damping, i.e. how much the physics body will slow down on its own.
LinearDrag
obsoletefloat
LocalMassCenter
Vector3
Center of mass for this physics body relative to its origin.
Locking
PhysicsLock
Locks individual axes of motion for this body.
Mass
float
Mass of this physics body.
MassCenter
Vector3
Center of mass for this physics body in world space coordinates.
MotionEnabled
bool
Controls physics simulation on this body.
OnIntersectionEnd
Action`1
OnIntersectionStart
Action`1
OnIntersectionUpdate
Action`1
OverrideMassCenter
bool
Is this physics body mass calculated or set directly.
Parent
PhysicsBody
The physics body we are attached to, if any
PhysicsGroup
PhysicsGroup
The physics group we belong to.
Position
Vector3
Position of this body in world coordinates.
Rotation
Rotation
Rotation of the physics body in world space.
Scale
obsoletefloat
SelfOrParent
PhysicsBody
A convenience property, returns Parent, or if there is no parent, returns itself.
ShapeCount
int
How many shapes belong to this body.
Shapes
IEnumerable`1
All shapes that belong to this body.
Sleeping
bool
You can use this to wake the body up, or prematurely send it to sleep.
SleepThreshold
float
The speed threshold below which this body will be put to sleep. Units per second.
SpeculativeContactEnabled
obsoletebool
Surface
Surface
SurfaceMaterial
string
Sets Sandbox.PhysicsShape.SurfaceMaterial on all child PhysicsShapes.
Transform
Transform
Transform of this physics body.
UseController
bool
If true we'll create a controller for this physics body.
Velocity
Vector3
Linear velocity of this body in world space.
World
PhysicsWorld
The physics world this body belongs to.

functions Methods 38

AddBoxShape (position, rotation, extent, rebuildMass)
PhysicsShape
Add a box shape to this body.
AddCapsuleShape (center, center2, radius, rebuildMass)
PhysicsShape
Add a capsule shape to this body.
AddCloneShape (shape)
obsoletePhysicsShape
AddConeShape (position, rotation, height, radius1, radius2, slices)
PhysicsShape
Add a cone shape to this body.
AddCylinderShape (position, rotation, height, radius, slices)
PhysicsShape
Add a cylinder shape to this body.
AddHeightFieldShape (heights, materials, sizeX, sizeY, sizeScale, heightScale)
PhysicsShape
Adds a heightfield shape to this physics body.
AddHullShape (position, rotation, points, rebuildMass)
PhysicsShape
AddMeshShape (vertices, indices)
PhysicsShape
AddPlaneShape (center, rotation, size, rebuildMass)
PhysicsShape
Add a plane shape to this body.
AddShape (part, transform, rebuildMass)
PhysicsShape
Add a shape from a physics hull
AddSphereShape (center, radius, rebuildMass)
PhysicsShape
ApplyAngularImpulse (impulse)
Applies instant angular impulse to this body.
ApplyForce (force)
Applies force to this body at the center of mass.
ApplyForceAt (position, force)
Applies force to this body at given position.
ApplyImpulse (impulse)
Applies instant linear impulse to this body at its center of mass.
ApplyImpulseAt (position, velocity)
Applies instant linear impulse to this body at given position.
ApplyTorque (force)
Applies angular velocity to this body.
CheckOverlap (body)
bool
Checks if another body overlaps us, ignoring all collision rules
ClearForces ()
Clear accumulated linear forces during this physics frame that were not yet applied.
ClearShapes ()
Remove all physics shapes, but not the physics body itself.
ClearTorque ()
Clear accumulated torque during this physics frame that was not yet applied.
ComputePenetration (body, direction, distance)
bool
Finds the smallest move needed to separate us from another body, ignoring all collision rules.
FindClosestPoint (vec)
Vector3
Returns the closest point to the given one between all shapes of this body.
GetBounds ()
BBox
Returns Axis-Aligned Bounding Box (AABB) of this physics body.
GetGameObject ()
obsoleteGameObject
GetLerpedTransform (time)
Transform
Get the lerped transform between physics steps.
GetVelocityAtPoint (point)
Vector3
Returns the world space velocity of a point of the object.
LocalPoint (p)
PhysicsPoint
Convenience function that returns a Sandbox.Physics.PhysicsPoint from a position relative to this body.
MassCenterPoint ()
PhysicsPoint
Returns a Sandbox.Physics.PhysicsPoint at the center of mass of this body.
Move (tx, delta)
Move to a new position, sweeping the shadow if Sandbox.PhysicsBody.UseController is enabled.
RebuildMass ()
Rebuilds mass from all shapes of this body based on their volume and physics properties.
Remove ()
Completely removes this physics body.
ResetInertiaTensor ()
Resets the inertia tensor to its calculated values.
SetComponentSource (c)
obsolete
SetInertiaTensor (inertia, rotation)
Sets the inertia tensor using the given moments and rotation.
SmoothMove (position, timeToArrive, timeDelta)
Move body to this position in a way that cooperates with the physics system.
SmoothRotate (rotation, smoothTime, timeDelta)
Rotate the body to this orientation in a way that cooperates with the physics system.
WorldPoint (p)
PhysicsPoint
Convenience function that returns a Sandbox.Physics.PhysicsPoint for this body from a world space position.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.