Class: CircleCollider

Colliders.CircleCollider

Circle collider class

new Colliders.CircleCollider (_x, _y, _R)

Name Type Description
_x Number x coordinate of the circle (center)
_y Number y coordinate of the circle (center)
_R Number the circle radius

Methods

containsPoint (x, y)Boolean

checks whether CircleCollider contains a point.
Name Type Description
x Number the x position of the point to test.
y Number the y position of the point to test.
Returns:
Type Description
Boolean true if it contains the point, false otherwise.

getNormal (other)Utils.Vector2d

calculates normal vector with other CircleCollider. Assumes penetration.
Name Type Description
other Colliders.CircleCollider other CircleCollider to calculate normal with.
Returns:
Type Description
Utils.Vector2d the normal vector.

getPenetration (other)Utils.Vector2d

calculates penetration vector with other CircleCollider. Assumes penetration itself.
Name Type Description
other Colliders.CircleCollider other AABB to calculate penetration with.
Returns:
Type Description
Utils.Vector2d the penetration vector.

isColliding (other)Boolean

checks CircleCollider collision with other CircleCollider.
Name Type Description
other Colliders.CircleCollider other CircleCollider to check collision against.
Returns:
Type Description
Boolean true if they collide, false otherwise.

setTransform (transform)

set the CircleCollider position from a transform.
Name Type Description
transform Core.Transform the transform to get position from