summaryrefslogtreecommitdiffstats
path: root/modules/gltf/doc_classes/GLTFPhysicsBody.xml
blob: 57470fd2067bdecc3ab9cf0cb03ed9baee614441 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?xml version="1.0" encoding="UTF-8" ?>
<class name="GLTFPhysicsBody" inherits="Resource" version="4.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
	<brief_description>
		Represents a GLTF physics body.
	</brief_description>
	<description>
		Represents a physics body as defined by the [code]OMI_physics_body[/code] GLTF extension. This class is an intermediary between the 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.
	</description>
	<tutorials>
		<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>
				Creates a new GLTFPhysicsBody instance by parsing the given [Dictionary].
			</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>
				Serializes this GLTFPhysicsBody instance into a [Dictionary].
			</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>
		<member name="body_type" type="String" setter="set_body_type" getter="get_body_type" default="&quot;static&quot;">
			The type of the body. Valid values are "static", "kinematic", "character", "rigid", "vehicle", and "trigger".
		</member>
		<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)">
			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.
		</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>