PhysicsBody2D

Base class for all objects affected by physics in 2D space.

PhysicsBody2D is an abstract base class for implementing a physics body. All *Body2D types inherit from it.

Members

Aliases

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

Functions

_getLayers
long _getLayers()
_setLayers
void _setLayers(long mask)
addCollisionExceptionWith
void addCollisionExceptionWith(GodotObject _body)

Adds a body to the list of bodies that this body can't collide with.

getCollisionExceptions
Array getCollisionExceptions()

Returns an array of nodes that were added as collision exceptions for this body.

getCollisionLayer
long getCollisionLayer()
getCollisionLayerBit
bool getCollisionLayerBit(long bit)

Returns an individual bit on the collision mask.

getCollisionMask
long getCollisionMask()
getCollisionMaskBit
bool getCollisionMaskBit(long bit)

Returns an individual bit on the collision mask.

opAssign
PhysicsBody2D opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(PhysicsBody2D other)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(typeof(null) n)
Undocumented in source. Be warned that the author may not have intended to support it.
removeCollisionExceptionWith
void removeCollisionExceptionWith(GodotObject _body)

Removes a body from the list of bodies that this body can't collide with.

setCollisionLayer
void setCollisionLayer(long layer)
setCollisionLayerBit
void setCollisionLayerBit(long bit, bool value)

Sets individual bits on the layer mask. Use this if you only need to change one layer's value.

setCollisionMask
void setCollisionMask(long mask)
setCollisionMaskBit
void setCollisionMaskBit(long bit, bool value)

Sets individual bits on the collision mask. Use this if you only need to change one layer's value.

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

collisionLayer
long collisionLayer [@property setter]

The physics layers this area is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A.

collisionLayer
long collisionLayer [@property getter]

The physics layers this area is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A.

collisionMask
long collisionMask [@property getter]
long collisionMask [@property setter]

The physics layers this area scans for collisions.

layers
long layers [@property getter]
long layers [@property setter]

Both collisionLayer and collisionMask. Returns collisionLayer when accessed. Updates collisionLayer and collisionMask when modified.

Static functions

_new
PhysicsBody2D _new()
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

_classBinding
struct _classBinding
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
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
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