Collision
:Collision resolution data.
group
Physics
source
: GameObjThe first game object in the collision.
target
: GameObjThe second game object in the collision.
normal
: Vec2The contact normal.
distance
: numberThe length of the displacement.
resolved
: booleanIf the collision is resolved.
displacement
(): Vec2The displacement source game object have to make to avoid the collision.
reverse
() => CollisionGet a new collision with reversed source and target relationship.
hasOverlap
() => booleanIf the 2 objects have any overlap, or they're just touching edges.
since
v3000.0
isLeft
() => booleanIf the collision happened (roughly) on the left side.
isRight
() => booleanIf the collision happened (roughly) on the right side.
isTop
() => booleanIf the collision happened (roughly) on the top side.
isBottom
() => booleanIf the collision happened (roughly) on the bottom side.
preventResolution
() => voidPrevent collision resolution if not yet resolved.
since
v3000.0