Rebel Fork Framework
Urho3D::Polyhedron Class Reference

A convex volume built from polygon faces. More...

#include <Urho3D/Math/Polyhedron.h>

Public Member Functions

 Polyhedron ()=default
 Construct empty.
 
 ~Polyhedron () noexcept=default
 Destruct.
 
 Polyhedron (const Polyhedron &polyhedron)
 Copy-construct from another polyhedron.
 
 Polyhedron (const ea::vector< ea::vector< Vector3 > > &faces)
 Construct from a list of faces.
 
 Polyhedron (const BoundingBox &box)
 Construct from a bounding box.
 
 Polyhedron (const Frustum &frustum)
 Construct from a frustum.
 
Polyhedronoperator= (const Polyhedron &rhs)
 Assign from another polyhedron.
 
void Define (const BoundingBox &box)
 Define from a bounding box.
 
void Define (const Frustum &frustum)
 Define from a frustum.
 
void AddFace (const Vector3 &v0, const Vector3 &v1, const Vector3 &v2)
 Add a triangle face.
 
void AddFace (const Vector3 &v0, const Vector3 &v1, const Vector3 &v2, const Vector3 &v3)
 Add a quadrilateral face.
 
void AddFace (const ea::vector< Vector3 > &face)
 Add an arbitrary face.
 
void Clip (const Plane &plane)
 Clip with a plane.
 
void Clip (const BoundingBox &box)
 Clip with a bounding box.
 
void Clip (const Frustum &frustum)
 Clip with a frustum.
 
void Clear ()
 Clear all faces.
 
void Transform (const Matrix3 &transform)
 Transform with a 3x3 matrix.
 
void Transform (const Matrix3x4 &transform)
 Transform with a 3x4 matrix.
 
Polyhedron Transformed (const Matrix3 &transform) const
 Return transformed with a 3x3 matrix.
 
Polyhedron Transformed (const Matrix3x4 &transform) const
 Return transformed with a 3x4 matrix.
 
bool Empty () const
 Return whether is empty.
 

Public Attributes

ea::vector< ea::vector< Vector3 > > faces_
 Polygon faces.
 

Private Member Functions

void SetFace (unsigned index, const Vector3 &v0, const Vector3 &v1, const Vector3 &v2)
 Set a triangle face by index.
 
void SetFace (unsigned index, const Vector3 &v0, const Vector3 &v1, const Vector3 &v2, const Vector3 &v3)
 Set a quadrilateral face by index.
 

Private Attributes

ea::vector< Vector3clippedVertices_
 Internal vector for clipped vertices.
 
ea::vector< Vector3outFace_
 Internal vector for the new face being constructed.
 

Detailed Description

A convex volume built from polygon faces.


The documentation for this class was generated from the following files: