-
Notifications
You must be signed in to change notification settings - Fork 0
class_collisionobject2d
reduz edited this page Feb 23, 2014
·
9 revisions
Inherits: node2d\ Category: Core\
Base node for 2D collisionables.
- 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
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_shape ==
- void #add_shape( Shape2D shape, Matrix32 transform=1,0, 0,1, 0,0 ) \ Add a shape2d to the collision body, with a given custom transform. == get_shape_count ==
- int #get_shape_count(****) const \ Return the amount of shapes in the collision body. == set_shape ==
- void #set_shape( int shape_idx, Shape shape ) \ Change a shape in the collision body. == set_shape_transform ==
- void #set_shape_transform( int shape_idx, Matrix32 transform ) \ Change the shape transform in the collision body. == get_shape ==
- Shape2D #get_shape( int shape_idx ) const \ Return the shape in the given index. == get_shape_transform ==
- Matrix32 #get_shape_transform( int shape_idx ) const \ Return the shape transform in the given index. == remove_shape ==
- void #remove_shape( int shape_idx ) \ Remove the shape in the given index. == clear_shapes ==
- void #clear_shapes(****) \ Remove all shapes.