GL Studio C++ Runtime API
Vertex Class Reference

#include <vertex.h>

Inheritance diagram for Vertex:
VertexNoColor

Public Member Functions

 Vertex ()
 
 Vertex (const VertexNoColor &noColor)
 
 Vertex (const VertexNoColor &noColor, const GlsColor &_color)
 
 Vertex (float _x, float _y, float _z)
 
 Vertex (float _x, float _y, float _z, unsigned char _r, unsigned char _g, unsigned char _b, unsigned char _a)
 
 Vertex (float _x, float _y, float _z, const GlsColor &_color)
 
Vertex operator+ (const VertexNoColor &arg) const
 
Vertex operator* (const float s) const
 
Vertex Rotate (const float angle) const
 
Vertex Rotate (const VertexNoColor &orig, const float angle) const
 
Vertex Rotate (const VertexNoColor &orig, const float angle, const int axis) const
 
Vertex Rotate (const VertexNoColor &orig, const float theta, const Vector &r) const
 
Vertex operator- (const VertexNoColor &arg) const
 
Vertex operator- () const
 
Vertex operator* (const VertexNoColor &arg) const
 
Vertex CrossProduct (const VertexNoColor &w) const
 
- Public Member Functions inherited from VertexNoColor
 VertexNoColor ()
 
 VertexNoColor (float _x, float _y, float _z)
 
float Distance3Squared (const VertexNoColor &v) const
 
float DistanceFromLineSquared (const float startx, const float starty, const float startz, const VertexNoColor &direction) const
 
float Distance3 (const VertexNoColor &v) const
 
float Distance2Squared (const VertexNoColor &v) const
 
float Distance2 (const VertexNoColor &v) const
 
VertexNoColor operator+ (const VertexNoColor &arg) const
 
VertexNoColor operator- () const
 
VertexNoColor operator* (const float s) const
 
VertexNoColoroperator*= (const float s)
 
VertexNoColor operator/ (const float s) const
 
VertexNoColoroperator/= (const float s)
 
VertexNoColoroperator+= (const VertexNoColor &arg)
 
VertexNoColor operator- (const VertexNoColor &arg) const
 
VertexNoColoroperator-= (const VertexNoColor &arg)
 
bool operator== (const VertexNoColor &arg) const
 
bool operator!= (const VertexNoColor &arg) const
 
VertexNoColor operator* (const VertexNoColor &arg) const
 
VertexNoColor Rotate (const float angle) const
 
VertexNoColor Rotate (const VertexNoColor &orig, const float angle) const
 
VertexNoColor Rotate (const VertexNoColor &orig, const float angle, const int axis) const
 
VertexNoColor Rotate (const VertexNoColor &orig, const float angle, const Vector &r) const
 
void Normalize (void)
 
float Magnitude () const
 
float MagnitudeSquared () const
 
VertexNoColor CrossProduct (const VertexNoColor &w) const
 
float DotProduct (const VertexNoColor &w) const
 
float AngleToVector (const VertexNoColor &arg) const
 
bool PointInTriangle (const VertexNoColor &a, const VertexNoColor &b, const VertexNoColor &c) const
 
bool CloseTo (const VertexNoColor &arg, float tolerance=0.0001f) const
 
float DistanceFromLine (const VertexNoColor &start, const VertexNoColor &direction) const
 
VertexNoColor ProjectPointToLine (const VertexNoColor &origin, const VertexNoColor &direction) const
 

Detailed Description

A 3D coordinate in space with an RGBA color value

Constructor & Destructor Documentation

Vertex ( )
inline

Simple constructor. Ensures all values are initialized

Vertex ( const VertexNoColor noColor)
inline

Just add the default color constructor

Vertex ( const VertexNoColor noColor,
const GlsColor _color 
)
inline

Just add the color constructor

Vertex ( float  _x,
float  _y,
float  _z 
)
inline

Position only constructor. Color values are set to defaults

Parameters
_xThe X value of the vertex, in logical units
_yThe Y value of the vertex, in logical units
_zThe Z value of the vertex, in logical units
Vertex ( float  _x,
float  _y,
float  _z,
unsigned char  _r,
unsigned char  _g,
unsigned char  _b,
unsigned char  _a 
)
inline

Position only constructor. Color values are set to defaults

Parameters
_xThe X value of the vertex, in logical units
_yThe Y value of the vertex, in logical units
_zThe Z value of the vertex, in logical units
_rThe R value of the color of the vertex 0-255
_gThe G value of the color of the vertex 0-255
_bThe B value of the color of the vertex 0-255
_aThe A value of the color of the vertex 0-255
Vertex ( float  _x,
float  _y,
float  _z,
const GlsColor _color 
)
inline

Position only constructor. Color values are set to defaults

Parameters
_xThe X value of the vertex, in logical units
_yThe Y value of the vertex, in logical units
_zThe Z value of the vertex, in logical units
_colorThe value of the color of the vertex

Member Function Documentation

Vertex CrossProduct ( const VertexNoColor w) const
inline

Returns the vector cross-product of this vector with the argument vector HS Algebra review: vector cross-product is the vector that is perpendicular to the two given vectors.

Parameters
wSecond vector
Returns
The resulting cross-product (vector)
Vertex operator* ( const float  s) const
inline

Compute the result of multiplying this point by a scalar

Parameters
sThe Scalar to multiply by
Returns
A new vertex V2 where V2 = this * s
Vertex operator* ( const VertexNoColor arg) const
inline

Computes the result of muliplying this point to another one.

Parameters
argvertex to multiple with
Returns
resulting vertex
Vertex operator+ ( const VertexNoColor arg) const
inline

Compute the result of adding this point to another one, in 3D

Parameters
argThe vertex to add to this one
Returns
A new vertex V2 where V2 = this + v
Vertex operator- ( const VertexNoColor arg) const
inline

Compute the result of subtracting this point from another one, in 3D

Parameters
argThe vertex to subtract from this one
Returns
A new vertex V2 where V2 = this - v
Vertex operator- ( ) const
inline

Negation operator

Vertex Rotate ( const float  angle) const

Rotate this point in 2D around the z axis

Parameters
angleThe angle to rotate around, in degrees.
Returns
The rotated vertex
Vertex Rotate ( const VertexNoColor orig,
const float  angle 
) const

Rotate this point around a different point in 2D around the z axis

Parameters
origThe rotation origin to rotate around.
angleThe angle to rotate around, in degrees.
Returns
The rotated vertex
Vertex Rotate ( const VertexNoColor orig,
const float  angle,
const int  axis 
) const

Rotate this point around a different point in 2D around the z axis

Parameters
origThe rotation origin to rotate around.
angleThe angle to rotate around, in degrees.
axisThe axis to rotate 180 degrees around. x = 1, y = 2, z = 3.
Returns
The rotated vertex
Vertex Rotate ( const VertexNoColor orig,
const float  theta,
const Vector r 
) const

Rotate this vertex by angle theta around an arbitrary axis r Return the rotated point. Positive angles are anticlockwise looking down the axis towards the origin.


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