new BVFactory()
Creates bounding volumes based in an input object.
- Source:
Methods
-
createFromAABB(aabb) → {Grape2D.Shape}
-
Creates a shape, based on the type set, from an Grape2D.AABB.
Parameters:
Name Type Description aabb
Grape2D.AABB The object. - Source:
Returns:
Shape based on the type of the factory.- Type
- Grape2D.Shape
-
createFromCircle(circle) → {Grape2D.Shape}
-
Creates a shape, based on the type set, from an Grape2D.Circle.
Parameters:
Name Type Description circle
Grape2D.Circle The object. - Source:
Returns:
Shape based on the type of the factory.- Type
- Grape2D.Shape
-
createFromPolygon(polygon) → {Grape2D.Shape}
-
Creates a shape, based on the type set, from an Grape2D.Polygon.
Parameters:
Name Type Description polygon
Grape2D.Polygon The object. - Source:
Returns:
Shape based on the type of the factory.- Type
- Grape2D.Shape
-
createSceneBV(renderer, camera) → {Grape2D.Shape}
-
Creates a shape for a scene, based on the renderer and the camera being used.
Parameters:
Name Type Description renderer
Grape2D.Renderer Renderer to where the scene will be rendered. camera
Grape2D.Camera Camera that is capturing the scene. - Source:
Returns:
Shape based on the type of the factory.- Type
- Grape2D.Shape
-
getPlaceHolder() → {Grape2D.Shape}
-
Returns a place holder shape, of the type of the factory. It should only be used to avoid using
null
to represent bounding volumes temporarily. Shouldn't create a new instance every time this method is called.- Source:
Returns:
A shape has a place holder.- Type
- Grape2D.Shape