new CollisionCheckerSingleton()
Singleton to store the in-use collision checker strategy.
Members
-
<private, static> instance :Grape2D.CollisionChecker
-
Collision checker instance.
Type:
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 Returns:
Result of the collision test.- Type
- boolean
-
<static> getCollisionChecker() → {Grape2D.CollisionChecker}
-
Gets the collision checker instance.
Returns:
The instance. -
<static> setCollisionChecker(instance)
-
Sets the collision checker instance.
Parameters:
Name Type Description instance
Grape2D.CollisionChecker The new instance.