CollisionObject

Base node for collision objects.

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.

@GodotBaseClass
struct CollisionObject {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

_inputEvent
void _inputEvent(GodotObject camera, InputEvent event, Vector3 click_position, Vector3 click_normal, long shape_idx)

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.

_shapeChanged
void _shapeChanged(Shape shape)
_updateDebugShapes
void _updateDebugShapes()
createShapeOwner
long createShapeOwner(GodotObject owner)

Creates a new shape owner for the given object. Returns owner_id of the new owner for future reference.

getCaptureInputOnDrag
bool getCaptureInputOnDrag()
getRid
RID getRid()

Returns the object's RID.

getShapeOwners
Array getShapeOwners()

Returns an Array of owner_id identifiers. You can use these ids in other methods that take owner_id as an argument.

isRayPickable
bool isRayPickable()
isShapeOwnerDisabled
bool isShapeOwnerDisabled(long owner_id)

If true, the shape owner and its shapes are disabled.

opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(CollisionObject other)
opEquals
bool opEquals(typeof(null) n)
removeShapeOwner
void removeShapeOwner(long owner_id)

Removes the given shape owner.

setCaptureInputOnDrag
void setCaptureInputOnDrag(bool enable)
setRayPickable
void setRayPickable(bool ray_pickable)
shapeFindOwner
long shapeFindOwner(long shape_index)

Returns the owner_id of the given shape.

shapeOwnerAddShape
void shapeOwnerAddShape(long owner_id, Shape shape)

Adds a Shape to the shape owner.

shapeOwnerClearShapes
void shapeOwnerClearShapes(long owner_id)

Removes all shapes from the shape owner.

shapeOwnerGetOwner
GodotObject shapeOwnerGetOwner(long owner_id)

Returns the parent object of the given shape owner.

shapeOwnerGetShape
Ref!Shape shapeOwnerGetShape(long owner_id, long shape_id)

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

shapeOwnerGetShapeCount
long shapeOwnerGetShapeCount(long owner_id)

Returns the number of shapes the given shape owner contains.

shapeOwnerGetShapeIndex
long shapeOwnerGetShapeIndex(long owner_id, long shape_id)

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

shapeOwnerGetTransform
Transform shapeOwnerGetTransform(long owner_id)

Returns the shape owner's Transform.

shapeOwnerRemoveShape
void shapeOwnerRemoveShape(long owner_id, long shape_id)

Removes a shape from the given shape owner.

shapeOwnerSetDisabled
void shapeOwnerSetDisabled(long owner_id, bool disabled)

If true, disables the given shape owner.

shapeOwnerSetTransform
void shapeOwnerSetTransform(long owner_id, Transform transform)

Sets the Transform of the given shape owner.

toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

inputCaptureOnDrag
bool inputCaptureOnDrag [@property getter]
bool inputCaptureOnDrag [@property setter]

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

inputRayPickable
bool inputRayPickable [@property getter]
bool inputRayPickable [@property setter]

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

Static functions

_new
CollisionObject _new()

Construct a new instance of CollisionObject. Note: use memnew!CollisionObject instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta