virtualx-engine-docs/_sources/classes/class_gltfcollider.rst.txt
2024-10-23 09:41:33 -07:00

227 lines
8.6 KiB
ReStructuredText

:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.6/modules/gltf/doc_classes/GLTFCollider.xml.
.. _class_GLTFCollider:
GLTFCollider
============
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Represents a GLTF collider.
.. rst-class:: classref-introduction-group
Description
-----------
Represents a collider 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.
.. rst-class:: classref-introduction-group
Tutorials
---------
- `OMI_collider GLTF extension <https://github.com/omigroup/gltf-extensions/tree/main/extensions/2.0/OMI_collider>`__
.. rst-class:: classref-reftable-group
Properties
----------
.. table::
:widths: auto
+-----------------------------------+-----------------------------------------------------------+------------------------+
| :ref:`ArrayMesh<class_ArrayMesh>` | :ref:`array_mesh<class_GLTFCollider_property_array_mesh>` | |
+-----------------------------------+-----------------------------------------------------------+------------------------+
| :ref:`float<class_float>` | :ref:`height<class_GLTFCollider_property_height>` | ``2.0`` |
+-----------------------------------+-----------------------------------------------------------+------------------------+
| :ref:`bool<class_bool>` | :ref:`is_trigger<class_GLTFCollider_property_is_trigger>` | ``false`` |
+-----------------------------------+-----------------------------------------------------------+------------------------+
| :ref:`int<class_int>` | :ref:`mesh_index<class_GLTFCollider_property_mesh_index>` | ``-1`` |
+-----------------------------------+-----------------------------------------------------------+------------------------+
| :ref:`float<class_float>` | :ref:`radius<class_GLTFCollider_property_radius>` | ``0.5`` |
+-----------------------------------+-----------------------------------------------------------+------------------------+
| :ref:`String<class_String>` | :ref:`shape_type<class_GLTFCollider_property_shape_type>` | ``""`` |
+-----------------------------------+-----------------------------------------------------------+------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`size<class_GLTFCollider_property_size>` | ``Vector3( 1, 1, 1 )`` |
+-----------------------------------+-----------------------------------------------------------+------------------------+
.. rst-class:: classref-reftable-group
Methods
-------
.. table::
:widths: auto
+---------------------------------------------+----------------------------------------------------------------------------------------------------------+
| :ref:`Dictionary<class_Dictionary>` | :ref:`to_dictionary<class_GLTFCollider_method_to_dictionary>` **(** **)** |const| |
+---------------------------------------------+----------------------------------------------------------------------------------------------------------+
| :ref:`CollisionShape<class_CollisionShape>` | :ref:`to_node<class_GLTFCollider_method_to_node>` **(** :ref:`bool<class_bool>` cache_shapes=false **)** |
+---------------------------------------------+----------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_GLTFCollider_property_array_mesh:
.. rst-class:: classref-property
:ref:`ArrayMesh<class_ArrayMesh>` **array_mesh**
.. rst-class:: classref-property-setget
- void **set_array_mesh** **(** :ref:`ArrayMesh<class_ArrayMesh>` value **)**
- :ref:`ArrayMesh<class_ArrayMesh>` **get_array_mesh** **(** **)**
The :ref:`ArrayMesh<class_ArrayMesh>` resource of the collider. This is only used when the collider type is "hull" (convex hull) or "trimesh" (concave trimesh).
.. rst-class:: classref-item-separator
----
.. _class_GLTFCollider_property_height:
.. rst-class:: classref-property
:ref:`float<class_float>` **height** = ``2.0``
.. rst-class:: classref-property-setget
- void **set_height** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_height** **(** **)**
The height of the collider, in meters. This is only used when the collider type is "capsule" or "cylinder". This value should not be negative, and for "capsule" it should be at least twice the radius.
.. rst-class:: classref-item-separator
----
.. _class_GLTFCollider_property_is_trigger:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **is_trigger** = ``false``
.. rst-class:: classref-property-setget
- void **set_is_trigger** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **get_is_trigger** **(** **)**
If ``true``, indicates that this collider is a trigger. For Godot, this means that the collider should be a child of an Area3D node.
This is the only variable not used in the :ref:`to_node<class_GLTFCollider_method_to_node>` method, it's intended to be used alongside when deciding where to add the generated node as a child.
.. rst-class:: classref-item-separator
----
.. _class_GLTFCollider_property_mesh_index:
.. rst-class:: classref-property
:ref:`int<class_int>` **mesh_index** = ``-1``
.. rst-class:: classref-property-setget
- void **set_mesh_index** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_mesh_index** **(** **)**
The index of the collider's mesh in the GLTF file. This is only used when the collider type is "hull" (convex hull) or "trimesh" (concave trimesh).
.. rst-class:: classref-item-separator
----
.. _class_GLTFCollider_property_radius:
.. rst-class:: classref-property
:ref:`float<class_float>` **radius** = ``0.5``
.. rst-class:: classref-property-setget
- void **set_radius** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_radius** **(** **)**
The radius of the collider, in meters. This is only used when the collider type is "capsule", "cylinder", or "sphere". This value should not be negative.
.. rst-class:: classref-item-separator
----
.. _class_GLTFCollider_property_shape_type:
.. rst-class:: classref-property
:ref:`String<class_String>` **shape_type** = ``""``
.. rst-class:: classref-property-setget
- void **set_shape_type** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_shape_type** **(** **)**
The type of shape this collider represents. Valid values are "box", "capsule", "cylinder", "sphere", "hull", and "trimesh".
.. rst-class:: classref-item-separator
----
.. _class_GLTFCollider_property_size:
.. rst-class:: classref-property
:ref:`Vector3<class_Vector3>` **size** = ``Vector3( 1, 1, 1 )``
.. rst-class:: classref-property-setget
- void **set_size** **(** :ref:`Vector3<class_Vector3>` value **)**
- :ref:`Vector3<class_Vector3>` **get_size** **(** **)**
The size of the collider, in meters. This is only used when the collider type is "box", and it represents the "diameter" of the box. This value should not be negative.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_GLTFCollider_method_to_dictionary:
.. rst-class:: classref-method
:ref:`Dictionary<class_Dictionary>` **to_dictionary** **(** **)** |const|
Serializes this GLTFCollider instance into a :ref:`Dictionary<class_Dictionary>`.
.. rst-class:: classref-item-separator
----
.. _class_GLTFCollider_method_to_node:
.. rst-class:: classref-method
:ref:`CollisionShape<class_CollisionShape>` **to_node** **(** :ref:`bool<class_bool>` cache_shapes=false **)**
Converts this GLTFCollider instance into a Godot :ref:`CollisionShape<class_CollisionShape>` node.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`