| GL Studio C++ Runtime API

Public Member Functions | Public Attributes | List of all members
Vertex Class Reference

`#include <vertex.h>`

Inheritance diagram for Vertex:

## Public Member Functions
| Vertex ()
| Simple constructor. Ensures all values are initialized.
| 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
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
GlsColor | color
| The RGBA color component.
Public Attributes inherited from VertexNoColor
float | x
| The X component.
float | y
| The Y component.
float | z
| The Z component.

## Detailed Description

A 3D coordinate in space with an RGBA color value

## Constructor & Destructor Documentation

## ◆ Vertex() [1/5]

Vertex | ( | const VertexNoColor & | noColor | ) |
| inline

Constructor, from VertexNoColor.

Parameters

  noColor | The object to copy from.

## ◆ Vertex() [2/5]

Vertex | ( | const VertexNoColor & | noColor,
|  | const GlsColor & | _color
| ) |  |
| inline

Constructor, from VertexNoColor and a GlsColor.

Parameters

  noColor | The object to copy from.
  _color | The color to use.

## ◆ Vertex() [3/5]

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

Position only constructor. Color values are set to defaults

Parameters

  _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

## ◆ Vertex() [4/5]

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

  _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
  _r | The R value of the color of the vertex 0-255
  _g | The G value of the color of the vertex 0-255
  _b | The B value of the color of the vertex 0-255
  _a | The A value of the color of the vertex 0-255

## ◆ Vertex() [5/5]

Vertex | ( | float | _x,
|  | float | _y,
|  | float | _z,
|  | const GlsColor & | _color
| ) |  |
| inline

Position only constructor. Color values are set to defaults

Parameters

  _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
  _color | The value of the color of the vertex

## Member Function Documentation

## ◆ CrossProduct()

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

  w | Second vector

Returns
  The resulting cross-product (vector)

## ◆ operator*() [1/2]

Vertex operator* | ( | const float | s | ) | const
| inline

Compute the result of multiplying this point by a scalar

Parameters

  s | The Scalar to multiply by

Returns
  A new vertex V2 where V2 = this * s

## ◆ operator*() [2/2]

Vertex operator* | ( | const VertexNoColor & | arg | ) | const
| inline

Computes the result of muliplying this point to another one.

Parameters

  arg | vertex to multiple with

Returns
  resulting vertex

## ◆ operator+()

Vertex operator+ | ( | const VertexNoColor & | arg | ) | const
| inline

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

Parameters

  arg | The vertex to add to this one

Returns
  A new vertex V2 where V2 = this + v

## ◆ operator-() [1/2]

Vertex operator- | ( |  | ) | const
| inline

Negation operator.

Returns
  The negated vertex, all items multiplied by -1.

## ◆ operator-() [2/2]

Vertex operator- | ( | const VertexNoColor & | arg | ) | const
| inline

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

Parameters

  arg | The vertex to subtract from this one

Returns
  A new vertex V2 where V2 = this - v

## ◆ Rotate() [1/4]

Vertex Rotate | ( | const float | angle | ) | const

Rotate this point in 2D around the z axis

Parameters

  angle | The angle to rotate around, in degrees.

Returns
  The rotated vertex

## ◆ Rotate() [2/4]

Vertex Rotate | ( | const VertexNoColor & | orig,
|  | const float | angle
| ) |  | const

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

Parameters

  orig | The rotation origin to rotate around.
  angle | The angle to rotate around, in degrees.

Returns
  The rotated vertex

## ◆ Rotate() [3/4]

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

  orig | The rotation origin to rotate around.
  angle | The angle to rotate around, in degrees.
  axis | The axis to rotate 180 degrees around. x = 1, y = 2, z = 3.

Returns
  The rotated vertex.

## ◆ Rotate() [4/4]

Vertex Rotate | ( | const VertexNoColor & | orig,
|  | const float | theta,
|  | const Vector & | r
| ) |  | const

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

Parameters

  orig | The rotation origin to rotate around.
  theta | The angle to rotate by, in degrees.
  r | The arbitrary axis to rotate around.

Returns
  The rotated point.

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

- vertex.h