GLTFPhysicsShape
Hereda: Resource < RefCounted < Object
Representa una forma física glTF.
Descripción
Representa una forma física tal como la definen las extensiones glTF OMI_physics_shape o OMI_collider. Esta clase es un intermediario entre los datos glTF y los nodos de Godot, y se abstrae de una manera que permite añadir soporte para diferentes extensiones de física glTF en el futuro.
Tutoriales
Propiedades
|
||
|
||
|
||
|
||
|
||
|
Métodos
from_dictionary(dictionary: Dictionary) static |
|
from_node(shape_node: CollisionShape3D) static |
|
from_resource(shape_resource: Shape3D) static |
|
to_dictionary() const |
|
to_resource(cache_shapes: bool = false) |
Descripciones de Propiedades
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.
ImporterMesh importer_mesh 🔗
void set_importer_mesh(value: ImporterMesh)
ImporterMesh get_importer_mesh()
The ImporterMesh resource of the shape. This is only used when the shape type is "hull" (convex hull) or "trimesh" (concave trimesh).
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.
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).
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 size = 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.
Descripciones de Métodos
GLTFPhysicsShape from_dictionary(dictionary: Dictionary) static 🔗
Creates a new GLTFPhysicsShape instance by parsing the given Dictionary.
GLTFPhysicsShape from_node(shape_node: CollisionShape3D) static 🔗
Creates a new GLTFPhysicsShape instance from the given Godot CollisionShape3D node.
GLTFPhysicsShape from_resource(shape_resource: Shape3D) static 🔗
Creates a new GLTFPhysicsShape instance from the given Godot Shape3D resource.
Dictionary to_dictionary() const 🔗
Serializes this GLTFPhysicsShape instance into a Dictionary in the format defined by OMI_physics_shape.
CollisionShape3D to_node(cache_shapes: bool = false) 🔗
Converts this GLTFPhysicsShape instance into a Godot CollisionShape3D node.
Shape3D to_resource(cache_shapes: bool = false) 🔗
Converts this GLTFPhysicsShape instance into a Godot Shape3D resource.