#include <Poly.h>
Public Types | |
| typedef std::vector< ml7::Vector2 > | Vertices |
Public Member Functions | |
| Poly (void) | |
| ~Poly (void) | |
| Poly (const Poly &rhs) | |
| Poly & | operator= (const Poly &rhs) |
| Poly (const Vertices &vertices) | |
| Poly & | from_vertices (const Vertices &vertices) |
| const Vertices & | get_vertices () const |
| const AABB & | get_aabb () const |
| const BoundingSphere & | get_bounding_sphere () const |
| const ml7::Vector2 & | get_center_of_area () const |
| float | get_area () const |
| float | get_inertia_of_area () const |
| void | add_vertex (const ml7::Vector2 &v, bool capture=false) |
| void | add_vertices (const ml7::Vector2 *v, unsigned n, bool capture=false) |
| size_t | get_vertex_count () const |
| const ml7::Vector2 & | get_vertex (size_t i) const |
| const ml7::Vector2 & | operator[] (size_t i) const |
| void | capture () |
| Poly & | translate (const ml7::Vector2 &v) |
| Poly & | rotate (const ml7::Matrix2x2 &m) |
| Poly & | transform (const ml7::Matrix2x2 &m, const ml7::Vector2 &v) |
| Poly & | transform (const ml7::Matrix2x3 &m) |
| Poly & | normalize () |
| Poly & | operator+= (const ml7::Vector2 &v) |
| Poly & | operator*= (const ml7::Matrix2x2 &m) |
Public Attributes | |
| ml7::Vector2 | center |
| typedef std::vector<ml7::Vector2> bl7::geometry2::Poly::Vertices |
| bl7::geometry2::Poly::Poly | ( | void | ) |
Default constructor.
| bl7::geometry2::Poly::~Poly | ( | void | ) |
Destructor.
| bl7::geometry2::Poly::Poly | ( | const Poly & | rhs | ) |
Copy constructor.
| bl7::geometry2::Poly::Poly | ( | const Vertices & | vertices | ) |
Explicit constructor: poly from a list of vertices (in clockwise order).
| void bl7::geometry2::Poly::add_vertex | ( | const ml7::Vector2 & | v, | |
| bool | capture = false | |||
| ) |
Adds a given vertex updating the shape and area properties as well as the bounding volumes encapsulating the geometry (if wanted to).
| void bl7::geometry2::Poly::add_vertices | ( | const ml7::Vector2 * | v, | |
| unsigned | n, | |||
| bool | capture = false | |||
| ) |
Adds a set of n given vertices updating the shape and area properties as well as the bounding volumes encapsulating the geometry (if wanted to).
| void bl7::geometry2::Poly::capture | ( | ) |
Captures the area properties as well as the bounding volumes encapsulating this geometry's vertices.
Creates the poly from a list of vertices (in clockwise order).
| const AABB& bl7::geometry2::Poly::get_aabb | ( | ) | const [inline] |
Returns the axis-aligned bounding box enclosing all vertices.
| float bl7::geometry2::Poly::get_area | ( | ) | const [inline] |
Returns the area of this geometry.
| const BoundingSphere& bl7::geometry2::Poly::get_bounding_sphere | ( | ) | const [inline] |
Returns the bounding sphere enclosing all vertices.
| const ml7::Vector2& bl7::geometry2::Poly::get_center_of_area | ( | ) | const [inline] |
Returns the center position of area.
| float bl7::geometry2::Poly::get_inertia_of_area | ( | ) | const [inline] |
Returns the polar geometrical moment of inertia.
| const ml7::Vector2& bl7::geometry2::Poly::get_vertex | ( | size_t | i | ) | const [inline] |
Returns the i-th vertex of this geometry.
| size_t bl7::geometry2::Poly::get_vertex_count | ( | ) | const [inline] |
Returns the number of vertices forming this geometry.
| const Vertices& bl7::geometry2::Poly::get_vertices | ( | ) | const [inline] |
Returns the list of vertices (in clockwise order).
| Poly& bl7::geometry2::Poly::normalize | ( | ) | [inline] |
Normalizes this geometry so that the center point of area is 0.
| Poly& bl7::geometry2::Poly::operator*= | ( | const ml7::Matrix2x2 & | m | ) | [inline] |
Rotates this geometry by a given rotation matrix.
| Poly& bl7::geometry2::Poly::operator+= | ( | const ml7::Vector2 & | v | ) | [inline] |
Translates this geometry by a given vector.
| const ml7::Vector2& bl7::geometry2::Poly::operator[] | ( | size_t | i | ) | const [inline] |
Returns the i-th vertex of this geometry.
| Poly & bl7::geometry2::Poly::rotate | ( | const ml7::Matrix2x2 & | m | ) |
Rotates this geometry by a given rotation matrix.
| Poly & bl7::geometry2::Poly::transform | ( | const ml7::Matrix2x3 & | m | ) |
Transforms (rotates and translates) this geometry by a given matrix.
| Poly & bl7::geometry2::Poly::transform | ( | const ml7::Matrix2x2 & | m, | |
| const ml7::Vector2 & | v | |||
| ) |
Rotates and translates this geometry by a given matrix and a given vector.
| Poly & bl7::geometry2::Poly::translate | ( | const ml7::Vector2 & | v | ) |
Translates this geometry by a given vector.
The center position.
1.7.1