Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
GLTFPhysicsBody
繼承: Resource < RefCounted < Object
Represents a glTF physics body.
說明
Represents a physics body as an intermediary between the OMI_physics_body glTF data and Godot's nodes, and it's abstracted in a way that allows adding support for different glTF physics extensions in the future.
教學
屬性
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
方法
from_dictionary(dictionary: Dictionary) static |
|
from_node(body_node: CollisionObject3D) static |
|
to_dictionary() const |
|
to_node() const |
屬性說明
Vector3 angular_velocity = Vector3(0, 0, 0) 🔗
該物理體的角速度,單位為弧度每秒。僅在物體型別為“rigid”或“vehicle”時使用。
The type of the body.
When importing, this controls what type of CollisionObject3D node Godot should generate. Valid values are "static", "animatable", "character", "rigid", "vehicle", and "trigger".
When exporting, this will be squashed down to one of "static", "kinematic", or "dynamic" motion types, or the "trigger" property.
Vector3 center_of_mass = Vector3(0, 0, 0) 🔗
主體的質心,以米為單位。這是在相對於主體的局部空間中。預設情況下,質心是主體的原點。
Vector3 inertia_diagonal = Vector3(0, 0, 0) 🔗
The inertia strength of the physics body, in kilogram meter squared (kg⋅m²). This represents the inertia around the principle axes, the diagonal of the inertia tensor matrix. This is only used when the body type is "rigid" or "vehicle".
When converted to a Godot RigidBody3D node, if this value is zero, then the inertia will be calculated automatically.
Quaternion inertia_orientation = Quaternion(0, 0, 0, 1) 🔗
void set_inertia_orientation(value: Quaternion)
Quaternion get_inertia_orientation()
The inertia orientation of the physics body. This defines the rotation of the inertia's principle axes relative to the object's local axes. This is only used when the body type is "rigid" or "vehicle" and inertia_diagonal is set to a non-zero value.
Basis inertia_tensor = Basis(0, 0, 0, 0, 0, 0, 0, 0, 0) 🔗
已棄用: 此屬性可能在未來版本中變更或移除。
該物理體的慣性張量,單位為千克平方米(kg⋅m²)。僅在物體型別為“rigid”或“vehicle”時使用。
轉換為 Godot RigidBody3D 節點時,如果該值為零,則會自動計算慣性。
Vector3 linear_velocity = Vector3(0, 0, 0) 🔗
該物理體的線速度,單位為米每秒。僅在物體型別為“rigid”或“vehicle”時使用。
該物理體的質量,單位為千克。僅在物體型別為“rigid”或“vehicle”時使用。
方法說明
GLTFPhysicsBody from_dictionary(dictionary: Dictionary) static 🔗
Creates a new GLTFPhysicsBody instance by parsing the given Dictionary in the OMI_physics_body glTF extension format.
GLTFPhysicsBody from_node(body_node: CollisionObject3D) static 🔗
Creates a new GLTFPhysicsBody instance from the given Godot CollisionObject3D node.
Dictionary to_dictionary() const 🔗
Serializes this GLTFPhysicsBody instance into a Dictionary. It will be in the format expected by the OMI_physics_body glTF extension.
CollisionObject3D to_node() const 🔗
將這個 GLTFPhysicsBody 實例轉換為 Godot CollisionObject3D 節點。