2022-11-22 15:29:56 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-07-06 08:08:05 +00:00
<class name= "GLTFPhysicsBody" inherits= "Resource" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../../../doc/class.xsd" >
2022-11-22 15:29:56 +00:00
<brief_description >
Represents a GLTF physics body.
</brief_description>
<description >
2023-08-11 16:16:40 +00:00
Represents a physics body as an intermediary between the [code]OMI_physics_body[/code] 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.
2022-11-22 15:29:56 +00:00
</description>
<tutorials >
2023-11-13 13:37:27 +00:00
<link title= "Runtime file loading and saving" > $DOCS_URL/tutorials/io/runtime_file_loading_and_saving.html</link>
2022-11-22 15:29:56 +00:00
<link title= "OMI_physics_body GLTF extension" > https://github.com/omigroup/gltf-extensions/tree/main/extensions/2.0/OMI_physics_body</link>
</tutorials>
<methods >
<method name= "from_dictionary" qualifiers= "static" >
<return type= "GLTFPhysicsBody" />
<param index= "0" name= "dictionary" type= "Dictionary" />
<description >
2023-08-11 16:16:40 +00:00
Creates a new GLTFPhysicsBody instance by parsing the given [Dictionary] in the [code]OMI_physics_body[/code] GLTF extension format.
2022-11-22 15:29:56 +00:00
</description>
</method>
<method name= "from_node" qualifiers= "static" >
<return type= "GLTFPhysicsBody" />
<param index= "0" name= "body_node" type= "CollisionObject3D" />
<description >
Create a new GLTFPhysicsBody instance from the given Godot [CollisionObject3D] node.
</description>
</method>
<method name= "to_dictionary" qualifiers= "const" >
<return type= "Dictionary" />
<description >
2023-08-11 16:16:40 +00:00
Serializes this GLTFPhysicsBody instance into a [Dictionary]. It will be in the format expected by the [code]OMI_physics_body[/code] GLTF extension.
2022-11-22 15:29:56 +00:00
</description>
</method>
<method name= "to_node" qualifiers= "const" >
<return type= "CollisionObject3D" />
<description >
Converts this GLTFPhysicsBody instance into a Godot [CollisionObject3D] node.
</description>
</method>
</methods>
<members >
<member name= "angular_velocity" type= "Vector3" setter= "set_angular_velocity" getter= "get_angular_velocity" default= "Vector3(0, 0, 0)" >
The angular velocity of the physics body, in radians per second. This is only used when the body type is "rigid" or "vehicle".
</member>
2023-08-11 16:16:40 +00:00
<member name= "body_type" type= "String" setter= "set_body_type" getter= "get_body_type" default= ""rigid"" >
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.
2023-08-09 22:10:29 +00:00
</member>
<member name= "center_of_mass" type= "Vector3" setter= "set_center_of_mass" getter= "get_center_of_mass" default= "Vector3(0, 0, 0)" >
The center of mass of the body, in meters. This is in local space relative to the body. By default, the center of the mass is the body's origin.
2022-11-22 15:29:56 +00:00
</member>
2023-08-11 16:16:40 +00:00
<member name= "inertia_diagonal" type= "Vector3" setter= "set_inertia_diagonal" getter= "get_inertia_diagonal" default= "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.
</member>
<member name= "inertia_orientation" type= "Quaternion" setter= "set_inertia_orientation" getter= "get_inertia_orientation" default= "Quaternion(0, 0, 0, 1)" >
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 [member inertia_diagonal] is set to a non-zero value.
</member>
2024-02-12 13:55:02 +00:00
<member name= "inertia_tensor" type= "Basis" setter= "set_inertia_tensor" getter= "get_inertia_tensor" default= "Basis(0, 0, 0, 0, 0, 0, 0, 0, 0)" deprecated= "" >
2023-06-07 02:03:28 +00:00
The inertia tensor of the physics body, in kilogram meter squared (kg⋅m²). 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.
2022-11-22 15:29:56 +00:00
</member>
<member name= "linear_velocity" type= "Vector3" setter= "set_linear_velocity" getter= "get_linear_velocity" default= "Vector3(0, 0, 0)" >
The linear velocity of the physics body, in meters per second. This is only used when the body type is "rigid" or "vehicle".
</member>
<member name= "mass" type= "float" setter= "set_mass" getter= "get_mass" default= "1.0" >
The mass of the physics body, in kilograms. This is only used when the body type is "rigid" or "vehicle".
</member>
</members>
</class>