|
GL Studio C++ Runtime API
|
#include <vertex.h>
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 |
| VertexNoColor & | operator*= (const float s) |
| VertexNoColor | operator/ (const float s) const |
| VertexNoColor & | operator/= (const float s) |
| VertexNoColor & | operator+= (const VertexNoColor &arg) |
| VertexNoColor | operator- (const VertexNoColor &arg) const |
| VertexNoColor & | operator-= (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 () |
| 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 |
Public Attributes | |
| float | x |
| The X component. | |
| float | y |
| The Y component. | |
| float | z |
| The Z component. | |
The Vertex class: Implements a 3D cartesian coordianate and operations for manipulating them.
|
inline |
Simple constructor. Ensures all values are initialized
|
inline |
Position only constructor. Color values are set to defaults
| _x | The X value of the vertex, in logical units |
| _y | The Y value of the vertex, in logical units |
| _z | The Z value of the vertex, in logical units |
| float AngleToVector | ( | const VertexNoColor & | arg | ) | const |
Returns the angle (in radians) between this vector and the argument vect.
| arg | Second vector |
| bool CloseTo | ( | const VertexNoColor & | arg, |
| float | tolerance = 0.0001f |
||
| ) | const |
Returns true if this vertex is within the radius specified by tolerance
| arg | vertex to compare with |
| tolerance | the tolerance value |
|
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.
| w | Second vector |
|
inline |
Compute cartesian distance between this point and another one , in 2D
| v | The vertex to compute distance to |
|
inline |
Compute the square of the cartesian distance between this point and another one , in 2D
| v | The vertex to compute distance squared to |
|
inline |
Compute cartesian distance between this point and another one , in 3D
| v | The vertex to compute distance to. |
|
inline |
Compute the square of the cartesian distance between this point and another one , in 3D
| v | The vertex to compute distance squared to |
| float DistanceFromLine | ( | const VertexNoColor & | start, |
| const VertexNoColor & | direction | ||
| ) | const |
| start | Starting point of the line. |
| direction | Normalized direction vector for the line. |
|
inline |
Returns the squared distance of this point from the line defined by start and direction, in 3D
| startx | starting x coordinate of the line. |
| starty | starting y coordinate of the line. |
| startz | starting z coordinate of the line. |
| direction | Normalized direction vector for the line. |
|
inline |
Returns the vector dot-product of this vector with the argument vector
| w | Second vector |
|
inline |
Returns the magnitude of the vector
|
inline |
Returns the magnitude of the vector squared
|
inline |
Normalizes the vector into a unit vector
|
inline |
Determines if the vertex is identical to the supplied vertex, ignoring color
| arg | vertex to compare to |
|
inline |
Compute the result of multiplying this point by a scalar
| s | The Scalar to multiply by |
|
inline |
Computes the result of muliplying this point to another one.
| arg | vertex to multiple with |
|
inline |
Compute the result of multiplying this point by a scalar
| s | The Scalar to multiply by |
|
inline |
Compute the result of adding this point to another one, in 3D
| arg | The vertex to add to this one |
|
inline |
Compute the result of adding this point to another one, in 3D
| arg | The vertex to add to this one |
|
inline |
Negation operator.
|
inline |
Compute the result of subtracting this point from another one, in 3D
| arg | The vertex to subtract from this one |
|
inline |
Compute the result of subtracting this point from another one, in 3D
| arg | The vertex to subtract from this one |
|
inline |
Compute the result of dividing this point by a scalar
| s | The Scalar to divide by |
|
inline |
Compute the result of dividing this point by a scalar
| s | The Scalar to divide by |
|
inline |
Determines if the vertex is identical to the supplied vertex, ignoring color
| arg | vertex to compare to |
|
inline |
Returns true if this vertex is in the given triangle specified by abc
| a | First triangle vertex |
| b | Second triangle vertex |
| c | Third triangle vertex |
| VertexNoColor ProjectPointToLine | ( | const VertexNoColor & | origin, |
| const VertexNoColor & | direction | ||
| ) | const |
| origin | Starting point of the line. |
| direction | Normalized direction vector for the line. |
| VertexNoColor Rotate | ( | const float | angle | ) | const |
Rotate this point in 2D clockwise around the z axis.
| angle | The angle to rotate around, in degrees. |
| VertexNoColor Rotate | ( | const VertexNoColor & | orig, |
| const float | angle | ||
| ) | const |
Rotate this point around a different point in 2D counter-clockwise around the z axis.
| orig | The rotation origin to rotate around. |
| angle | The angle to rotate around, in degrees. |
| 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.
| orig | The rotation origin to rotate around. |
| angle | The angle to rotate around, in degrees. |
| axis | The axis to rotate around. See RotationAxis enum. |
| 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.
| orig | The rotation origin to rotate around. |
| angle | The angle to rotate around, in degrees. |
| r | The axis to rotate around. |