Class: CollisionCheckerSingleton

Grape2D. CollisionCheckerSingleton

new CollisionCheckerSingleton()

Singleton to store the in-use collision checker strategy.
Source:

Members

<private, static> instance :Grape2D.CollisionChecker

Collision checker instance.
Type:
Source:

Methods

<static> collide(a, b) → {boolean}

Collides two shpaes. It is syntax sugar for shapeA.collide(Grape2D.CollisionCheckerSingleton.getInstance(), shapeB);
Parameters:
Name Type Description
a Grape2D.Shape | Grape2D.Vector Shape or point
b Grape2D.Shape | Grape2D.Vector Another shape or point
Source:
Returns:
Result of the collision test.
Type
boolean

<static> getCollisionChecker() → {Grape2D.CollisionChecker}

Gets the collision checker instance.
Source:
Returns:
The instance.
Type
Grape2D.CollisionChecker

<static> setCollisionChecker(instance)

Sets the collision checker instance.
Parameters:
Name Type Description
instance Grape2D.CollisionChecker The new instance.
Source: