Table of Contents

Class Rigidbody

Namespace
BasilEngine.Components
Assembly
BasilEngine.dll
[NativeHeader("Bindings/ManagedPhysics.hpp")]
[NativeClass("ManagedPhysics", ".")]
public class Rigidbody : Component
Inheritance
Rigidbody
Inherited Members

Properties

AngularDrag

Angular drag coefficient.

public float AngularDrag { get; set; }

Property Value

float

AngularVelocity

Angular velocity of the rigidbody.

public Vector3 AngularVelocity { get; set; }

Property Value

Vector3

Drag

Linear drag coefficient.

public float Drag { get; set; }

Property Value

float

FreezeRotX

Locks rotation around the X axis.

public bool FreezeRotX { get; set; }

Property Value

bool

FreezeRotY

Locks rotation around the Y axis.

public bool FreezeRotY { get; set; }

Property Value

bool

FreezeRotZ

Locks rotation around the Z axis.

public bool FreezeRotZ { get; set; }

Property Value

bool

FreezeX

Locks translation on the X axis.

public bool FreezeX { get; set; }

Property Value

bool

FreezeY

Locks translation on the Y axis.

public bool FreezeY { get; set; }

Property Value

bool

FreezeZ

Locks translation on the Z axis.

public bool FreezeZ { get; set; }

Property Value

bool

Friction

Surface friction coefficient.

public float Friction { get; set; }

Property Value

float

Gravity

Gravity multiplier applied to this body.

public float Gravity { get; set; }

Property Value

float

IsKinematic

Whether the body is kinematic.

public bool IsKinematic { get; set; }

Property Value

bool

LinearDamping

Linear damping applied each update.

public float LinearDamping { get; set; }

Property Value

float

Mass

Mass of the rigidbody.

public float Mass { get; set; }

Property Value

float

UseGravity

Whether gravity affects the body.

public bool UseGravity { get; set; }

Property Value

bool

motionType

Gets or sets the motion type.

public Rigidbody.MotionType motionType { get; set; }

Property Value

Rigidbody.MotionType

velocity

Linear velocity of the rigidbody.

public Vector3 velocity { get; set; }

Property Value

Vector3

Methods

AddForce(Vector3, ForceMode)

Applies a force to the rigidbody.

public void AddForce(Vector3 force, ForceMode mode)

Parameters

force Vector3

Force vector.

mode ForceMode

Force application mode.

AddForceInternal(ulong, float, float, float)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void AddForceInternal(ulong handle, float x, float y, float z)

Parameters

handle ulong
x float
y float
z float

AddImpulseInternal(ulong, float, float, float)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void AddImpulseInternal(ulong handle, float x, float y, float z)

Parameters

handle ulong
x float
y float
z float

GetAngularDrag(ulong)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern float GetAngularDrag(ulong handle)

Parameters

handle ulong

Returns

float

GetAngularVelocity(ulong, out float, out float, out float)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void GetAngularVelocity(ulong handle, out float x, out float y, out float z)

Parameters

handle ulong
x float
y float
z float

GetCenterOfMass(ulong, out float, out float, out float)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void GetCenterOfMass(ulong handle, out float x, out float y, out float z)

Parameters

handle ulong
x float
y float
z float

GetDrag(ulong)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern float GetDrag(ulong handle)

Parameters

handle ulong

Returns

float

GetFreezeRotationX(ulong)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern bool GetFreezeRotationX(ulong handle)

Parameters

handle ulong

Returns

bool

GetFreezeRotationY(ulong)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern bool GetFreezeRotationY(ulong handle)

Parameters

handle ulong

Returns

bool

GetFreezeRotationZ(ulong)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern bool GetFreezeRotationZ(ulong handle)

Parameters

handle ulong

Returns

bool

GetFreezeX(ulong)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern bool GetFreezeX(ulong handle)

Parameters

handle ulong

Returns

bool

GetFreezeY(ulong)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern bool GetFreezeY(ulong handle)

Parameters

handle ulong

Returns

bool

GetFreezeZ(ulong)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern bool GetFreezeZ(ulong handle)

Parameters

handle ulong

Returns

bool

GetFriction(ulong)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern float GetFriction(ulong handle)

Parameters

handle ulong

Returns

float

GetGravityFactor(ulong)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern float GetGravityFactor(ulong handle)

Parameters

handle ulong

Returns

float

GetIsKinematic(ulong)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern bool GetIsKinematic(ulong handle)

Parameters

handle ulong

Returns

bool

GetLinearDamping(ulong)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern float GetLinearDamping(ulong handle)

Parameters

handle ulong

Returns

float

GetLinearVelocity(ulong, out float, out float, out float)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void GetLinearVelocity(ulong handle, out float x, out float y, out float z)

Parameters

handle ulong
x float
y float
z float

GetMass(ulong)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern float GetMass(ulong handle)

Parameters

handle ulong

Returns

float

GetMotionType(ulong)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern int GetMotionType(ulong handle)

Parameters

handle ulong

Returns

int

GetUseGravity(ulong)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern bool GetUseGravity(ulong handle)

Parameters

handle ulong

Returns

bool

MovePosition(Vector3)

Moves the rigidbody to a position using interpolation.

public void MovePosition(Vector3 position)

Parameters

position Vector3

Target world position.

MovePositionInternal(ulong, float, float, float)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
[NativeMethod("MovePosition")]
public static extern void MovePositionInternal(ulong handle, float x, float y, float z)

Parameters

handle ulong
x float
y float
z float

SetAngularDrag(ulong, float)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void SetAngularDrag(ulong handle, float angularDrag)

Parameters

handle ulong
angularDrag float

SetAngularVelocity(ulong, float, float, float)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void SetAngularVelocity(ulong handle, float x, float y, float z)

Parameters

handle ulong
x float
y float
z float

SetCenterOfMass(ulong, float, float, float)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void SetCenterOfMass(ulong handle, float x, float y, float z)

Parameters

handle ulong
x float
y float
z float

SetDrag(ulong, float)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void SetDrag(ulong handle, float drag)

Parameters

handle ulong
drag float

SetFreezeRotationX(ulong, bool)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void SetFreezeRotationX(ulong handle, bool freezeRotationX)

Parameters

handle ulong
freezeRotationX bool

SetFreezeRotationY(ulong, bool)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void SetFreezeRotationY(ulong handle, bool freezeRotationY)

Parameters

handle ulong
freezeRotationY bool

SetFreezeRotationZ(ulong, bool)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void SetFreezeRotationZ(ulong handle, bool freezeRotationZ)

Parameters

handle ulong
freezeRotationZ bool

SetFreezeX(ulong, bool)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void SetFreezeX(ulong handle, bool freezeX)

Parameters

handle ulong
freezeX bool

SetFreezeY(ulong, bool)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void SetFreezeY(ulong handle, bool freezeY)

Parameters

handle ulong
freezeY bool

SetFreezeZ(ulong, bool)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void SetFreezeZ(ulong handle, bool freezeZ)

Parameters

handle ulong
freezeZ bool

SetFriction(ulong, float)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void SetFriction(ulong handle, float friction)

Parameters

handle ulong
friction float

SetGravityFactor(ulong, float)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void SetGravityFactor(ulong handle, float useAutoGravity)

Parameters

handle ulong
useAutoGravity float

SetIsKinematic(ulong, bool)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void SetIsKinematic(ulong handle, bool isKinematic)

Parameters

handle ulong
isKinematic bool

SetLinearDamping(ulong, float)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void SetLinearDamping(ulong handle, float linearDamping)

Parameters

handle ulong
linearDamping float

SetLinearVelocity(ulong, float, float, float)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void SetLinearVelocity(ulong handle, float x, float y, float z)

Parameters

handle ulong
x float
y float
z float

SetMass(ulong, float)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void SetMass(ulong handle, float mass)

Parameters

handle ulong
mass float

SetMotionType(ulong, int)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void SetMotionType(ulong handle, int motionType)

Parameters

handle ulong
motionType int

SetUseGravity(ulong, bool)

[StaticAccessor("ManagedPhysics", StaticAccessorType.DoubleColon)]
public static extern void SetUseGravity(ulong handle, bool useGravity)

Parameters

handle ulong
useGravity bool