Class BodyDesc¶
Namespace: Apogee.Physics
Assembly: Apogee.Physics.dll
What a body is made of and how it behaves: the shape, how it moves, its mass, surface and layers. Fill one in and give it to
public sealed class BodyDesc : EngineObject
Inheritance¶
object ← EngineObject ← BodyDesc
Inherited Members¶
EngineObject.IsAdopted, EngineObject.Handle, EngineObject.IsDestroyed, EngineObject.Class, EngineObject.Adopt(), EngineObject.TryGet(SlotHandle, out EngineObject), EngineObject.Destroy(), object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Properties¶
AllowSleeping¶
public bool AllowSleeping { get; set; }
Property Value¶
AngularDamping¶
public float AngularDamping { get; set; }
Property Value¶
AngularVelocity¶
public Vector3 AngularVelocity { get; set; }
Property Value¶
Bullet¶
Check the whole path of a fast body instead of its position at each step (bullets, fast wheels), so it cannot tunnel through thin walls. Costs more.
public bool Bullet { get; set; }
Property Value¶
CenterOfMass¶
Where the center of mass is, in the body's space, when it is not where the shape's volume puts it (a truck's engine and axles are low: (0, 0.9, 0.5)). Unset keeps the shape's.
A vehicle drives well only with a low center.
public Vector3? CenterOfMass { get; set; }
Property Value¶
Class¶
What the registry knows about this object's class.
public override ClassInfo Class { get; }
Property Value¶
Density¶
Kilograms per cubic meter, for a body with no
public float Density { get; set; }
Property Value¶
Events¶
Report its contacts (
public bool Events { get; set; }
Property Value¶
Friction¶
public float Friction { get; set; }
Property Value¶
GravityFactor¶
1 is the world's gravity, 0 none, negative lifts.
public float GravityFactor { get; set; }
Property Value¶
IsSensor¶
A sensor does not collide: it reports the bodies inside it (
public bool IsSensor { get; set; }
Property Value¶
Layers¶
The collision layers the body is in, a bit each (
public uint Layers { get; set; }
Property Value¶
LinearDamping¶
The fraction of linear speed lost per second.
public float LinearDamping { get; set; }
Property Value¶
LinearVelocity¶
public Vector3 LinearVelocity { get; set; }
Property Value¶
Mask¶
The layers it collides with.
public uint Mask { get; set; }
Property Value¶
Mass¶
The mass in kilograms of a dynamic body; 0 takes it from the shape's volume and
public float Mass { get; set; }
Property Value¶
Motion¶
public MotionKind Motion { get; set; }
Property Value¶
Restitution¶
How much of its speed a body keeps when it bounces: 0 to 1.
public float Restitution { get; set; }
Property Value¶
Shape¶
What it collides as. Required.
public PhysicsShape? Shape { get; set; }