Table of Contents

Class GLTFPhysicsBody

Represents a glTF physics body.

Inheritance
GLTFPhysicsBody

Remarks

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.

See Also

Properties

angular_velocity

The angular velocity of the physics body, in radians per second. This is only used when the body type is "rigid" or "vehicle".

var angular_velocity : Vector3 = Vector3(0, 0, 0)

Property Value

Vector3

Remarks

  • void set_angular_velocity(Vector3 value)
  • Vector3 get_angular_velocity

body_type

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.

var body_type : String = "rigid"

Property Value

String

Remarks

center_of_mass

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.

var center_of_mass : Vector3 = Vector3(0, 0, 0)

Property Value

Vector3

Remarks

inertia_diagonal

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.

var inertia_diagonal : Vector3 = Vector3(0, 0, 0)

Property Value

Vector3

Remarks

  • void set_inertia_diagonal(Vector3 value)
  • Vector3 get_inertia_diagonal

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.

var inertia_orientation : Quaternion = Quaternion(0, 0, 0, 1)

Property Value

Quaternion

Remarks

inertia_tensor

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.

var inertia_tensor : Basis = Basis(0, 0, 0, 0, 0, 0, 0, 0, 0)

Property Value

Basis

Remarks

  • void set_inertia_tensor(Basis value)
  • Basis get_inertia_tensor

linear_velocity

The linear velocity of the physics body, in meters per second. This is only used when the body type is "rigid" or "vehicle".

var linear_velocity : Vector3 = Vector3(0, 0, 0)

Property Value

Vector3

Remarks

mass

The mass of the physics body, in kilograms. This is only used when the body type is "rigid" or "vehicle".

var mass : float = 1.0

Property Value

float

Remarks

Methods

from_dictionary(Dictionary)

Qualifiers: static

Creates a new GLTFPhysicsBody instance by parsing the given Dictionary in the OMI_physics_body glTF extension format.

GLTFPhysicsBody from_dictionary(Dictionary dictionary)

Parameters

dictionary Dictionary

from_node(CollisionObject3D)

Qualifiers: static

Creates a new GLTFPhysicsBody instance from the given Godot CollisionObject3D node.

GLTFPhysicsBody from_node(CollisionObject3D body_node)

Parameters

body_node CollisionObject3D

to_dictionary

Qualifiers: const

Serializes this GLTFPhysicsBody instance into a Dictionary. It will be in the format expected by the OMI_physics_body glTF extension.

Dictionary to_dictionary

to_node

Qualifiers: const

Converts this GLTFPhysicsBody instance into a Godot CollisionObject3D node.

CollisionObject3D to_node