PhysicalBone3D

Inherits: PhysicsBody3D < CollisionObject3D < Node3D < Node < Object

Properties

float

angular_damp

0.0

DampMode

angular_damp_mode

0

Vector3

angular_velocity

Vector3(0, 0, 0)

Transform3D

body_offset

Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)

float

bounce

0.0

bool

can_sleep

true

bool

custom_integrator

false

float

friction

1.0

float

gravity_scale

1.0

Transform3D

joint_offset

Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)

Vector3

joint_rotation

Vector3(0, 0, 0)

JointType

joint_type

0

float

linear_damp

0.0

DampMode

linear_damp_mode

0

Vector3

linear_velocity

Vector3(0, 0, 0)

float

mass

1.0

Methods

void

_integrate_forces ( PhysicsDirectBodyState3D state ) virtual

void

apply_central_impulse ( Vector3 impulse )

void

apply_impulse ( Vector3 impulse, Vector3 position=Vector3(0, 0, 0) )

int

get_bone_id ( ) const

bool

get_simulate_physics ( )

bool

is_simulating_physics ( )

Enumerations

enum DampMode:

  • DAMP_MODE_COMBINE = 0 --- In this mode, the body's damping value is added to any value set in areas or the default value.

  • DAMP_MODE_REPLACE = 1 --- In this mode, the body's damping value replaces any value set in areas or the default value.


enum JointType:

  • JOINT_TYPE_NONE = 0

  • JOINT_TYPE_PIN = 1

  • JOINT_TYPE_CONE = 2

  • JOINT_TYPE_HINGE = 3

  • JOINT_TYPE_SLIDER = 4

  • JOINT_TYPE_6DOF = 5

Property Descriptions

Default

0.0

Setter

set_angular_damp(value)

Getter

get_angular_damp()

Damps the body's rotation. By default, the body will use the Default Angular Damp in Project > Project Settings > Physics > 3d or any value override set by an Area3D the body is in. Depending on angular_damp_mode, you can set angular_damp to be added to or to replace the body's damping value.

See ProjectSettings.physics/3d/default_angular_damp for more details about damping.


Default

0

Setter

set_angular_damp_mode(value)

Getter

get_angular_damp_mode()

Defines how angular_damp is applied. See DampMode for possible values.


Default

Vector3(0, 0, 0)

Setter

set_angular_velocity(value)

Getter

get_angular_velocity()

The PhysicalBone3D's rotational velocity in radians per second.


Default

Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)

Setter

set_body_offset(value)

Getter

get_body_offset()

Sets the body's transform.


Default

0.0

Setter

set_bounce(value)

Getter

get_bounce()

The body's bounciness. Values range from 0 (no bounce) to 1 (full bounciness).


Default

true

Setter

set_can_sleep(value)

Getter

is_able_to_sleep()

If true, the body is deactivated when there is no movement, so it will not take part in the simulation until it is awakened by an external force.


  • bool custom_integrator

Default

false

Setter

set_use_custom_integrator(value)

Getter

is_using_custom_integrator()

If true, internal force integration will be disabled (like gravity or air friction) for this body. Other than collision response, the body will only move as determined by the _integrate_forces function, if defined.


Default

1.0

Setter

set_friction(value)

Getter

get_friction()

The body's friction, from 0 (frictionless) to 1 (max friction).


Default

1.0

Setter

set_gravity_scale(value)

Getter

get_gravity_scale()

This is multiplied by the global 3D gravity setting found in Project > Project Settings > Physics > 3d to produce the body's gravity. For example, a value of 1 will be normal gravity, 2 will apply double gravity, and 0.5 will apply half gravity to this object.


Default

Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)

Setter

set_joint_offset(value)

Getter

get_joint_offset()

Sets the joint's transform.


Default

Vector3(0, 0, 0)

Setter

set_joint_rotation(value)

Getter

get_joint_rotation()

Sets the joint's rotation in radians.


Default

0

Setter

set_joint_type(value)

Getter

get_joint_type()

Sets the joint type. See JointType for possible values.


Default

0.0

Setter

set_linear_damp(value)

Getter

get_linear_damp()

Damps the body's movement. By default, the body will use the Default Linear Damp in Project > Project Settings > Physics > 3d or any value override set by an Area3D the body is in. Depending on linear_damp_mode, you can set linear_damp to be added to or to replace the body's damping value.

See ProjectSettings.physics/3d/default_linear_damp for more details about damping.


Default

0

Setter

set_linear_damp_mode(value)

Getter

get_linear_damp_mode()

Defines how linear_damp is applied. See DampMode for possible values.


Default

Vector3(0, 0, 0)

Setter

set_linear_velocity(value)

Getter

get_linear_velocity()

The body's linear velocity in units per second. Can be used sporadically, but don't set this every frame, because physics may run in another thread and runs at a different granularity. Use _integrate_forces as your process loop for precise control of the body state.


Default

1.0

Setter

set_mass(value)

Getter

get_mass()

The body's mass.

Method Descriptions

Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it works in addition to the usual physics behavior, but the custom_integrator property allows you to disable the default behavior and do fully custom force integration for a body.


  • void apply_central_impulse ( Vector3 impulse )


  • void apply_impulse ( Vector3 impulse, Vector3 position=Vector3(0, 0, 0) )


  • int get_bone_id ( ) const


  • bool get_simulate_physics ( )


  • bool is_simulating_physics ( )