Path: blob/master/modules/gltf/doc_classes/GLTFPhysicsBody.xml
10279 views
<?xml version="1.0" encoding="UTF-8" ?>1<class name="GLTFPhysicsBody" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">2<brief_description>3Represents a glTF physics body.4</brief_description>5<description>6Represents 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.7</description>8<tutorials>9<link title="Runtime file loading and saving">$DOCS_URL/tutorials/io/runtime_file_loading_and_saving.html</link>10<link title="OMI_physics_body glTF extension">https://github.com/omigroup/gltf-extensions/tree/main/extensions/2.0/OMI_physics_body</link>11</tutorials>12<methods>13<method name="from_dictionary" qualifiers="static">14<return type="GLTFPhysicsBody" />15<param index="0" name="dictionary" type="Dictionary" />16<description>17Creates a new GLTFPhysicsBody instance by parsing the given [Dictionary] in the [code]OMI_physics_body[/code] glTF extension format.18</description>19</method>20<method name="from_node" qualifiers="static">21<return type="GLTFPhysicsBody" />22<param index="0" name="body_node" type="CollisionObject3D" />23<description>24Creates a new GLTFPhysicsBody instance from the given Godot [CollisionObject3D] node.25</description>26</method>27<method name="to_dictionary" qualifiers="const">28<return type="Dictionary" />29<description>30Serializes this GLTFPhysicsBody instance into a [Dictionary]. It will be in the format expected by the [code]OMI_physics_body[/code] glTF extension.31</description>32</method>33<method name="to_node" qualifiers="const">34<return type="CollisionObject3D" />35<description>36Converts this GLTFPhysicsBody instance into a Godot [CollisionObject3D] node.37</description>38</method>39</methods>40<members>41<member name="angular_velocity" type="Vector3" setter="set_angular_velocity" getter="get_angular_velocity" default="Vector3(0, 0, 0)">42The angular velocity of the physics body, in radians per second. This is only used when the body type is "rigid" or "vehicle".43</member>44<member name="body_type" type="String" setter="set_body_type" getter="get_body_type" default=""rigid"">45The type of the body.46When importing, this controls what type of [CollisionObject3D] node Godot should generate. Valid values are [code]"static"[/code], [code]"animatable"[/code], [code]"character"[/code], [code]"rigid"[/code], [code]"vehicle"[/code], and [code]"trigger"[/code].47When exporting, this will be squashed down to one of [code]"static"[/code], [code]"kinematic"[/code], or [code]"dynamic"[/code] motion types, or the [code]"trigger"[/code] property.48</member>49<member name="center_of_mass" type="Vector3" setter="set_center_of_mass" getter="get_center_of_mass" default="Vector3(0, 0, 0)">50The 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.51</member>52<member name="inertia_diagonal" type="Vector3" setter="set_inertia_diagonal" getter="get_inertia_diagonal" default="Vector3(0, 0, 0)">53The 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".54When converted to a Godot [RigidBody3D] node, if this value is zero, then the inertia will be calculated automatically.55</member>56<member name="inertia_orientation" type="Quaternion" setter="set_inertia_orientation" getter="get_inertia_orientation" default="Quaternion(0, 0, 0, 1)">57The 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.58</member>59<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="">60The inertia tensor of the physics body, in kilogram meter squared (kg⋅m²). This is only used when the body type is "rigid" or "vehicle".61When converted to a Godot [RigidBody3D] node, if this value is zero, then the inertia will be calculated automatically.62</member>63<member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector3(0, 0, 0)">64The linear velocity of the physics body, in meters per second. This is only used when the body type is "rigid" or "vehicle".65</member>66<member name="mass" type="float" setter="set_mass" getter="get_mass" default="1.0">67The mass of the physics body, in kilograms. This is only used when the body type is "rigid" or "vehicle".68</member>69</members>70</class>717273