PhysicsBody

represents a physics body

Constructors

this
this(float mass, BodyType type)

creates a physics body with a given mass and type

Members

Enums

BodyType
enum BodyType

physics body mode: dynamic or static

Functions

apply_force
void apply_force(Vector3 value, Vector3 pos)

apply a force to the physics body

apply_impulse
void apply_impulse(Vector3 value, Vector3 pos)

apply an impulse to the physics body

apply_torque
void apply_torque(Vector3 value)

apply a torque to the physics body

destroy
void destroy()
Undocumented in source. Be warned that the author may not have intended to support it.
setup
void setup()
Undocumented in source. Be warned that the author may not have intended to support it.
sync_colliders
void sync_colliders()

used to notify the physics engine to update colliders if they have changed

sync_properties
void sync_properties()

notify physics engine about new physical properties, such as gravity

sync_transform
void sync_transform()

used to notify the physics engine when transform is directly modified

Variables

angular_velocity
Vector3 angular_velocity;

current angular velocity of object

bounce
float bounce;

bounce amount

custom_gravity
bool custom_gravity;

whether to use a custom gravity value

damping
float damping;

damping amount

friction
float friction;

coefficient of friction

gravity
Vector3 gravity;

if custom gravity is enabled, the gravity to use

mass
float mass;

object mass

max_speed
float max_speed;

moment of inertia max speed of object

physics_synced
bool physics_synced;

whether this body is currently in sync with the physics system

velocity
Vector3 velocity;

current linear velocity of object

Inherited Members

From Component

__anonymous
mixin Reflect
Undocumented in source.
entity
Entity entity;

owner entity

setup
void setup()

initialize the component. entity is already set.

destroy
void destroy()

release resources and clean up

transform
Transform transform [@property getter]

forward to entity.transform

Meta