SuperTuxKart
Public Member Functions | Protected Attributes | Private Attributes | List of all members
Quad Class Reference
Inheritance diagram for Quad:
Inheritance graph
[legend]

Public Member Functions

 Quad (const Vec3 &p0, const Vec3 &p1, const Vec3 &p2, const Vec3 &p3, const Vec3 &normal=Vec3(0, 1, 0), int index=-1, bool invisible=false, bool ignored=false)
 Constructor, takes 4 points. More...
 
void getVertices (video::S3DVertex *v, const video::SColor &color) const
 Sets the vertices in a irrlicht vertex array to the 4 points of this quad. More...
 
void getSPMVertices (video::S3DVertexSkinnedMesh *v, const video::SColor &color) const
 Sets the vertices in an spm vertex array to the 4 points of this quad. More...
 
const Vec3operator[] (int i) const
 Returns the i-th. More...
 
const Vec3getCenter () const
 Returns the center of a quad. More...
 
void setQuad (const Vec3 &p0, const Vec3 &p1, const Vec3 &p2, const Vec3 &p3)
 Set new quad coordinates. More...
 
void setHeightTesting (float min, float max)
 
float getMinHeight () const
 Returns the minimum height of a quad. More...
 
int getIndex () const
 Returns the index of this quad. More...
 
bool isInvisible () const
 Returns true of this quad is invisible, i.e. More...
 
bool isIgnored () const
 
const Vec3getNormal () const
 Returns the normal of this quad. More...
 
virtual bool pointInside (const Vec3 &p, bool ignore_vertical=false) const
 Returns true if a point is inside this quad. More...
 
virtual bool is3DQuad () const
 Returns true if this quad is 3D, which additional 3D testing is used in pointInside. More...
 
virtual float getDistance2FromPoint (const Vec3 &xyz) const
 

Protected Attributes

Vec3 m_p [4]
 The four points of a quad. More...
 
Vec3 m_center
 The center of all four points, which is used by the AI. More...
 
int m_index
 Index of this quad, used only with graph. More...
 
Vec3 m_normal
 Normal of the quad.
 

Private Attributes

bool m_invisible
 Set to true if this quad should not be shown in the minimap. More...
 
bool m_is_ignored
 
float m_min_height
 The minimum height of the quad, used in case that several quads are on top of each other when determining the sector a kart is on. More...
 
float m_min_height_testing
 
float m_max_height
 The maximum height of the quad, used together with m_min_height to distinguish between quads which are on top of each other. More...
 
float m_max_height_testing
 

Constructor & Destructor Documentation

◆ Quad()

Quad::Quad ( const Vec3 p0,
const Vec3 p1,
const Vec3 p2,
const Vec3 p3,
const Vec3 normal = Vec3(0, 1, 0),
int  index = -1,
bool  invisible = false,
bool  ignored = false 
)

Constructor, takes 4 points.

Member Function Documentation

◆ getCenter()

const Vec3& Quad::getCenter ( ) const
inline

Returns the center of a quad.

◆ getIndex()

int Quad::getIndex ( ) const
inline

Returns the index of this quad.

◆ getMinHeight()

float Quad::getMinHeight ( ) const
inline

Returns the minimum height of a quad.

◆ getNormal()

const Vec3& Quad::getNormal ( ) const
inline

Returns the normal of this quad.

◆ getSPMVertices()

void Quad::getSPMVertices ( video::S3DVertexSkinnedMesh *  v,
const video::SColor &  color 
) const

Sets the vertices in an spm vertex array to the 4 points of this quad.

Parameters
vThe vertex array in which to set the vertices.
colorThe color to use for this quad.

◆ getVertices()

void Quad::getVertices ( video::S3DVertex *  v,
const video::SColor &  color 
) const

Sets the vertices in a irrlicht vertex array to the 4 points of this quad.

Parameters
vThe vertex array in which to set the vertices.
colorThe color to use for this quad.

◆ is3DQuad()

virtual bool Quad::is3DQuad ( ) const
inlinevirtual

Returns true if this quad is 3D, which additional 3D testing is used in pointInside.

Reimplemented in DriveNode3D, and ArenaNode3D.

◆ isInvisible()

bool Quad::isInvisible ( ) const
inline

Returns true of this quad is invisible, i.e.

not to be shown in the minimap.

◆ operator[]()

const Vec3& Quad::operator[] ( int  i) const
inline

Returns the i-th.

point of a quad.

◆ pointInside()

bool Quad::pointInside ( const Vec3 p,
bool  ignore_vertical = false 
) const
virtual

Returns true if a point is inside this quad.

Reimplemented in DriveNode3D, and ArenaNode3D.

◆ setQuad()

void Quad::setQuad ( const Vec3 p0,
const Vec3 p1,
const Vec3 p2,
const Vec3 p3 
)

Set new quad coordinates.

Takes 4 points.

Member Data Documentation

◆ m_center

Vec3 Quad::m_center
protected

The center of all four points, which is used by the AI.

This saves some computations at runtime.

◆ m_index

int Quad::m_index
protected

Index of this quad, used only with graph.

◆ m_invisible

bool Quad::m_invisible
private

Set to true if this quad should not be shown in the minimap.

◆ m_max_height

float Quad::m_max_height
private

The maximum height of the quad, used together with m_min_height to distinguish between quads which are on top of each other.

◆ m_min_height

float Quad::m_min_height
private

The minimum height of the quad, used in case that several quads are on top of each other when determining the sector a kart is on.

◆ m_p

Vec3 Quad::m_p[4]
protected

The four points of a quad.


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