13using namespace Triton;
17#ifndef TRITON_VECTOR4_H
18#define TRITON_VECTOR4_H
34 Vector4(
double px,
double py,
double pz,
double pw) :
x(px), y(py), z(pz), w(pw) {
48 return x * v.
x + y * v.y + z * v.z + w * v.w;
58 return Vector4(
x*v.
x, y*v.y, z*v.z, w*v.w);
68 return Vector4(
x - v.
x, y - v.y, z - v.z, w - v.w);
73 return Vector4(
x + v.
x, y + v.y, z + v.z, w + v.w);
Memory allocation interface for SilverLining.
A 3D Vector class and its operations.
A simple 4D vector class.
This base class for all Triton objects intercepts the new and delete operators, routing them through ...
Definition: MemAlloc.h:71
A 3D double-precision Vector class and its operations.
Definition: Vector3.h:36
A simple double-precision 4D vector class with no operations defined.
Definition: Vector4.h:31
Vector4 TRITONAPI operator*(double n) const
Scales each x,y,z value of the vector by a constant n, and returns the result.
Definition: Vector4.h:52
Vector4 TRITONAPI operator+(double n) const
Adds a constant n to each component of the vector, and returns the result.
Definition: Vector4.h:62
Vector4(double px, double py, double pz, double pw)
Constructs a Vector4 from the given x, y, z, and w values.
Definition: Vector4.h:34
Vector4(const Vector3 &v3)
Constructs a Vector4 from a Vector3, setting w to 1.
Definition: Vector4.h:38
double TRITONAPI Dot(const Vector4 &v) const
Determines the dot product between this vector and another, and returns the result.
Definition: Vector4.h:47
Vector4()
Default constructor; initializes the Vector4 to (0, 0, 0, 1)
Definition: Vector4.h:42
Vector4 TRITONAPI operator-(const Vector4 &v) const
Subtracts the specified vector from this vector, and returns the result.
Definition: Vector4.h:67
double x
The x, y, z, and w data members are public for convenience.
Definition: Vector4.h:76