pub struct BodyDef {Show 19 fields
pub type_: BodyType,
pub position: Pos,
pub rotation: Quat,
pub linear_velocity: Vec3,
pub angular_velocity: Vec3,
pub linear_damping: f32,
pub angular_damping: f32,
pub gravity_scale: f32,
pub sleep_threshold: f32,
pub name: String,
pub user_data: u64,
pub motion_locks: MotionLocks,
pub enable_sleep: bool,
pub is_awake: bool,
pub is_bullet: bool,
pub is_enabled: bool,
pub allow_fast_rotation: bool,
pub enable_contact_recycling: bool,
pub internal_value: i32,
}Expand description
A body definition holds all the data needed to construct a rigid body.
Must be initialized using default_body_def. (b3BodyDef)
Fields§
§type_: BodyTypeThe body type: static, kinematic, or dynamic.
position: PosThe initial world position of the body.
rotation: QuatThe initial world rotation of the body.
linear_velocity: Vec3The initial linear velocity of the body’s origin, usually m/s.
angular_velocity: Vec3The initial angular velocity of the body, radians per second.
linear_damping: f32Linear damping used to reduce the linear velocity.
angular_damping: f32Angular damping used to reduce the angular velocity.
gravity_scale: f32Scale the gravity applied to this body. Non-dimensional.
sleep_threshold: f32Sleep speed threshold, default is 0.05 meters per second.
name: StringOptional body name for debugging.
user_data: u64Application specific body data.
motion_locks: MotionLocksMotion locks to restrict linear and angular movement.
enable_sleep: boolSet to false if this body should never fall asleep.
is_awake: boolIs this body initially awake or sleeping?
is_bullet: boolTreat this body as a high speed object for continuous collision.
is_enabled: boolUsed to disable a body. A disabled body does not move or collide.
allow_fast_rotation: boolAllow this body to bypass rotational speed limits.
enable_contact_recycling: boolEnable contact recycling. True by default.
internal_value: i32Used internally to detect a valid definition. DO NOT SET.