forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
class_collisionobject2d
Lukas Sägesser edited this page Jun 22, 2015
·
10 revisions
####Inherits: Node2D ####Category: Core
Base node for 2D collisionables.
- void _input_event ( Object viewport, InputEvent event, int shape_idx ) virtual
- void add_shape ( Shape2D shape, Matrix32 transform=1,0, 0,1, 0,0 )
- int get_shape_count ( ) const
- void set_shape ( int shape_idx, Shape shape )
- void set_shape_transform ( int shape_idx, Matrix32 transform )
- void set_shape_as_trigger ( int shape_idx, bool enable )
- Shape2D get_shape ( int shape_idx ) const
- Matrix32 get_shape_transform ( int shape_idx ) const
- bool is_shape_set_as_trigger ( int shape_idx ) const
- void remove_shape ( int shape_idx )
- void clear_shapes ( )
- RID get_rid ( ) const
- void set_pickable ( bool enabled )
- bool is_pickable ( ) const
- mouse_enter ( )
- input_event ( Object viewport, InputEvent event, int shape_idx )
- mouse_exit ( )
CollisionObject2D is the base class for 2D physics collisionables. They can hold any number of 2D collision shapes. Usually, they are edited by placing CollisionBody2D and CollisionPolygon2D nodes as children. Such nodes are for reference ant not present outside the editor, so code should use the regular shape API.
Add a Shape2D to the collision body, with a given custom transform.
- int get_shape_count ( ) const
Return the amount of shapes in the collision body.
Change a shape in the collision body.
Change the shape transform in the collision body.
Return the shape in the given index.
Return the shape transform in the given index.
- void remove_shape ( int shape_idx )
Remove the shape in the given index.
- void clear_shapes ( )
Remove all shapes.