shape

Creating shapes for calculating collision

virtuosity.collisionManager.shape

Classes


Classes

Point

Returns a Point collision shape object

new virtuosity.collisionManager.shape.Point(x, y);


Parameter Type Description
x Number x position of the Point
y Number y position of the Point

Box

Returns a Box collision shape object

new virtuosity.collisionManager.shape.Box(x, y, width, height);


Parameter Type Description
x Number x position of the Box
y Number y position of the Box
width Number width of the Box
height Number height of the Box

Circle

Returns a Circle collision shape object

new virtuosity.collisionManager.shape.Circle(x, y, r);


Parameter Type Description
x Number x position of the Circle
y Number y position of the Circle
r Number radius of the Circle

Line

Returns a Line collision shape object

new virtuosity.collisionManager.shape.Line(x1, y1, x2, y2);


Parameter Type Description
x1 Number x position of the first point of the Line
y1 Number y position of the first point of the Line
x2 Number x position of the second point of the Line
y2 Number y position of the second point of the Line

Polygon

Returns a Polygon collision shape object

new virtuosity.collisionManager.shape.Polygon(points);


Parameter Type Description
points [Point] points of the Polygon. Can be made up of Points, arrays setup like: [x, y], or a combination.