Inherits: Resource < RefCounted < Object
Represents a GLTF physics shape.
Represents a physics shape as defined by the OMI_collider 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.
| ||
| ||
| ||
| ||
| ||
|
from_dictionary ( Dictionary dictionary ) static | |
from_node ( CollisionShape3D shape_node ) static | |
to_dictionary ( ) const | |
2.0
The height of the shape, in meters. This is only used when the shape type is "capsule" or "cylinder". This value should not be negative, and for "capsule" it should be at least twice the radius.
The ImporterMesh resource of the shape. This is only used when the shape type is "hull" (convex hull) or "trimesh" (concave trimesh).
false
If true, indicates that this shape is a trigger. For Godot, this means that the shape should be a child of an Area3D node.
This is the only variable not used in the to_node method, it's intended to be used alongside when deciding where to add the generated node as a child.
-1
The index of the shape's mesh in the GLTF file. This is only used when the shape type is "hull" (convex hull) or "trimesh" (concave trimesh).
0.5
The radius of the shape, in meters. This is only used when the shape type is "capsule", "cylinder", or "sphere". This value should not be negative.
""
The type of shape this shape represents. Valid values are "box", "capsule", "cylinder", "sphere", "hull", and "trimesh".
Vector3(1, 1, 1)
The size of the shape, in meters. This is only used when the shape type is "box", and it represents the "diameter" of the box. This value should not be negative.
Creates a new GLTFPhysicsShape instance by parsing the given Dictionary.
Create a new GLTFPhysicsShape instance from the given Godot CollisionShape3D node.
Serializes this GLTFPhysicsShape instance into a Dictionary.
Converts this GLTFPhysicsShape instance into a Godot CollisionShape3D node.
© 2014–present Juan Linietsky, Ariel Manzur and the Godot community
Licensed under the Creative Commons Attribution Unported License v3.0.
https://docs.godotengine.org/en/4.2/classes/class_gltfphysicsshape.html