Class PhysicsBody
Physics Body simulation object
public abstract class PhysicsBody : Object
- Inheritance
-
PhysicsBody
- Derived
Properties
AllContactedBodies
List of bodies in contact with this body
public PhysicsBody[] AllContactedBodies { get; }
Property Value
AllowsRotation
If body is allowed to rotate (Angular momentum)
public bool AllowsRotation { get; set; }
Property Value
AngularVelocity
Angular velocity in radians per second.
public double AngularVelocity { get; set; }
Property Value
Area
Area of the physics body
public double Area { get; }
Property Value
Category
Body category
public int Category { get; set; }
Property Value
CollisionMask
Collision mask
public int CollisionMask { get; set; }
Property Value
ContactMask
Contact mask
public int ContactMask { get; set; }
Property Value
Density
Body Density
public double Density { get; set; }
Property Value
Dynamic
Tells if the body is affected by forces and impulses in the simulation.
public bool Dynamic { get; set; }
Property Value
Friction
Surface roughness of the physics body. A value between 0.0 and 1.0, with a default of 0.2
public double Friction { get; set; }
Property Value
Joints
Joints that are connected to the physics body.
public PhysicsJoint[] Joints { get; }
Property Value
Mass
Mass of the physics body. (Updates the density when set.)
public double Mass { get; set; }
Property Value
Node
Get the node this body is connected
public Node Node { get; }
Property Value
Resting
Tells whether the body is resting on another body in the simulation, and thus does not participate in the simulation.
public bool Resting { get; set; }
Property Value
Restitution
Proportion of energy, between 0.0 and 1.0, that the physics body loses when it bounces off of another physics body. The default is 0.2.
public double Restitution { get; set; }
Property Value
Velocity
Body motion velocity vector
public Vector2 Velocity { get; set; }
Property Value
Methods
ApplyAngularImpulse(double)
Apply angular impulse to body
public void ApplyAngularImpulse(double impulse)
Parameters
impulsedouble
ApplyForce(Vector2)
Applies a force through the center of mass of the body
public void ApplyForce(Vector2 force)
Parameters
forceVector2
ApplyForce(Vector2, PointF)
Applies a force at the point to the body
public void ApplyForce(Vector2 force, PointF point)
Parameters
ApplyImpulse(Vector2)
Applies a impulse at the point to the body
public void ApplyImpulse(Vector2 impulse)
Parameters
impulseVector2
ApplyImpulse(Vector2, PointF)
Applies a impulse at the point to the body
public void ApplyImpulse(Vector2 impulse, PointF point)
Parameters
ApplyTorque(double)
Applies a torque to the body
public void ApplyTorque(double torque)
Parameters
torquedouble
ContactWith(PhysicsBody)
Check if the body is in contact with another body
public bool ContactWith(PhysicsBody otherBody)
Parameters
otherBodyPhysicsBody
Returns
ContactWithAll(PhysicsBody[])
Check if this body is in contact with all given bodies
public bool ContactWithAll(PhysicsBody[] otherBodies)
Parameters
otherBodiesPhysicsBody[]
Returns
ContactWithAny(PhysicsBody[])
Check if this body is in contact with any of the given bodies
public bool ContactWithAny(PhysicsBody[] otherBodies)
Parameters
otherBodiesPhysicsBody[]