SuperTuxKart
Loading...
Searching...
No Matches
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.
 
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.
 
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.
 
const Vec3operator[] (int i) const
 Returns the i-th.
 
const Vec3getCenter () const
 Returns the center of a quad.
 
void setQuad (const Vec3 &p0, const Vec3 &p1, const Vec3 &p2, const Vec3 &p3)
 Set new quad coordinates.
 
void setHeightTesting (float min, float max)
 
float getMinHeight () const
 Returns the minimum height of a quad.
 
int getIndex () const
 Returns the index of this quad.
 
bool isInvisible () const
 Returns true of this quad is invisible, i.e.
 
bool isIgnored () const
 
const Vec3getNormal () const
 Returns the normal of this quad.
 
virtual bool pointInside (const Vec3 &p, bool ignore_vertical=false) const
 Returns true if a point is inside this quad.
 
virtual bool is3DQuad () const
 Returns true if this quad is 3D, which additional 3D testing is used in pointInside.
 
virtual float getDistance2FromPoint (const Vec3 &xyz) const
 

Protected Attributes

Vec3 m_p [4]
 The four points of a quad.
 
Vec3 m_center
 The center of all four points, which is used by the AI.
 
int m_index
 Index of this quad, used only with graph.
 
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.
 
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.
 
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.
 
float m_max_height_testing
 

Member Function Documentation

◆ getDistance2FromPoint()

virtual float Quad::getDistance2FromPoint ( const Vec3 xyz) const
inlinevirtual

Reimplemented in ArenaNode, DriveNode2D, and DriveNode3D.

◆ 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 ArenaNode3D, and DriveNode3D.

◆ 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 ArenaNode3D, and DriveNode3D.

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


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