PhysicalBone3D
Hereda: PhysicsBody3D < CollisionObject3D < Node3D < Node < Object
Un cuerpo físico utilizado para hacer que los huesos de un Skeleton3D reaccionen a la física.
Descripción
El nodo PhysicalBone3D es un cuerpo físico que se puede utilizar para hacer que los huesos de un Skeleton3D reaccionen a la física.
Nota: Para detectar huesos físicos con raycasts, la propiedad SkeletonModifier3D.active del padre PhysicalBoneSimulator3D debe ser true y el hueso del Skeleton3D debe ser asignado al PhysicalBone3D correctamente; esto significa que get_bone_id() debe devolver un ID válido (>= 0).
Propiedades
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Métodos
void |
_integrate_forces(state: PhysicsDirectBodyState3D) virtual |
void |
apply_central_impulse(impulse: Vector3) |
void |
apply_impulse(impulse: Vector3, position: Vector3 = Vector3(0, 0, 0)) |
get_bone_id() const |
|
Enumeraciones
enum DampMode: 🔗
DampMode DAMP_MODE_COMBINE = 0
En este modo, el valor de amortiguación del cuerpo se añade a cualquier valor establecido en las áreas o al valor predeterminado.
DampMode DAMP_MODE_REPLACE = 1
En este modo, el valor de amortiguación del cuerpo reemplaza cualquier valor establecido en las áreas o al valor predeterminado.
enum JointType: 🔗
JointType JOINT_TYPE_NONE = 0
No se aplica ninguna articulación al PhysicsBone3D.
JointType JOINT_TYPE_PIN = 1
Se aplica una articulación de pasador al PhysicsBone3D.
JointType JOINT_TYPE_CONE = 2
Se aplica una articulación cónica al PhysicsBone3D.
JointType JOINT_TYPE_HINGE = 3
Se aplica una articulación de bisagra al PhysicsBone3D.
JointType JOINT_TYPE_SLIDER = 4
Se aplica una articulación deslizante al PhysicsBone3D.
JointType JOINT_TYPE_6DOF = 5
Se aplica una articulación de 6 grados de libertad al PhysicsBone3D.
Descripciones de Propiedades
Damps the body's rotation. By default, the body will use the ProjectSettings.physics/3d/default_angular_damp project setting 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.
DampMode angular_damp_mode = 0 🔗
Define cómo se aplica angular_damp.
Vector3 angular_velocity = Vector3(0, 0, 0) 🔗
The PhysicalBone3D's rotational velocity in radians per second.
Transform3D body_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) 🔗
void set_body_offset(value: Transform3D)
Transform3D get_body_offset()
Establece la transformación del cuerpo.
The body's bounciness. Values range from 0 (no bounce) to 1 (full bounciness).
Note: Even with bounce set to 1.0, some energy will be lost over time due to linear and angular damping. To have a PhysicalBone3D that preserves all its energy over time, set bounce to 1.0, linear_damp_mode to DAMP_MODE_REPLACE, linear_damp to 0.0, angular_damp_mode to DAMP_MODE_REPLACE, and angular_damp to 0.0.
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 = false 🔗
If true, the standard force integration (like gravity or damping) will be disabled for this body. Other than collision response, the body will only move as determined by the _integrate_forces() method, if that virtual method is overridden.
Setting this property will call the method PhysicsServer3D.body_set_omit_force_integration() internally.
The body's friction, from 0 (frictionless) to 1 (max friction).
This is multiplied by ProjectSettings.physics/3d/default_gravity to produce this body's gravity. For example, a value of 1.0 will apply normal gravity, 2.0 will apply double the gravity, and 0.5 will apply half the gravity to this body.
Transform3D joint_offset = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) 🔗
void set_joint_offset(value: Transform3D)
Transform3D get_joint_offset()
Establece la transformación de la articulación.
Vector3 joint_rotation = Vector3(0, 0, 0) 🔗
Establece la rotación de la articulación en radianes.
Establece el tipo de articulación.
Damps the body's movement. By default, the body will use ProjectSettings.physics/3d/default_linear_damp or any value override set by an Area3D the body is in. Depending on linear_damp_mode, linear_damp may be added to or replace the body's damping value.
See ProjectSettings.physics/3d/default_linear_damp for more details about damping.
DampMode linear_damp_mode = 0 🔗
Defines how linear_damp is applied.
Vector3 linear_velocity = Vector3(0, 0, 0) 🔗
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.
La masa del cuerpo.
Descripciones de Métodos
void _integrate_forces(state: PhysicsDirectBodyState3D) virtual 🔗
Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it is called before the standard force integration, but the custom_integrator property allows you to disable the standard force integration and do fully custom force integration for a body.
void apply_central_impulse(impulse: Vector3) 🔗
Applies a directional impulse without affecting rotation.
An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_integrate_forces" functions otherwise).
This is equivalent to using apply_impulse() at the body's center of mass.
void apply_impulse(impulse: Vector3, position: Vector3 = Vector3(0, 0, 0)) 🔗
Applies a positioned impulse to the PhysicsBone3D.
An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_integrate_forces" functions otherwise).
position is the offset from the PhysicsBone3D origin in global coordinates.
Devuelve el identificador único del PhysicsBone3D.
Returns true if the PhysicsBone3D is allowed to simulate physics.
bool is_simulating_physics() 🔗
Returns true if the PhysicsBone3D is currently simulating physics.