Skip to content

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 ; the same description can make any number of bodies. Where the body is comes from its entity's transform (its scale is applied to the shape).

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

bool

AngularDamping

public float AngularDamping { get; set; }

Property Value

float

AngularVelocity

public Vector3 AngularVelocity { get; set; }

Property Value

Vector3

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

bool

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

Vector3?

Class

What the registry knows about this object's class.

public override ClassInfo Class { get; }

Property Value

ClassInfo

Density

Kilograms per cubic meter, for a body with no (water is 1000).

public float Density { get; set; }

Property Value

float

Events

Report its contacts () and when it wakes or sleeps. Off by default: events cost something for every pair.

public bool Events { get; set; }

Property Value

bool

Friction

public float Friction { get; set; }

Property Value

float

GravityFactor

1 is the world's gravity, 0 none, negative lifts.

public float GravityFactor { get; set; }

Property Value

float

IsSensor

A sensor does not collide: it reports the bodies inside it ().

public bool IsSensor { get; set; }

Property Value

bool

Layers

The collision layers the body is in, a bit each ().

public uint Layers { get; set; }

Property Value

uint

LinearDamping

The fraction of linear speed lost per second.

public float LinearDamping { get; set; }

Property Value

float

LinearVelocity

public Vector3 LinearVelocity { get; set; }

Property Value

Vector3

Mask

The layers it collides with.

public uint Mask { get; set; }

Property Value

uint

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

float

Motion

public MotionKind Motion { get; set; }

Property Value

MotionKind

Restitution

How much of its speed a body keeps when it bounces: 0 to 1.

public float Restitution { get; set; }

Property Value

float

Shape

What it collides as. Required.

public PhysicsShape? Shape { get; set; }

Property Value

PhysicsShape?