UGDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
pyramidworks::geometry::ConvexPolygon Class Reference

#include <convexpolygon.h>

Inheritance diagram for pyramidworks::geometry::ConvexPolygon:
Inheritance graph
[legend]
Collaboration diagram for pyramidworks::geometry::ConvexPolygon:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ConvexPolygon (const std::vector< ugdk::Vector2D > &vertices)
void set_vertices (const std::vector< ugdk::Vector2D > &vertices)
bool Intersects (const ugdk::Vector2D &this_pos, const GeometricShape *obj, const ugdk::Vector2D &that_pos) const
 Checks if this shape intersects another shape.
bool Intersects (const ugdk::Vector2D &this_pos, const Rect *obj, const ugdk::Vector2D &that_pos) const
 Checks if there's an intersection with a Rect.
bool Intersects (const ugdk::Vector2D &this_pos, const Circle *obj, const ugdk::Vector2D &that_pos) const
 Checks if there's an intersection with a Circle.
bool Intersects (const ugdk::Vector2D &this_pos, const ConvexPolygon *obj, const ugdk::Vector2D &that_pos) const
 Checks if there's an intersection with a Convex Polygon.
ugdk::ikdtree::Box< 2 > GetBoundingBox (const ugdk::Vector2D &position) const
 Returns a bounding box for this shape.
double bbox_width ()
double bbox_height ()

Constructor & Destructor Documentation

Parameters:
verticesThe list of vertices of the polygon, in local coordinates (0,0 is the "center", where this polygon is positioned). vertices[i] and vertices[i+1] form a edge, and vertices[n]-vertices[0] is the closing edge.

Member Function Documentation

Returns a bounding box for this shape.

The box is at the shape's position and offset

Parameters:
positionThe absolute position for this shape.
Returns:
A 2D Box around this shape

Implements pyramidworks::geometry::GeometricShape.

bool pyramidworks::geometry::ConvexPolygon::Intersects ( const ugdk::Vector2D this_pos,
const GeometricShape obj,
const ugdk::Vector2D that_pos 
) const [virtual]

Checks if this shape intersects another shape.

Parameters:
this_posThe absolute position for this shape.
objThe shape to compare with.
that_posThe absolute position of the other shape.
Returns:
True if there's an intersection.

Implements pyramidworks::geometry::GeometricShape.

bool pyramidworks::geometry::ConvexPolygon::Intersects ( const ugdk::Vector2D this_pos,
const Rect obj,
const ugdk::Vector2D that_pos 
) const [virtual]

Checks if there's an intersection with a Rect.

Parameters:
this_posThe absolute position for this shape.
objThe shape to compare with.
that_posThe absolute position of the other shape.
Returns:
True if there's an intersection.

Implements pyramidworks::geometry::GeometricShape.

bool pyramidworks::geometry::ConvexPolygon::Intersects ( const ugdk::Vector2D this_pos,
const Circle obj,
const ugdk::Vector2D that_pos 
) const [virtual]

Checks if there's an intersection with a Circle.

Parameters:
this_posThe absolute position for this shape.
objThe shape to compare with.
that_posThe absolute position of the other shape.
Returns:
True if there's an intersection.

Implements pyramidworks::geometry::GeometricShape.

bool pyramidworks::geometry::ConvexPolygon::Intersects ( const ugdk::Vector2D this_pos,
const ConvexPolygon obj,
const ugdk::Vector2D that_pos 
) const [virtual]

Checks if there's an intersection with a Convex Polygon.

Parameters:
this_posThe absolute position for this shape.
objThe shape to compare with.
that_posThe absolute position of the other shape.
Returns:
True if there's an intersection.

Implements pyramidworks::geometry::GeometricShape.

void pyramidworks::geometry::ConvexPolygon::set_vertices ( const std::vector< ugdk::Vector2D > &  vertices) [inline]

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