GL Studio C++ Runtime API
VertexNoColor Class Reference

#include <vertex.h>

Inheritance diagram for VertexNoColor:
PreciseVertex Vertex

Public Member Functions

 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

The Vertex class: Implements a 3D cartesian coordianate and operations for manipulating them.

Constructor & Destructor Documentation

VertexNoColor ( )
inline

Simple constructor. Ensures all values are initialized

VertexNoColor ( 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

Member Function Documentation

float AngleToVector ( const VertexNoColor arg) const

Returns the angle (in radians) between this vector and the argument vect.

Parameters
argSecond vector
Returns
The resulting angle (in radians)
bool CloseTo ( const VertexNoColor arg,
float  tolerance = 0.0001f 
) const

Returns true if this vertex is within the radius specified by tolerance

Parameters
argvertex to compare with
tolerancethe tolerance value
Returns
true if this point within the tolerance
VertexNoColor 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)
float Distance2 ( const VertexNoColor v) const
inline

Compute cartesian distance between this point and another one , in 2D

Parameters
vThe vertex to compute distance to
Returns
The distance between the two points
float Distance2Squared ( const VertexNoColor v) const
inline

Compute the square of the cartesian distance between this point and another one , in 2D

Parameters
vThe vertex to compute distance squared to
Returns
The square of the distance between the two points
float Distance3 ( const VertexNoColor v) const
inline

Compute cartesian distance between this point and another one , in 3D

Parameters
vThe vertex to compute distance to.
Returns
The distance between the two points
float Distance3Squared ( const VertexNoColor v) const
inline

Compute the square of the cartesian distance between this point and another one , in 3D

Parameters
vThe vertex to compute distance squared to
Returns
The square of the distance between the two points
float DistanceFromLine ( const VertexNoColor start,
const VertexNoColor direction 
) const

Returns the distance of this point from the line defined by start and direction

Parameters
startStarting point of the line
directionNormalized direction vector for the line
float DistanceFromLineSquared ( const float  startx,
const float  starty,
const float  startz,
const VertexNoColor direction 
) const
inline

Returns the squared distance of this point from the line defined by start and direction, in 3D

Parameters
startxstarting x coordinate of the line.
startystarting y coordinate of the line.
startzstarting z coordinate of the line.
directionNormalized direction vector for the line.
Returns
the distance from this point.
float DotProduct ( const VertexNoColor w) const
inline

Returns the vector dot-product of this vector with the argument vector

Parameters
wSecond vector
Returns
The resulting dot-product (scalar)
float Magnitude ( ) const
inline

Returns the magnitude of the vector

Returns
The resulting scalar
float MagnitudeSquared ( ) const
inline

Returns the magnitude of the vector squared

Returns
The resulting scalar
void Normalize ( void  )
inline

Normalizes the vector into a unit vector

bool operator!= ( const VertexNoColor arg) const
inline

Determines if the vertex is identical to the supplied vertex, ignoring color

Parameters
argvertex to compare to
Returns
TRUE if equal, else FALSE
VertexNoColor 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
VertexNoColor operator* ( const VertexNoColor arg) const
inline

Computes the result of muliplying this point to another one.

Parameters
argvertex to multiple with
Returns
resulting vertex
VertexNoColor& operator*= ( const float  s)
inline

Compute the result of multiplying this point by a scalar

Parameters
sThe Scalar to multiply by
Returns
V = V * s
VertexNoColor 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
VertexNoColor& operator+= ( const VertexNoColor arg)
inline

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

Parameters
argThe vertex to add to this one
Returns
V = V + arg
VertexNoColor operator- ( ) const
inline

Negation operator

VertexNoColor 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
VertexNoColor& operator-= ( const VertexNoColor arg)
inline

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

Parameters
argThe vertex to subtract from this one
Returns
V = V - arg
VertexNoColor operator/ ( const float  s) const
inline

Compute the result of dividing this point by a scalar

Parameters
sThe Scalar to divide by
Returns
A new vertex V2 where V2 = this / s
VertexNoColor& operator/= ( const float  s)
inline

Compute the result of dividing this point by a scalar

Parameters
sThe Scalar to divide by
Returns
V = V / s
bool operator== ( const VertexNoColor arg) const
inline

Determines if the vertex is identical to the supplied vertex, ignoring color

Parameters
argvertex to compare to
Returns
TRUE if equal, else FALSE
bool PointInTriangle ( const VertexNoColor a,
const VertexNoColor b,
const VertexNoColor c 
) const
inline

Returns true if this vertex is in the given triangle specified by abc

Parameters
aFirst triangle vertex
bSecond triangle vertex
cThird triangle vertex
Returns
true if this point is inside the triangle, false otherwise
VertexNoColor ProjectPointToLine ( const VertexNoColor origin,
const VertexNoColor direction 
) const

Returns the projection of this point onto the line defined by origin and direction

Parameters
originStarting point of the line
directionNormalized direction vector for the line
VertexNoColor Rotate ( const float  angle) const

Rotate this point in 2D clockwise around the z axis.

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

Rotate this point around a different point in 2D counter-clockwise around the z axis.

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

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

Parameters
origThe rotation origin to rotate around.
angleThe angle to rotate around, in degrees.
axisThe axis to rotate around. See RotationAxis enum.
Returns
The rotated vertex
VertexNoColor Rotate ( const VertexNoColor orig,
const float  angle,
const Vector r 
) const

Rotate this vertex by angle theta counter-clockwise around an arbitrary axis r.

Parameters
origThe rotation origin to rotate around.
angleThe angle to rotate around, in degrees.
rThe axis to rotate around.
Returns
The rotated vertex

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