CollisionObject

Inherits: Spatial < Node < Object

Inherited By: Area, PhysicsBody

Nodo base para objetos de colisión.

Descripción

CollisionObject is the base class for physics objects. It can hold any number of collision Shapes. Each shape must be assigned to a shape owner. 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 shape_owner_* methods.

Métodos

void

_input_event ( Object camera, InputEvent event, Vector3 position, Vector3 normal, int shape_idx ) virtual

int

create_shape_owner ( Object owner )

bool

get_collision_layer_bit ( int bit ) const

bool

get_collision_mask_bit ( int bit ) const

RID

get_rid ( ) const

Array

get_shape_owners ( )

bool

is_shape_owner_disabled ( int owner_id ) const

void

remove_shape_owner ( int owner_id )

void

set_collision_layer_bit ( int bit, bool value )

void

set_collision_mask_bit ( int bit, bool value )

int

shape_find_owner ( int shape_index ) const

void

shape_owner_add_shape ( int owner_id, Shape shape )

void

shape_owner_clear_shapes ( int owner_id )

Object

shape_owner_get_owner ( int owner_id ) const

Shape

shape_owner_get_shape ( int owner_id, int shape_id ) const

int

shape_owner_get_shape_count ( int owner_id ) const

int

shape_owner_get_shape_index ( int owner_id, int shape_id ) const

Transform

shape_owner_get_transform ( int owner_id ) const

void

shape_owner_remove_shape ( int owner_id, int shape_id )

void

shape_owner_set_disabled ( int owner_id, bool disabled )

void

shape_owner_set_transform ( int owner_id, Transform transform )

Señales

Emitted when the object receives an unhandled InputEvent. position is the location in world space of the mouse pointer on the surface of the shape with index shape_idx and normal is the normal vector of the surface at that point.


  • mouse_entered ( )

Emitido cuando el puntero del ratón entra en cualquiera de las formas de este objeto.


  • mouse_exited ( )

Emitido cuando el puntero del ratón sale de todas las formas de este objeto.

Descripciones de Propiedades

  • int collision_layer

Default

1

Setter

set_collision_layer(value)

Getter

get_collision_layer()

The physics layers this CollisionObject3D is in. Collision objects can exist in one or more of 32 different layers. See also collision_mask.

Note: 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 Collision layers and masks in the documentation for more information.


  • int collision_mask

Default

1

Setter

set_collision_mask(value)

Getter

get_collision_mask()

The physics layers this CollisionObject3D scans. Collision objects can scan one or more of 32 different layers. See also collision_layer.

Note: 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 Collision layers and masks in the documentation for more information.


  • bool input_capture_on_drag

Default

false

Setter

set_capture_input_on_drag(value)

Getter

get_capture_input_on_drag()

If true, the CollisionObject will continue to receive input events as the mouse is dragged across its shapes.


  • bool input_ray_pickable

Default

true

Setter

set_ray_pickable(value)

Getter

is_ray_pickable()

If true, the CollisionObject's shapes will respond to RayCasts.

Descripciones de Métodos

Receives unhandled InputEvents. position is the location in world space of the mouse pointer on the surface of the shape with index shape_idx and normal is the normal vector of the surface at that point. Connect to the input_event signal to easily pick up these events.


Crea un nuevo dueño de la forma para el objeto dado. Devuelve owner_id del nuevo propietario para futuras referencias.


  • bool get_collision_layer_bit ( int bit ) const

Returns whether or not the specified bit of the collision_layer is set.


  • bool get_collision_mask_bit ( int bit ) const

Returns whether or not the specified bit of the collision_mask is set.


  • RID get_rid ( ) const

Devuelve el RID del objeto.


  • Array get_shape_owners ( )

Devuelve un Array de identificadores owner_id. Puedes usar estos identificadores en otros métodos que toman owner_id como argumento.


  • bool is_shape_owner_disabled ( int owner_id ) const

Si true, el propietario de la forma y sus formas se desactivan.


  • void remove_shape_owner ( int owner_id )

Elimina al dueño de la forma dada.


  • void set_collision_layer_bit ( int bit, bool value )

If value is true, sets the specified bit in the the collision_layer.

If value is false, clears the specified bit in the the collision_layer.


  • void set_collision_mask_bit ( int bit, bool value )

If value is true, sets the specified bit in the the collision_mask.

If value is false, clears the specified bit in the the collision_mask.


  • int shape_find_owner ( int shape_index ) const

Devuelve el owner_id de la forma dada.


  • void shape_owner_add_shape ( int owner_id, Shape shape )

Adds a Shape to the shape owner.


  • void shape_owner_clear_shapes ( int owner_id )

Elimina todas las formas del dueño de la forma.


  • Object shape_owner_get_owner ( int owner_id ) const

Devuelve el objeto padre del propietario de la forma dada.


  • Shape shape_owner_get_shape ( int owner_id, int shape_id ) const

Returns the Shape with the given id from the given shape owner.


  • int shape_owner_get_shape_count ( int owner_id ) const

Devuelve el número de formas que contiene el propietario de la forma dada.


  • int shape_owner_get_shape_index ( int owner_id, int shape_id ) const

Returns the child index of the Shape with the given id from the given shape owner.


  • Transform shape_owner_get_transform ( int owner_id ) const

Devuelve el Transform del dueño de la forma.


  • void shape_owner_remove_shape ( int owner_id, int shape_id )

Quita una forma del dueño de la forma dada.


  • void shape_owner_set_disabled ( int owner_id, bool disabled )

Si true, deshabilita al dueño de la forma dada.


  • void shape_owner_set_transform ( int owner_id, Transform transform )

Establece la Transform del dueño de la forma dada.