2017-09-12 22:42:36 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2021-04-26 13:14:51 +02:00
<class name= "CollisionObject" inherits= "Spatial" version= "3.4" >
2017-09-12 22:42:36 +02:00
<brief_description >
2017-09-24 04:47:13 +02:00
Base node for collision objects.
2017-09-12 22:42:36 +02:00
</brief_description>
<description >
2017-10-21 12:33:50 +02:00
CollisionObject is the base class for physics objects. It can hold any number of collision [Shape]s. Each shape must be assigned to a [i]shape owner[/i]. The CollisionObject can have any number of shape owners. Shape owners are not nodes and do not appear in the editor, but are accessible through code using the [code]shape_owner_*[/code] methods.
2017-09-12 22:42:36 +02:00
</description>
<tutorials >
</tutorials>
<methods >
<method name= "_input_event" qualifiers= "virtual" >
<return type= "void" >
</return>
<argument index= "0" name= "camera" type= "Object" >
</argument>
<argument index= "1" name= "event" type= "InputEvent" >
</argument>
2021-06-07 10:50:47 +02:00
<argument index= "2" name= "position" type= "Vector3" >
2017-09-12 22:42:36 +02:00
</argument>
2021-06-07 10:50:47 +02:00
<argument index= "3" name= "normal" type= "Vector3" >
2017-09-12 22:42:36 +02:00
</argument>
<argument index= "4" name= "shape_idx" type= "int" >
</argument>
<description >
2021-06-07 10:50:47 +02:00
Receives unhandled [InputEvent]s. [code]position[/code] is the location in world space of the mouse pointer on the surface of the shape with index [code]shape_idx[/code] and [code]normal[/code] is the normal vector of the surface at that point. Connect to the [signal input_event] signal to easily pick up these events.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "create_shape_owner" >
<return type= "int" >
</return>
<argument index= "0" name= "owner" type= "Object" >
</argument>
<description >
2017-09-24 04:47:13 +02:00
Creates a new shape owner for the given object. Returns [code]owner_id[/code] of the new owner for future reference.
2017-09-12 22:42:36 +02:00
</description>
</method>
2020-10-13 14:17:00 +02:00
<method name= "get_collision_layer_bit" qualifiers= "const" >
<return type= "bool" >
</return>
<argument index= "0" name= "bit" type= "int" >
</argument>
<description >
Returns whether or not the specified [code]bit[/code] of the [member collision_layer] is set.
</description>
</method>
<method name= "get_collision_mask_bit" qualifiers= "const" >
<return type= "bool" >
</return>
<argument index= "0" name= "bit" type= "int" >
</argument>
<description >
Returns whether or not the specified [code]bit[/code] of the [member collision_mask] is set.
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "get_rid" qualifiers= "const" >
<return type= "RID" >
</return>
<description >
2017-09-24 04:47:13 +02:00
Returns the object's [RID].
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_shape_owners" >
<return type= "Array" >
</return>
<description >
2017-09-24 04:47:13 +02:00
Returns an [Array] of [code]owner_id[/code] identifiers. You can use these ids in other methods that take [code]owner_id[/code] as an argument.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "is_shape_owner_disabled" qualifiers= "const" >
<return type= "bool" >
</return>
<argument index= "0" name= "owner_id" type= "int" >
</argument>
<description >
2018-12-20 13:46:54 +01:00
If [code]true[/code], the shape owner and its shapes are disabled.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "remove_shape_owner" >
<return type= "void" >
</return>
<argument index= "0" name= "owner_id" type= "int" >
</argument>
<description >
2017-09-24 04:47:13 +02:00
Removes the given shape owner.
2017-09-12 22:42:36 +02:00
</description>
</method>
2020-10-13 14:17:00 +02:00
<method name= "set_collision_layer_bit" >
<return type= "void" >
</return>
<argument index= "0" name= "bit" type= "int" >
</argument>
<argument index= "1" name= "value" type= "bool" >
</argument>
<description >
2021-07-24 22:55:11 +02:00
If [code]value[/code] is [code]true[/code], sets the specified [code]bit[/code] in the the [member collision_layer].
If [code]value[/code] is [code]false[/code], clears the specified [code]bit[/code] in the the [member collision_layer].
2020-10-13 14:17:00 +02:00
</description>
</method>
<method name= "set_collision_mask_bit" >
<return type= "void" >
</return>
<argument index= "0" name= "bit" type= "int" >
</argument>
<argument index= "1" name= "value" type= "bool" >
</argument>
<description >
2021-07-24 22:55:11 +02:00
If [code]value[/code] is [code]true[/code], sets the specified [code]bit[/code] in the the [member collision_mask].
If [code]value[/code] is [code]false[/code], clears the specified [code]bit[/code] in the the [member collision_mask].
2020-10-13 14:17:00 +02:00
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "shape_find_owner" qualifiers= "const" >
<return type= "int" >
</return>
<argument index= "0" name= "shape_index" type= "int" >
</argument>
<description >
2017-09-24 04:47:13 +02:00
Returns the [code]owner_id[/code] of the given shape.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "shape_owner_add_shape" >
<return type= "void" >
</return>
<argument index= "0" name= "owner_id" type= "int" >
</argument>
<argument index= "1" name= "shape" type= "Shape" >
</argument>
<description >
2017-09-24 04:47:13 +02:00
Adds a [Shape] to the shape owner.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "shape_owner_clear_shapes" >
<return type= "void" >
</return>
<argument index= "0" name= "owner_id" type= "int" >
</argument>
<description >
2017-09-24 04:47:13 +02:00
Removes all shapes from the shape owner.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "shape_owner_get_owner" qualifiers= "const" >
<return type= "Object" >
</return>
<argument index= "0" name= "owner_id" type= "int" >
</argument>
<description >
2017-09-24 04:47:13 +02:00
Returns the parent object of the given shape owner.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "shape_owner_get_shape" qualifiers= "const" >
<return type= "Shape" >
</return>
<argument index= "0" name= "owner_id" type= "int" >
</argument>
<argument index= "1" name= "shape_id" type= "int" >
</argument>
<description >
2017-09-24 04:47:13 +02:00
Returns the [Shape] with the given id from the given shape owner.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "shape_owner_get_shape_count" qualifiers= "const" >
<return type= "int" >
</return>
<argument index= "0" name= "owner_id" type= "int" >
</argument>
<description >
2017-09-24 04:47:13 +02:00
Returns the number of shapes the given shape owner contains.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "shape_owner_get_shape_index" qualifiers= "const" >
<return type= "int" >
</return>
<argument index= "0" name= "owner_id" type= "int" >
</argument>
<argument index= "1" name= "shape_id" type= "int" >
</argument>
<description >
2017-12-07 20:17:08 +01:00
Returns the child index of the [Shape] with the given id from the given shape owner.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "shape_owner_get_transform" qualifiers= "const" >
<return type= "Transform" >
</return>
<argument index= "0" name= "owner_id" type= "int" >
</argument>
<description >
2017-09-24 04:47:13 +02:00
Returns the shape owner's [Transform].
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "shape_owner_remove_shape" >
<return type= "void" >
</return>
<argument index= "0" name= "owner_id" type= "int" >
</argument>
<argument index= "1" name= "shape_id" type= "int" >
</argument>
<description >
2017-09-24 04:47:13 +02:00
Removes a shape from the given shape owner.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "shape_owner_set_disabled" >
<return type= "void" >
</return>
<argument index= "0" name= "owner_id" type= "int" >
</argument>
<argument index= "1" name= "disabled" type= "bool" >
</argument>
<description >
2018-12-20 13:46:54 +01:00
If [code]true[/code], disables the given shape owner.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "shape_owner_set_transform" >
<return type= "void" >
</return>
<argument index= "0" name= "owner_id" type= "int" >
</argument>
<argument index= "1" name= "transform" type= "Transform" >
</argument>
<description >
2017-09-24 04:47:13 +02:00
Sets the [Transform] of the given shape owner.
2017-09-12 22:42:36 +02:00
</description>
</method>
</methods>
<members >
2020-10-13 14:17:00 +02:00
<member name= "collision_layer" type= "int" setter= "set_collision_layer" getter= "get_collision_layer" default= "1" >
The physics layers this CollisionObject3D is in. Collision objects can exist in one or more of 32 different layers. See also [member collision_mask].
[b]Note:[/b] A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
<member name= "collision_mask" type= "int" setter= "set_collision_mask" getter= "get_collision_mask" default= "1" >
The physics layers this CollisionObject3D scans. Collision objects can scan one or more of 32 different layers. See also [member collision_layer].
[b]Note:[/b] A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
</member>
2019-06-29 12:38:01 +02:00
<member name= "input_capture_on_drag" type= "bool" setter= "set_capture_input_on_drag" getter= "get_capture_input_on_drag" default= "false" >
2019-06-29 15:24:23 +02:00
If [code]true[/code], the [CollisionObject] will continue to receive input events as the mouse is dragged across its shapes.
2017-09-12 22:42:36 +02:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "input_ray_pickable" type= "bool" setter= "set_ray_pickable" getter= "is_ray_pickable" default= "true" >
2019-06-29 15:24:23 +02:00
If [code]true[/code], the [CollisionObject]'s shapes will respond to [RayCast]s.
2017-09-12 22:42:36 +02:00
</member>
</members>
<signals >
<signal name= "input_event" >
2018-09-01 12:05:51 +02:00
<argument index= "0" name= "camera" type= "Node" >
2017-09-12 22:42:36 +02:00
</argument>
2018-08-31 21:12:35 +02:00
<argument index= "1" name= "event" type= "InputEvent" >
2017-09-12 22:42:36 +02:00
</argument>
2021-06-07 10:50:47 +02:00
<argument index= "2" name= "position" type= "Vector3" >
2017-09-12 22:42:36 +02:00
</argument>
2021-06-07 10:50:47 +02:00
<argument index= "3" name= "normal" type= "Vector3" >
2017-09-12 22:42:36 +02:00
</argument>
<argument index= "4" name= "shape_idx" type= "int" >
</argument>
<description >
2021-06-07 10:50:47 +02:00
Emitted when the object receives an unhandled [InputEvent]. [code]position[/code] is the location in world space of the mouse pointer on the surface of the shape with index [code]shape_idx[/code] and [code]normal[/code] is the normal vector of the surface at that point.
2017-09-12 22:42:36 +02:00
</description>
</signal>
<signal name= "mouse_entered" >
<description >
2017-09-24 04:47:13 +02:00
Emitted when the mouse pointer enters any of this object's shapes.
2017-09-12 22:42:36 +02:00
</description>
</signal>
<signal name= "mouse_exited" >
<description >
2017-09-24 04:47:13 +02:00
Emitted when the mouse pointer exits all this object's shapes.
2017-09-12 22:42:36 +02:00
</description>
</signal>
</signals>
<constants >
</constants>
</class>