Public Types | Public Member Functions | Public Attributes

bl7::geometry2::Poly Class Reference

#include <Poly.h>

Inheritance diagram for bl7::geometry2::Poly:
bl7::geometry2::Geometry bl7::geometry2::CollisionPoly

List of all members.

Public Types

typedef std::vector< ml7::Vector2Vertices

Public Member Functions

 Poly (void)
 ~Poly (void)
 Poly (const Poly &rhs)
Polyoperator= (const Poly &rhs)
 Poly (const Vertices &vertices)
Polyfrom_vertices (const Vertices &vertices)
const Verticesget_vertices () const
const AABBget_aabb () const
const BoundingSphereget_bounding_sphere () const
const ml7::Vector2get_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::Vector2get_vertex (size_t i) const
const ml7::Vector2operator[] (size_t i) const
void capture ()
Polytranslate (const ml7::Vector2 &v)
Polyrotate (const ml7::Matrix2x2 &m)
Polytransform (const ml7::Matrix2x2 &m, const ml7::Vector2 &v)
Polytransform (const ml7::Matrix2x3 &m)
Polynormalize ()
Polyoperator+= (const ml7::Vector2 &v)
Polyoperator*= (const ml7::Matrix2x2 &m)

Public Attributes

ml7::Vector2 center

Member Typedef Documentation


Constructor & Destructor Documentation

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).


Member Function Documentation

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.

Poly & bl7::geometry2::Poly::from_vertices ( const Vertices 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.

Poly & bl7::geometry2::Poly::operator= ( const Poly rhs  ) 

Copy assignment operator.

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.


Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines