Index · Object → RefCounted → Resource → GLTFPhysicsBody

GLTFPhysicsBody

Represents a glTF physics body.

Class Description

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.

Properties

var angular_velocity: Vector3 = 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".

var body_type: String = "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.

var center_of_mass: Vector3 = 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.

var inertia_diagonal: Vector3 = 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.

var inertia_orientation: Quaternion = 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 inertia_diagonal is set to a non-zero value.

var inertia_tensor: Basis = 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.

var linear_velocity: Vector3 = 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".

var mass: float = 1.0

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

Inherited from Resource (4)

Methods

func from_dictionary(dictionary: Dictionary) -> GLTFPhysicsBody

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

func from_node(body_node: CollisionObject3D) -> GLTFPhysicsBody

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

func to_dictionary() -> Dictionary

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

func to_node() -> CollisionObject3D

Converts this GLTFPhysicsBody instance into a Godot CollisionObject3D node.

Inherited from Resource (18)
func _get_rid() -> RID
func _reset_state() -> void
func _set_path_cache(path: String) -> void
func _setup_local_to_scene() -> void
func copy_from_resource(resource: Resource) -> Error
func duplicate(deep: bool = false) -> Resource
func duplicate_deep(deep_subresources_mode: Resource.DeepDuplicateMode = 1) -> Resource
func emit_changed() -> void
func get_rid() -> RID
func is_built_in() -> bool
func reset_state() -> void
func set_id_for_path(path: String, id: String) -> void
func set_path_cache(path: String) -> void
func setup_local_to_scene() -> void
func take_over_path(path: String) -> void
Inherited from RefCounted (4)
func init_ref() -> bool
func reference() -> bool
func unreference() -> bool
Inherited from Object (62)
func _get(property: StringName) -> Variant
func _get_property_list() -> Dictionary[]
func _init() -> void
func _iter_get(iter: Variant) -> Variant
func _iter_init(iter: Array) -> bool
func _iter_next(iter: Array) -> bool
func _notification(what: int) -> void
func _set(property: StringName, value: Variant) -> bool
func _to_string() -> String
func _validate_property(property: Dictionary) -> void
func add_user_signal(signal: String, arguments: Array = []) -> void
func call(method: StringName) -> Variant
func callv(method: StringName, arg_array: Array) -> Variant
func cancel_free() -> void
func connect(signal: StringName, callable: Callable, flags: int = 0) -> Error
func disconnect(signal: StringName, callable: Callable) -> void
func emit_signal(signal: StringName) -> Error
func free() -> void
func get(property: StringName) -> Variant
func get_class() -> String
func get_incoming_connections() -> Dictionary[]
func get_indexed(property_path: NodePath) -> Variant
func get_meta(name: StringName, default: Variant = null) -> Variant
func get_meta_list() -> StringName[]
func get_method_list() -> Dictionary[]
func get_property_list() -> Dictionary[]
func get_signal_connection_list(signal: StringName) -> Dictionary[]
func get_signal_list() -> Dictionary[]
func has_meta(name: StringName) -> bool
func has_method(method: StringName) -> bool
func has_signal(signal: StringName) -> bool
func is_class(class: StringName) -> bool
func is_connected(signal: StringName, callable: Callable) -> bool
func notification(what: int, reversed: bool = false) -> void
func remove_meta(name: StringName) -> void
func remove_user_signal(signal: StringName) -> void
func set(property: StringName, value: Variant) -> void
func set_block_signals(enable: bool) -> void
func set_deferred(property: StringName, value: Variant) -> void
func set_indexed(property_path: NodePath, value: Variant) -> void
func set_message_translation(enable: bool) -> void
func set_meta(name: StringName, value: Variant) -> void
func set_script(script: Variant) -> void
func set_translation_domain(domain: StringName) -> void
func to_string() -> String
func tr(message: StringName, context: StringName = &"") -> String
func tr_n(message: StringName, plural_message: StringName, n: int, context: StringName = &"") -> String

Signals

Inherited from Resource (2)
signal changed()
Inherited from Object (2)