Struct CollisionObject

Base node for collision objects.

struct CollisionObject ;

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.

Properties

NameTypeDescription
inputCaptureOnDrag[get, set] boolIf true, the CollisionObject will continue to receive input events as the mouse is dragged across its shapes.
inputRayPickable[get, set] boolIf true, the CollisionObject's shapes will respond to RayCasts.

Methods

NameDescription
_inputEvent Accepts unhandled InputEvents. click_position is the clicked location in world space and click_normal is the normal vector extending from the clicked surface of the Shape at shape_idx. Connect to the input_event signal to easily pick up these events.
createShapeOwner Creates a new shape owner for the given object. Returns owner_id of the new owner for future reference.
getCaptureInputOnDrag
getRid Returns the object's RID.
getShapeOwners Returns an Array of owner_id identifiers. You can use these ids in other methods that take owner_id as an argument.
isRayPickable
isShapeOwnerDisabled If true, the shape owner and its shapes are disabled.
removeShapeOwner Removes the given shape owner.
setCaptureInputOnDrag
setRayPickable
shapeFindOwner Returns the owner_id of the given shape.
shapeOwnerAddShape Adds a Shape to the shape owner.
shapeOwnerClearShapes Removes all shapes from the shape owner.
shapeOwnerGetOwner Returns the parent object of the given shape owner.
shapeOwnerGetShape Returns the Shape with the given id from the given shape owner.
shapeOwnerGetShapeCount Returns the number of shapes the given shape owner contains.
shapeOwnerGetShapeIndex Returns the child index of the Shape with the given id from the given shape owner.
shapeOwnerGetTransform Returns the shape owner's Transform.
shapeOwnerRemoveShape Removes a shape from the given shape owner.
shapeOwnerSetDisabled If true, disables the given shape owner.
shapeOwnerSetTransform Sets the Transform of the given shape owner.