#include <vppoint4d.h>
Inheritance diagram for VPPoint4D:
Public Member Functions | |
VPPoint4D () | |
Creates the (0,0,0,1) point. | |
VPPoint4D (const VPPoint4D &point) | |
VPPoint4D (const VPVertex3D &v) | |
VPPoint4D (const VPVector3D &v) | |
VPPoint4D (const VPPoint3D &p) | |
VPPoint4D (double x, double y, double z, double w=1.0) | |
VPPoint4D | operator- () const |
bool | operator== (const VPPoint4D &point) const |
bool | operator!= (const VPPoint4D &point) const |
void | operator= (const VPPoint4D &point) |
void | operator= (const VPVertex3D &v) |
void | operator= (const VPVector3D &v) |
void | operator= (const VPPoint3D &p) |
bool | operator< (const VPPoint4D &p) const |
Checks whether a point is "less then" other. | |
bool | LexicographicalLess (const VPPoint4D &p) const |
Verifies whether a point is less than other by looking at coordinates in lexicographical (x, y, z then w) order. | |
bool | XThenZLess (const VPPoint4D &p) const |
Verifies whether a point is less then other by looking at coordinates X, then Z only. | |
VPPoint4D | operator+ (const VPPoint4D &vector) const |
Addition for point and vector (or vice versa). | |
void | operator+= (const VPPoint4D &vector) |
VPPoint4D | operator- (const VPPoint4D &point) const |
Subtraction of two points. | |
VPPoint4D | operator * (double escalar) const |
void | operator *= (double escalar) |
double | GetX () const |
double | GetY () const |
double | GetZ () const |
double | GetW () const |
const double * | VetXYZW () const |
This method is usefull to pass to glVertex4dv(). | |
double | DotProduct (const VPPoint4D &p) const |
Computes the dot product between "this" and "p". | |
double | AngleTo (const VPPoint4D &p) const |
Computes the angle up to p. | |
VPPoint4D | CrossProduct (const VPPoint4D &p) const |
Computes the cross product between "this" and "p". | |
void | SetX (double x) |
void | SetY (double y) |
void | SetZ (double z) |
void | SetW (double w) |
void | SetXYZW (double x, double y, double z, double w) |
void | Normalize () |
Normalizes the point/vector. | |
double | Length () const |
Static Public Member Functions | |
static const VPPoint4D & | DOWN () |
The (0,-1,0,0) vector. | |
static const VPPoint4D & | ORIGIN () |
The (0,0,0,1) point. | |
static const VPPoint4D & | X () |
The X vector (1,0,0,0). | |
static const VPPoint4D & | Y () |
The Y vector (0,1,0,0). | |
static const VPPoint4D & | Z () |
The Z vector (0,0,1,0). | |
Static Public Attributes | |
static tCompareOper | operatorLess = &VPPoint4D::LexicographicalLess |
Points to the operator to use within operator<. | |
Friends | |
std::ostream & | operator<< (std::ostream &output, const VPPoint4D &p) |
Output operator. |
The VPPoint4D class provides a unified way of representing point and vectors objects, easing operations between these "two" kinds of entities along with integration with the VPTransform class. A 4D is homogeneous point represented by a vector (x,y,z,w). W coordinate is 0 for vectors and 1 for normalized points. This class has been created long after the VPPoint3D and VPVector3D classes, wich are used by (at this point) all other classes. It is recommended that this class slowly substitutes the other two.
Definition at line 26 of file vppoint4d.h.
|
Creates the (0,0,0,1) point.
Definition at line 28 of file vppoint4d.cpp. Referenced by CrossProduct(), operator *(), and operator-(). |
|
Definition at line 34 of file vppoint4d.cpp. References vetCoord. |
|
Definition at line 42 of file vppoint4d.cpp. References VPPoint3D::vpGetX(), VPPoint3D::vpGetY(), and VPPoint3D::vpGetZ(). |
|
Definition at line 58 of file vppoint4d.cpp. References VPPoint3D::vpGetX(), VPPoint3D::vpGetY(), and VPPoint3D::vpGetZ(). |
|
Definition at line 50 of file vppoint4d.cpp. References VPPoint3D::vpGetX(), VPPoint3D::vpGetY(), and VPPoint3D::vpGetZ(). |
|
Definition at line 66 of file vppoint4d.cpp. References SetXYZW(). |
|
Computes the angle up to p. Requires both vectors to be normalized.
Definition at line 148 of file vppoint4d.cpp. Referenced by VPTransform::MakeRotation(). |
|
Computes the cross product between "this" and "p".
Definition at line 143 of file vppoint4d.cpp. References GetX(), GetY(), GetZ(), and VPPoint4D(). Referenced by VPMeshObject::AddFace(), VPMeshObject::ComputeTriangleNormal(), VPCamera::PitchAroundTarget(), and VPCamera::VPCamera(). |
|
Computes the dot product between "this" and "p".
Definition at line 138 of file vppoint4d.cpp. References vetCoord. |
|
The (0,-1,0,0) vector.
Definition at line 90 of file vppoint4d.cpp. |
|
Definition at line 83 of file vppoint4d.h. Referenced by VPTransform::ApplyTo(), VPTransform::operator *(), and operator<<(). |
|
Definition at line 80 of file vppoint4d.h. Referenced by VPTransform::ApplyTo(), VPBoundingBox::ConditionalUpdate(), CrossProduct(), VPCamera::DrawOGL(), VPTransform::MakeRotation(), VPTransform::MakeTranslation(), VPTransform::operator *(), operator<<(), and VPMeshObject::Transform(). |
|
Definition at line 81 of file vppoint4d.h. Referenced by VPTransform::ApplyTo(), VPBoundingBox::ConditionalUpdate(), CrossProduct(), VPCamera::DrawOGL(), VPModifier::GetMax(), VPModifier::GetMin(), VPTransform::MakeRotation(), VPTransform::MakeTranslation(), VPTransform::operator *(), operator<<(), and VPMeshObject::Transform(). |
|
Definition at line 82 of file vppoint4d.h. Referenced by VPTransform::ApplyTo(), VPBoundingBox::ConditionalUpdate(), CrossProduct(), VPCamera::DrawOGL(), VPTransform::MakeRotation(), VPTransform::MakeTranslation(), VPTransform::operator *(), operator<<(), and VPMeshObject::Transform(). |
|
Definition at line 133 of file vppoint4d.cpp. Referenced by Normalize(). |
|
Verifies whether a point is less than other by looking at coordinates in lexicographical (x, y, z then w) order.
Definition at line 266 of file vppoint4d.cpp. References vetCoord. |
|
Normalizes the point/vector. Points are normalized by dividing coordinates by W. Vectors are normalized by having their length changed to 1. Warning: The homogeneous point (0,0,0,0) is neither a point nor a vector and will cause a division by zero! Definition at line 110 of file vppoint4d.cpp. References Length(). Referenced by VPMeshObject::AddFace(), VPMeshObject::ComputeTriangleNormal(), VPTransform::MakeRotation(), VPCamera::MoveForward(), VPCamera::MoveSideways(), VPCamera::MoveUp(), VPCamera::PitchAroundTarget(), VPDof::Transform(), and VPCamera::VPCamera(). |
|
Definition at line 197 of file vppoint4d.cpp. References VPPoint4D(). |
|
Definition at line 205 of file vppoint4d.cpp. |
|
Definition at line 226 of file vppoint4d.cpp. References vetCoord. |
|
Addition for point and vector (or vice versa). Both point and vector should be normalized.
Definition at line 178 of file vppoint4d.cpp. |
|
Definition at line 189 of file vppoint4d.cpp. References vetCoord. |
|
Subtraction of two points. Both points should be normalized.
Definition at line 170 of file vppoint4d.cpp. References vetCoord, and VPPoint4D(). |
|
Definition at line 163 of file vppoint4d.cpp. References VPPoint4D(). |
|
Checks whether a point is "less then" other. The idea of ordering in 4D point comes from operatorLess public attribute. Definition at line 221 of file vppoint4d.cpp. References operatorLess. |
|
Definition at line 242 of file vppoint4d.cpp. References VPPoint3D::vpGetX(), VPPoint3D::vpGetY(), and VPPoint3D::vpGetZ(). |
|
Definition at line 258 of file vppoint4d.cpp. References VPPoint3D::vpGetX(), VPPoint3D::vpGetY(), and VPPoint3D::vpGetZ(). |
|
Definition at line 250 of file vppoint4d.cpp. References VPPoint3D::vpGetX(), VPPoint3D::vpGetY(), and VPPoint3D::vpGetZ(). |
|
Definition at line 234 of file vppoint4d.cpp. References vetCoord. |
|
Definition at line 213 of file vppoint4d.cpp. References vetCoord. |
|
The (0,0,0,1) point.
Definition at line 96 of file vppoint4d.cpp. Referenced by VPLight::BRIGHT_AMBIENT(), and VPBezier::VPBezier(). |
|
Definition at line 105 of file vppoint4d.h. Referenced by VPDof::ComputeLIM(), VPTransform::GetTranslation(), VPTransform::GetVectorX(), VPTransform::GetVectorY(), VPTransform::GetVectorZ(), VPDof::MoveTo(), and VPDof::Transform(). |
|
Definition at line 102 of file vppoint4d.h. Referenced by VPTransform::GetTranslation(), VPTransform::GetVectorX(), VPTransform::GetVectorY(), and VPTransform::GetVectorZ(). |
|
Definition at line 102 of file vppoint4d.cpp. Referenced by VPTransform::ApplyTo(), VPMeshObject::GetYProjection(), VPTransform::MakeRotation(), VPBoundingBox::ProcessCenter(), VPMeshObject::SetVertices(), VPMeshObject::Transform(), VPDof::VPDof(), and VPPoint4D(). |
|
Definition at line 103 of file vppoint4d.h. Referenced by VPTransform::GetTranslation(), VPTransform::GetVectorX(), VPTransform::GetVectorY(), and VPTransform::GetVectorZ(). |
|
Definition at line 104 of file vppoint4d.h. Referenced by VPTransform::GetTranslation(), VPTransform::GetVectorX(), VPTransform::GetVectorY(), and VPTransform::GetVectorZ(). |
|
This method is usefull to pass to glVertex4dv().
Definition at line 88 of file vppoint4d.h. |
|
The X vector (1,0,0,0).
Definition at line 72 of file vppoint4d.cpp. |
|
Verifies whether a point is less then other by looking at coordinates X, then Z only.
Definition at line 284 of file vppoint4d.cpp. References vetCoord. |
|
The Y vector (0,1,0,0).
Definition at line 78 of file vppoint4d.cpp. Referenced by VPScene::MakeCameraViewAll(). |
|
The Z vector (0,0,1,0).
Definition at line 84 of file vppoint4d.cpp. |
|
Output operator.
|
|
Points to the operator to use within operator<. The application programmer should change this pointer to the desired comparison function. Default value is LexicographicalLess. To change its value, use something like: VPPoint4D::operatorLess = &VPPoint4D::LexicographicalLess . Currently, possible values are: LexicographicalLess and XThenZLess. Definition at line 134 of file vppoint4d.h. Referenced by operator<(). |