RigsofRods
Soft-body Physics Simulation
Public Member Functions | Data Fields | Private Attributes
Triangle Class Reference

Represents a triangle in three-dimensional space. More...

#include <Triangle.h>

Public Member Functions

 Triangle (const Ogre::Vector3 &a, const Ogre::Vector3 &b, const Ogre::Vector3 &c)
 Construct triangle from three given vertices. More...
 
Ogre::Vector3 normal () const
 Return normal vector of the triangle. More...
 

Data Fields

const Ogre::Vector3 a
 Vertex a. More...
 
const Ogre::Vector3 b
 Vertex b. More...
 
const Ogre::Vector3 c
 Vertex c. More...
 
const Ogre::Vector3 u
 Span vector u. More...
 
const Ogre::Vector3 v
 Span vector v. More...
 

Private Attributes

bool m_initialized
 
Ogre::Vector3 m_normal
 Cached normal vector. More...
 

Detailed Description

Represents a triangle in three-dimensional space.

Stores the three vertices a, b ,c of the triangle and two (non-unit-length) vectors u and v which span the plane within which the triangle lies.

Definition at line 35 of file Triangle.h.

Constructor & Destructor Documentation

◆ Triangle()

Triangle::Triangle ( const Ogre::Vector3 &  a,
const Ogre::Vector3 &  b,
const Ogre::Vector3 &  c 
)
inlineexplicit

Construct triangle from three given vertices.

Definition at line 39 of file Triangle.h.

Member Function Documentation

◆ normal()

Ogre::Vector3 Triangle::normal ( ) const
inline

Return normal vector of the triangle.

The normal vector has unit length.

Warning
Not thread-safe due to caching implementation!

Definition at line 48 of file Triangle.h.

+ Here is the caller graph for this function:

Field Documentation

◆ a

const Ogre::Vector3 Triangle::a

Vertex a.

Definition at line 59 of file Triangle.h.

◆ b

const Ogre::Vector3 Triangle::b

Vertex b.

Definition at line 60 of file Triangle.h.

◆ c

const Ogre::Vector3 Triangle::c

Vertex c.

Definition at line 61 of file Triangle.h.

◆ m_initialized

bool Triangle::m_initialized
mutableprivate

Definition at line 67 of file Triangle.h.

◆ m_normal

Ogre::Vector3 Triangle::m_normal
mutableprivate

Cached normal vector.

Definition at line 68 of file Triangle.h.

◆ u

const Ogre::Vector3 Triangle::u

Span vector u.

Definition at line 63 of file Triangle.h.

◆ v

const Ogre::Vector3 Triangle::v

Span vector v.

Definition at line 64 of file Triangle.h.


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