Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <Opcode.h>
Public Member Functions | |
inline_ | Point () |
Empty constructor. More... | |
inline_ | Point (float _x, float _y, float _z) |
Constructor from a single float. More... | |
inline_ | Point (const float f[3]) |
Constructor from array. More... | |
inline_ | Point (const Point &p) |
Copy constructor. More... | |
inline_ | ~Point () |
Destructor. More... | |
inline_ Point & | Zero () |
Clears the vector. More... | |
inline_ Point & | SetPlusInfinity () |
inline_ Point & | SetMinusInfinity () |
Point & | PositiveUnitRandomVector () |
Sets positive unit random vector. More... | |
Point & | UnitRandomVector () |
Sets unit random vector. More... | |
inline_ Point & | Set (float _x, float _y, float _z) |
Assignment from values. More... | |
inline_ Point & | Set (const float f[3]) |
Assignment from array. More... | |
inline_ Point & | Set (const Point &src) |
Assignment from another point. More... | |
inline_ Point & | Add (const Point &p) |
Adds a vector. More... | |
inline_ Point & | Add (float _x, float _y, float _z) |
Adds a vector. More... | |
inline_ Point & | Add (const float f[3]) |
Adds a vector. More... | |
inline_ Point & | Add (const Point &p, const Point &q) |
Adds vectors. More... | |
inline_ Point & | Sub (const Point &p) |
Subtracts a vector. More... | |
inline_ Point & | Sub (float _x, float _y, float _z) |
Subtracts a vector. More... | |
inline_ Point & | Sub (const float f[3]) |
Subtracts a vector. More... | |
inline_ Point & | Sub (const Point &p, const Point &q) |
Subtracts vectors. More... | |
inline_ Point & | Neg () |
this = -this More... | |
inline_ Point & | Neg (const Point &a) |
this = -a More... | |
inline_ Point & | Mult (float s) |
Multiplies by a scalar. More... | |
inline_ Point & | Mult (const Point &a, float scalar) |
this = a * scalar More... | |
inline_ Point & | Mac (const Point &a, const Point &b, float scalar) |
this = a + b * scalar More... | |
inline_ Point & | Mac (const Point &a, float scalar) |
this = this + a * scalar More... | |
inline_ Point & | Msc (const Point &a, const Point &b, float scalar) |
this = a - b * scalar More... | |
inline_ Point & | Msc (const Point &a, float scalar) |
this = this - a * scalar More... | |
inline_ Point & | Mac2 (const Point &a, const Point &b, float scalarb, const Point &c, float scalarc) |
this = a + b * scalarb + c * scalarc More... | |
inline_ Point & | Msc2 (const Point &a, const Point &b, float scalarb, const Point &c, float scalarc) |
this = a - b * scalarb - c * scalarc More... | |
inline_ Point & | Mult (const Matrix3x3 &mat, const Point &a) |
this = mat * a More... | |
inline_ Point & | Mult2 (const Matrix3x3 &mat1, const Point &a1, const Matrix3x3 &mat2, const Point &a2) |
this = mat1 * a1 + mat2 * a2 More... | |
inline_ Point & | Mac (const Matrix3x3 &mat, const Point &a) |
this = this + mat * a More... | |
inline_ Point & | TransMult (const Matrix3x3 &mat, const Point &a) |
this = transpose(mat) * a More... | |
inline_ Point & | Lerp (const Point &a, const Point &b, float t) |
Linear interpolate between two vectors: this = a + t * (b - a) More... | |
inline_ Point & | Herp (const Point &p0, const Point &p1, const Point &p2, const Point &p3, float t) |
inline_ Point & | Transform (const Point &r, const Matrix3x3 &rotpos, const Point &linpos) |
this = rotpos * r + linpos More... | |
inline_ Point & | InvTransform (const Point &r, const Matrix3x3 &rotpos, const Point &linpos) |
this = trans(rotpos) * (r - linpos) More... | |
inline_ float | Min () const |
Returns MIN(x, y, z);. More... | |
inline_ float | Max () const |
Returns MAX(x, y, z);. More... | |
inline_ Point & | Min (const Point &p) |
Sets each element to be componentwise minimum. More... | |
inline_ Point & | Max (const Point &p) |
Sets each element to be componentwise maximum. More... | |
inline_ Point & | Clamp (float min, float max) |
Clamps each element. More... | |
inline_ float | SquareMagnitude () const |
Computes square magnitude. More... | |
inline_ float | Magnitude () const |
Computes magnitude. More... | |
inline_ float | Volume () const |
Computes volume. More... | |
inline_ bool | ApproxZero () const |
Checks the point is near zero. More... | |
inline_ bool | IsZero () const |
Tests for exact zero vector. More... | |
inline_ bool | IsValid () const |
Checks point validity. More... | |
void | Tweak (udword coord_mask, udword tweak_mask) |
Slighty moves the point. More... | |
inline_ void | TweakBigger () |
Slighty moves the point out. More... | |
inline_ void | TweakSmaller () |
Slighty moves the point in. More... | |
inline_ Point & | Normalize () |
Normalizes the vector. More... | |
inline_ Point & | SetLength (float length) |
Sets vector length. More... | |
inline_ Point & | ClampLength (float limit_length) |
Clamps vector length. More... | |
inline_ float | Distance (const Point &b) const |
Computes distance to another point. More... | |
inline_ float | SquareDistance (const Point &b) const |
Computes square distance to another point. More... | |
inline_ float | Dot (const Point &p) const |
Dot product dp = this|a. More... | |
inline_ Point & | Cross (const Point &a, const Point &b) |
Cross product this = a x b. More... | |
inline_ udword | VectorCode () const |
Vector code ( bitmask = sign(z) | sign(y) | sign(x) ) More... | |
inline_ PointComponent | LargestAxis () const |
Returns largest axis. More... | |
inline_ PointComponent | ClosestAxis () const |
Returns closest axis. More... | |
inline_ PointComponent | SmallestAxis () const |
Returns smallest axis. More... | |
Point & | Refract (const Point &eye, const Point &n, float refractindex, Point &refracted) |
Refracts the point. More... | |
Point & | ProjectToPlane (const Plane &p) |
Projects the point onto a plane. More... | |
void | ProjectToScreen (float halfrenderwidth, float halfrenderheight, const Matrix4x4 &mat, HPoint &projected) const |
Projects the point onto the screen. More... | |
Point & | Unfold (Plane &p, Point &a, Point &b) |
Unfolds the point onto a plane according to edge(a,b) More... | |
inline_ udword | GetHashValue () const |
Hash function from Ville Miettinen. More... | |
void | SetNotUsed () |
Stuff magic values in the point, marking it as explicitely not used. More... | |
bool | IsNotUsed () const |
Checks the point is marked as not used. More... | |
inline_ Point | operator- () const |
Unary operator for Point Negate = - Point. More... | |
inline_ Point | operator+ (const Point &p) const |
Operator for Point Plus = Point + Point. More... | |
inline_ Point | operator- (const Point &p) const |
Operator for Point Minus = Point - Point. More... | |
inline_ Point | operator* (const Point &p) const |
Operator for Point Mul = Point * Point. More... | |
inline_ Point | operator* (float s) const |
Operator for Point Scale = Point * float. More... | |
inline_ Point | operator/ (const Point &p) const |
Operator for Point Div = Point / Point. More... | |
inline_ Point | operator/ (float s) const |
Operator for Point Scale = Point / float. More... | |
inline_ float | operator| (const Point &p) const |
Operator for float DotProd = Point | Point. More... | |
inline_ Point | operator^ (const Point &p) const |
Operator for Point VecProd = Point ^ Point. More... | |
inline_ Point & | operator+= (const Point &p) |
Operator for Point += Point. More... | |
inline_ Point & | operator+= (float s) |
Operator for Point += float. More... | |
inline_ Point & | operator-= (const Point &p) |
Operator for Point -= Point. More... | |
inline_ Point & | operator-= (float s) |
Operator for Point -= float. More... | |
inline_ Point & | operator*= (const Point &p) |
Operator for Point *= Point. More... | |
inline_ Point & | operator*= (float s) |
Operator for Point *= float. More... | |
inline_ Point & | operator/= (const Point &p) |
Operator for Point /= Point. More... | |
inline_ Point & | operator/= (float s) |
Operator for Point /= float. More... | |
inline_ bool | operator== (const Point &p) const |
Operator for "if(Point==Point)". More... | |
inline_ bool | operator!= (const Point &p) const |
Operator for "if(Point!=Point)". More... | |
inline_ Point | operator* (const Matrix3x3 &mat) const |
Operator for Point Mul = Point * Matrix3x3. More... | |
inline_ Point | operator* (const Matrix4x4 &mat) const |
Operator for Point Mul = Point * Matrix4x4. More... | |
inline_ Point & | operator*= (const Matrix3x3 &mat) |
Operator for Point *= Matrix3x3. More... | |
inline_ Point & | operator*= (const Matrix4x4 &mat) |
Operator for Point *= Matrix4x4. More... | |
operator HPoint () const | |
Cast a Point to a HPoint. w is set to zero. More... | |
inline_ float | operator[] (int n) const |
inline_ float & | operator[] (int n) |
Public Attributes | |
float | x |
float | y |
float | z |
Friends | |
inline_ friend Point | operator* (float s, const Point &p) |
Operator for Point Scale = float * Point. More... | |
inline_ friend Point | operator/ (float s, const Point &p) |
Operator for Point Scale = float / Point. More... | |
|
inline |
Empty constructor.
Definition at line 31 of file Opcode.h.
Referenced by Opcode::HPoint::operator*().
|
inline |
this = trans(rotpos) * (r - linpos)
Definition at line 185 of file IcePoint.cpp.
References Opcode::Matrix3x3::m, x, y, and z.
bool Point::IsNotUsed | ( | ) | const |
|
inline |
this = this + mat * a
Definition at line 161 of file IcePoint.cpp.
References Opcode::Matrix3x3::m, x, y, and z.
Returns MAX(x, y, z);.
Definition at line 202 of file Opcode.h.
Referenced by Opcode::OPComputeMinMax(), and OPComputeMinMax().
Returns MIN(x, y, z);.
Definition at line 200 of file Opcode.h.
Referenced by Opcode::OPComputeMinMax(), and OPComputeMinMax().
this = mat * a
Definition at line 145 of file IcePoint.cpp.
References Opcode::Matrix3x3::m, x, y, and z.
Point & Point::Mult2 | ( | const Matrix3x3 & | mat1, |
const Point & | a1, | ||
const Matrix3x3 & | mat2, | ||
const Point & | a2 | ||
) |
this = mat1 * a1 + mat2 * a2
Definition at line 153 of file IcePoint.cpp.
References Opcode::Matrix3x3::m, x, y, and z.
Normalizes the vector.
Definition at line 270 of file Opcode.h.
Referenced by Opcode::Triangle::Inflate().
Point::operator HPoint | ( | ) | const |
Point & Point::PositiveUnitRandomVector | ( | ) |
Sets positive unit random vector.
Creates a positive unit random vector.
Definition at line 60 of file IcePoint.cpp.
Projects the point onto a plane.
Definition at line 110 of file IcePoint.cpp.
References Opcode::Plane::d, and Opcode::Plane::n.
void Point::ProjectToScreen | ( | float | halfrenderwidth, |
float | halfrenderheight, | ||
const Matrix4x4 & | mat, | ||
HPoint & | projected | ||
) | const |
Projects the point onto the screen.
Definition at line 116 of file IcePoint.cpp.
References f, Opcode::HPoint::w, x, y, and z.
Point & Point::Refract | ( | const Point & | eye, |
const Point & | n, | ||
float | refractindex, | ||
Point & | refracted | ||
) |
void Point::SetNotUsed | ( | ) |
Stuff magic values in the point, marking it as explicitely not used.
Definition at line 129 of file IcePoint.cpp.
|
inline |
Computes square magnitude.
Definition at line 218 of file Opcode.h.
Referenced by Opcode::Ray::SquareDistance(), and Opcode::Segment::SquareDistance().
this = rotpos * r + linpos
Definition at line 177 of file IcePoint.cpp.
References Opcode::Matrix3x3::m, x, y, and z.
this = transpose(mat) * a
Definition at line 169 of file IcePoint.cpp.
References Opcode::Matrix3x3::m, x, y, and z.
|
inline |
|
inline |
Unfolds the point onto a plane according to edge(a,b)
Point & Point::UnitRandomVector | ( | ) |
Sets unit random vector.
Creates a unit random vector.
Definition at line 75 of file IcePoint.cpp.
float Opcode::Point::x |
Definition at line 523 of file Opcode.h.
Referenced by ContinuousTerrain::Collide(), csVector3::Cross(), Unit::InsideCollideTree(), InvTransform(), IsNotUsed(), Mac(), Mult(), Mult2(), Opcode::OPComputeMinMax(), OPComputeMinMax(), Opcode::HPoint::operator*(), Opcode::HPoint::operator*=(), ProjectToScreen(), Refract(), SetNotUsed(), Transform(), and TransMult().
float Opcode::Point::y |
Definition at line 523 of file Opcode.h.
Referenced by ContinuousTerrain::Collide(), csVector3::Cross(), Unit::InsideCollideTree(), InvTransform(), IsNotUsed(), Mac(), Mult(), Mult2(), Opcode::OPComputeMinMax(), OPComputeMinMax(), Opcode::HPoint::operator*(), Opcode::HPoint::operator*=(), ProjectToScreen(), Refract(), SetNotUsed(), Transform(), and TransMult().
float Opcode::Point::z |
Definition at line 523 of file Opcode.h.
Referenced by ContinuousTerrain::Collide(), csVector3::Cross(), Unit::InsideCollideTree(), InvTransform(), IsNotUsed(), Mac(), Mult(), Mult2(), Opcode::OPComputeMinMax(), OPComputeMinMax(), Opcode::HPoint::operator*(), Opcode::HPoint::operator*=(), ProjectToScreen(), Refract(), SetNotUsed(), Transform(), and TransMult().