KinematicCollision2D

Collision data for KinematicBody2D collisions.

Contains collision data for KinematicBody2D collisions. When a KinematicBody2D is moved using KinematicBody2D.moveAndCollide, it stops if it detects a collision with another body. If a collision is detected, a KinematicCollision2D object is returned. This object contains information about the collision, including the colliding object, the remaining motion, and the collision position. This information can be used to calculate a collision response.

Members

Aliases

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

Functions

getCollider
GodotObject getCollider()
getColliderId
long getColliderId()
getColliderMetadata
Variant getColliderMetadata()
getColliderShape
GodotObject getColliderShape()
getColliderShapeIndex
long getColliderShapeIndex()
getColliderVelocity
Vector2 getColliderVelocity()
getLocalShape
GodotObject getLocalShape()
getNormal
Vector2 getNormal()
getPosition
Vector2 getPosition()
getRemainder
Vector2 getRemainder()
getTravel
Vector2 getTravel()
opAssign
KinematicCollision2D opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(KinematicCollision2D 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.

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

collider
GodotObject collider [@property getter]

The colliding body.

colliderId
long colliderId [@property getter]

The colliding body's unique RID.

colliderMetadata
Variant colliderMetadata [@property getter]

The colliding body's metadata. See GodotObject.

colliderShape
GodotObject colliderShape [@property getter]

The colliding body's shape.

colliderShapeIndex
long colliderShapeIndex [@property getter]

The colliding shape's index. See CollisionObject2D.

colliderVelocity
Vector2 colliderVelocity [@property getter]

The colliding object's velocity.

localShape
GodotObject localShape [@property getter]

The moving object's colliding shape.

normal
Vector2 normal [@property getter]

The colliding body's shape's normal at the point of collision.

position
Vector2 position [@property getter]

The point of collision.

remainder
Vector2 remainder [@property getter]

The moving object's remaining movement vector.

travel
Vector2 travel [@property getter]

The distance the moving object traveled before collision.

Static functions

_new
KinematicCollision2D _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