Plasmacore:Shapes
From Plasmaworks
Plasmacore defines the following compounds used for positioning and collision detection.
- These are all referred to as shapes although there's no base type Shape.
- Most shapes support various contains() and intersects() methods.
- All shapes support either draw(), fill(), or both, primarily for debugging purposes.
- All shapes work with standard math operators (+, -, etc.).
- Type e.g. gogo doc Vector2 or gogo doc "Vector2Manager::op+" to obtain inline documentation.
- Vector2( Real64 x, Real64 y )
- Models a 2D position, velocity, or size, etc.
- Box( Vector2 top_left, Vector2 size )
- Box( Real64 x, Real64 y, Real64 size )
- Box( Vector2 pos,Real64 size )
- Box( Vector2 pos, Real64 x, Real64 y )
- Models an orthogonal, rectangular region.
- Circle( Vector2 position, Real64 radius )
- Models a perfect circle.
- Quad( Vector2 top_left, Vector2 top_right, Vector2 bottom_right, Vector2 bottom_left )
- Models a quadrangle with 4 vertices.
- Line( Vector2 pt1, Vector2 pt2 )
- Models a line segment.
- Triangle( Vector2 a, Vector2 b, Vector2 c )
- Models a triangle with three vertices.