Table of Contents

Class GltfPhysicsBody

Namespace
Godot
Assembly
GodotSharp.dll

Represents a physics body as defined by the OMI_physics_body 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.

[GodotClassName("GLTFPhysicsBody")]
public class GltfPhysicsBody : Resource, IDisposable
Inheritance
GltfPhysicsBody
Implements
Inherited Members

Constructors

GltfPhysicsBody()

public GltfPhysicsBody()

Properties

AngularVelocity

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

public Vector3 AngularVelocity { get; set; }

Property Value

Vector3

BodyType

The type of the body. When importing, this controls what type of CollisionObject3D node Godot should generate. Valid values are "static", "kinematic", "character", "rigid", "vehicle", and "trigger".

public string BodyType { get; set; }

Property Value

string

CenterOfMass

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.

public Vector3 CenterOfMass { get; set; }

Property Value

Vector3

InertiaTensor

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.

public Basis InertiaTensor { get; set; }

Property Value

Basis

LinearVelocity

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

public Vector3 LinearVelocity { get; set; }

Property Value

Vector3

Mass

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

public float Mass { get; set; }

Property Value

float

Methods

FromDictionary(Dictionary)

Creates a new GLTFPhysicsBody instance by parsing the given Dictionary.

public static GltfPhysicsBody FromDictionary(Dictionary dictionary)

Parameters

dictionary Dictionary

Returns

GltfPhysicsBody

FromNode(CollisionObject3D)

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

public static GltfPhysicsBody FromNode(CollisionObject3D bodyNode)

Parameters

bodyNode CollisionObject3D

Returns

GltfPhysicsBody

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool

ToDictionary()

Serializes this GLTFPhysicsBody instance into a Dictionary.

public Dictionary ToDictionary()

Returns

Dictionary

ToNode()

Converts this GLTFPhysicsBody instance into a Godot CollisionObject3D node.

public CollisionObject3D ToNode()

Returns

CollisionObject3D