![]() |
TrinityCore
|
#include <Vector3.h>
Public Types | |
| enum | Axis { X_AXIS =0, Y_AXIS =1, Z_AXIS =2, DETECT_AXIS =-1 } |
Static Public Member Functions | |
| static void | orthonormalize (Vector3 akVector[3]) |
| static Vector3 | random (Random &r=Random::common()) |
| Random unit vector, uniformly distributed on the sphere. More... | |
| static Vector3 | cosHemiRandom (const Vector3 &n, Random &r=Random::common()) |
Random unit vector, distributed according to . More... | |
| static Vector3 | cosSphereRandom (const Vector3 &n, Random &r=Random::common()) |
| static Vector3 | cosPowHemiRandom (const Vector3 &n, const float k, Random &r=Random::common()) |
Random unit vector, distributed according to . More... | |
| static Vector3 | hemiRandom (const Vector3 &normal, Random &r=Random::common()) |
| Random vector distributed over the hemisphere about normal. More... | |
| static const Vector3 & | zero () |
| static const Vector3 & | one () |
| static const Vector3 & | unitX () |
| static const Vector3 & | unitY () |
| static const Vector3 & | unitZ () |
| static const Vector3 & | inf () |
| static const Vector3 & | nan () |
| static const Vector3 & | minFinite () |
| static const Vector3 & | maxFinite () |
| static Vector3 & | ignore () |
Public Attributes | |
| float | x |
| float | y |
| float | z |
Private Member Functions | |
| bool | operator< (const Vector3 &) const |
| bool | operator> (const Vector3 &) const |
| bool | operator<= (const Vector3 &) const |
| bool | operator>= (const Vector3 &) const |
Swizzles Vector classes have swizzle operators, e.g. v.xy(), that allow selection of arbitrary sub-fields. These cannot be used as write masks. Examples
Vector3 v(1, 2, 3); Vector3 j; Vector2 b;
b = v.xz(); j = b.xx();
Warning
Do not subclass– this implementation makes assumptions about the memory layout.
| enum G3D::Vector3::Axis |
|
inline |
Initializes to zero
Here is the caller graph for this function:| G3D::Vector3::Vector3 | ( | const Vector4int8 & | v | ) |
Divides by 127
| G3D::Vector3::Vector3 | ( | const class Vector3int32 & | v | ) |
|
explicit |
Here is the call graph for this function:
|
inline |
|
inlineexplicit |
|
inlineexplicit |
| G3D::Vector3::Vector3 | ( | const class Vector3int16 & | v | ) |
|
explicit |
Here is the call graph for this function:
|
inline |
Here is the call graph for this function:
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Here is the call graph for this function:
|
static |
Random unit vector, distributed according to
.
That is, so that the probability of
is proportional to
. Useful in photon mapping for Lambertian scattering.
Distribution rendered by G3D::DirectionHistogram:
| n | Unit vector at the center of the distribution. |
[Henrik] Wann Jensen, Realistic Image Synthesis using Photon Mapping eqn 2.24
Here is the call graph for this function:
|
static |
Random unit vector, distributed according to
.
That is, so that the probability of
is proportional to
. Useful in photon mapping for glossy scattering.
Distribution rendered by G3D::DirectionHistogram:
| n | Unit vector at the center of the distribution. |
[Ashikhmin] and Shirley, An anisotropic Phong BRDF model, Journal of Graphics Tools, 2002
Here is the call graph for this function:
|
static |
Here is the call graph for this function:Cross product. Note that two cross products in a row can be computed more cheaply: v1 x (v2 x v3) = (v1 dot v3) v2 - (v1 dot v2) v3.
Here is the call graph for this function:
Here is the caller graph for this function:| Matrix3 G3D::Vector3::cross | ( | ) | const |
Returns a matrix such that v.cross() * w = v.cross(w).
[ 0 -v.z v.y ] [ v.z 0 -v.x ] [ -v.y v.x 0 ]
Here is the caller graph for this function:| void G3D::Vector3::deserialize | ( | class BinaryInput & | b | ) |
Here is the call graph for this function:
Here is the caller graph for this function:| void G3D::Vector3::deserialize | ( | class TextInput & | t | ) |
Here is the call graph for this function:
|
inline |
Returns a unit-length version of this vector. Returns nan if length is almost zero.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Returns Vector3::zero() if the length is nearly zero, otherwise returns a unit vector.
Here is the call graph for this function:
Here is the caller graph for this function:
Here is the caller graph for this function:
|
inline |
Potentially less accurate but faster than direction(). Only works if System::hasSSE is true.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Returns a normalized vector. May be computed with lower precision than unit
Here is the call graph for this function:
|
inline |
Here is the call graph for this function:
Here is the caller graph for this function:
Here is the call graph for this function:Creates two orthonormal tangent vectors X and Y such that if Z = this, X x Y = Z.
Here is the call graph for this function:
Here is the caller graph for this function:| size_t G3D::Vector3::hashCode | ( | ) | const |
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Random vector distributed over the hemisphere about normal.
Distribution rendered by G3D::DirectionHistogram:
Here is the call graph for this function:
|
static |
Can be passed to ignore a vector3 parameter
|
inline |
Returns true if this vector has finite length.
Here is the call graph for this function:
Here is the caller graph for this function:| bool G3D::Vector3::isNaN | ( | ) | const |
True if any field is nan
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Returns true if this vector has length ~= 1
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Returns true if this vector has length ~= 0
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Same as magnitude
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Here is the caller graph for this function:
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Largest element
Here is the call graph for this function:Largest representable vector
Here is the caller graph for this function:
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Smallest element
Here is the call graph for this function:Smallest (most negative) representable vector
Here is the caller graph for this function:Returns a vector that is this translated towards goal with a maximum translation of maxTranslation.
Here is the call graph for this function:
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Here is the caller graph for this function:
|
inline |
Here is the call graph for this function:
Here is the call graph for this function:
|
inline |
Here is the call graph for this function:
Here is the call graph for this function:
|
inline |
Here is the call graph for this function:
|
inline |
Here is the call graph for this function:
|
inline |
Here is the call graph for this function:
|
inline |
|
static |
Gram-Schmidt orthonormalization.
Here is the call graph for this function:
|
inline |
Raise each component of this vector to a power
Here is the call graph for this function:| Vector3::Axis G3D::Vector3::primaryAxis | ( | ) | const |
Returns the largest dimension. Particularly convenient for determining which plane to project a triangle onto for point-in-polygon tests.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Random unit vector, uniformly distributed on the sphere.
Distribution rendered by G3D::DirectionHistogram:
Here is the call graph for this function:
Here is the caller graph for this function:Reflect this vector about the (not necessarily unit) normal. Assumes that both the before and after vectors point away from the base of the normal.
Note that if used for a collision or ray reflection you must negate the resulting vector to get a direction pointing away from the collision.
V' N V
r ^ -,
\ | /
|/
See also Vector3::reflectionDirection
Here is the call graph for this function:
Here is the caller graph for this function:See also G3D::Ray::reflect. The length is 1.
V' N V
r ^ /
\ | /
|'-
Here is the call graph for this function:
Here is the caller graph for this function:| Vector3 G3D::Vector3::refractionDirection | ( | const Vector3 & | normal, |
| float | iInside, | ||
| float | iOutside | ||
| ) | const |
Returns the direction of a refracted ray, where iExit is the index of refraction for the previous material and iEnter is the index of refraction for the new material. Like Vector3::reflectionDirection, the result has length 1 and is pointed away from the intersection.
Returns Vector3::zero() in the case of total internal refraction.
| iOutside | The index of refraction (eta) outside (on the positive normal side) of the surface. |
| iInside | The index of refraction (eta) inside (on the negative normal side) of the surface. |
See also G3D::Ray::refract.
N V ^ /
| /
|'-
__–
V'<–
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Here is the call graph for this function:| void G3D::Vector3::serialize | ( | class BinaryOutput & | b | ) | const |
Format is three float32's
Here is the call graph for this function:
Here is the caller graph for this function:| void G3D::Vector3::serialize | ( | class TextOutput & | t | ) | const |
Format is "(%f, %f, %f)"
Here is the call graph for this function:
|
inline |
Same as squaredMagnitude
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Here is the caller graph for this function:
|
inline |
Here is the caller graph for this function:| std::string G3D::Vector3::toString | ( | ) | const |
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Synonym for direction
Here is the call graph for this function:
Here is the call graph for this function:
Here is the caller graph for this function:
Here is the caller graph for this function:
Here is the caller graph for this function:| Vector2 G3D::Vector3::xx | ( | ) | const |
| Vector3 G3D::Vector3::xxx | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::xxxx | ( | ) | const |
| Vector4 G3D::Vector3::xxxy | ( | ) | const |
| Vector4 G3D::Vector3::xxxz | ( | ) | const |
| Vector3 G3D::Vector3::xxy | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::xxyx | ( | ) | const |
| Vector4 G3D::Vector3::xxyy | ( | ) | const |
| Vector4 G3D::Vector3::xxyz | ( | ) | const |
| Vector3 G3D::Vector3::xxz | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::xxzx | ( | ) | const |
| Vector4 G3D::Vector3::xxzy | ( | ) | const |
| Vector4 G3D::Vector3::xxzz | ( | ) | const |
| Vector2 G3D::Vector3::xy | ( | ) | const |
| Vector3 G3D::Vector3::xyx | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::xyxx | ( | ) | const |
| Vector4 G3D::Vector3::xyxy | ( | ) | const |
| Vector4 G3D::Vector3::xyxz | ( | ) | const |
| Vector3 G3D::Vector3::xyy | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::xyyx | ( | ) | const |
| Vector4 G3D::Vector3::xyyy | ( | ) | const |
| Vector4 G3D::Vector3::xyyz | ( | ) | const |
| Vector3 G3D::Vector3::xyz | ( | ) | const |
Here is the call graph for this function:
Here is the caller graph for this function:| Vector4 G3D::Vector3::xyzx | ( | ) | const |
| Vector4 G3D::Vector3::xyzy | ( | ) | const |
| Vector4 G3D::Vector3::xyzz | ( | ) | const |
| Vector2 G3D::Vector3::xz | ( | ) | const |
Here is the caller graph for this function:| Vector3 G3D::Vector3::xzx | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::xzxx | ( | ) | const |
| Vector4 G3D::Vector3::xzxy | ( | ) | const |
| Vector4 G3D::Vector3::xzxz | ( | ) | const |
| Vector3 G3D::Vector3::xzy | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::xzyx | ( | ) | const |
| Vector4 G3D::Vector3::xzyy | ( | ) | const |
| Vector4 G3D::Vector3::xzyz | ( | ) | const |
| Vector3 G3D::Vector3::xzz | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::xzzx | ( | ) | const |
| Vector4 G3D::Vector3::xzzy | ( | ) | const |
| Vector4 G3D::Vector3::xzzz | ( | ) | const |
| Vector2 G3D::Vector3::yx | ( | ) | const |
| Vector3 G3D::Vector3::yxx | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::yxxx | ( | ) | const |
| Vector4 G3D::Vector3::yxxy | ( | ) | const |
| Vector4 G3D::Vector3::yxxz | ( | ) | const |
| Vector3 G3D::Vector3::yxy | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::yxyx | ( | ) | const |
| Vector4 G3D::Vector3::yxyy | ( | ) | const |
| Vector4 G3D::Vector3::yxyz | ( | ) | const |
| Vector3 G3D::Vector3::yxz | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::yxzx | ( | ) | const |
| Vector4 G3D::Vector3::yxzy | ( | ) | const |
| Vector4 G3D::Vector3::yxzz | ( | ) | const |
| Vector2 G3D::Vector3::yy | ( | ) | const |
| Vector3 G3D::Vector3::yyx | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::yyxx | ( | ) | const |
| Vector4 G3D::Vector3::yyxy | ( | ) | const |
| Vector4 G3D::Vector3::yyxz | ( | ) | const |
| Vector3 G3D::Vector3::yyy | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::yyyx | ( | ) | const |
| Vector4 G3D::Vector3::yyyy | ( | ) | const |
| Vector4 G3D::Vector3::yyyz | ( | ) | const |
| Vector3 G3D::Vector3::yyz | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::yyzx | ( | ) | const |
| Vector4 G3D::Vector3::yyzy | ( | ) | const |
| Vector4 G3D::Vector3::yyzz | ( | ) | const |
| Vector2 G3D::Vector3::yz | ( | ) | const |
| Vector3 G3D::Vector3::yzx | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::yzxx | ( | ) | const |
| Vector4 G3D::Vector3::yzxy | ( | ) | const |
| Vector4 G3D::Vector3::yzxz | ( | ) | const |
| Vector3 G3D::Vector3::yzy | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::yzyx | ( | ) | const |
| Vector4 G3D::Vector3::yzyy | ( | ) | const |
| Vector4 G3D::Vector3::yzyz | ( | ) | const |
| Vector3 G3D::Vector3::yzz | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::yzzx | ( | ) | const |
| Vector4 G3D::Vector3::yzzy | ( | ) | const |
| Vector4 G3D::Vector3::yzzz | ( | ) | const |
Here is the caller graph for this function:| Vector2 G3D::Vector3::zx | ( | ) | const |
| Vector3 G3D::Vector3::zxx | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::zxxx | ( | ) | const |
| Vector4 G3D::Vector3::zxxy | ( | ) | const |
| Vector4 G3D::Vector3::zxxz | ( | ) | const |
| Vector3 G3D::Vector3::zxy | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::zxyx | ( | ) | const |
| Vector4 G3D::Vector3::zxyy | ( | ) | const |
| Vector4 G3D::Vector3::zxyz | ( | ) | const |
| Vector3 G3D::Vector3::zxz | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::zxzx | ( | ) | const |
| Vector4 G3D::Vector3::zxzy | ( | ) | const |
| Vector4 G3D::Vector3::zxzz | ( | ) | const |
| Vector2 G3D::Vector3::zy | ( | ) | const |
| Vector3 G3D::Vector3::zyx | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::zyxx | ( | ) | const |
| Vector4 G3D::Vector3::zyxy | ( | ) | const |
| Vector4 G3D::Vector3::zyxz | ( | ) | const |
| Vector3 G3D::Vector3::zyy | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::zyyx | ( | ) | const |
| Vector4 G3D::Vector3::zyyy | ( | ) | const |
| Vector4 G3D::Vector3::zyyz | ( | ) | const |
| Vector3 G3D::Vector3::zyz | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::zyzx | ( | ) | const |
| Vector4 G3D::Vector3::zyzy | ( | ) | const |
| Vector4 G3D::Vector3::zyzz | ( | ) | const |
| Vector2 G3D::Vector3::zz | ( | ) | const |
| Vector3 G3D::Vector3::zzx | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::zzxx | ( | ) | const |
| Vector4 G3D::Vector3::zzxy | ( | ) | const |
| Vector4 G3D::Vector3::zzxz | ( | ) | const |
| Vector3 G3D::Vector3::zzy | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::zzyx | ( | ) | const |
| Vector4 G3D::Vector3::zzyy | ( | ) | const |
| Vector4 G3D::Vector3::zzyz | ( | ) | const |
| Vector3 G3D::Vector3::zzz | ( | ) | const |
Here is the call graph for this function:| Vector4 G3D::Vector3::zzzx | ( | ) | const |
| Vector4 G3D::Vector3::zzzy | ( | ) | const |
| Vector4 G3D::Vector3::zzzz | ( | ) | const |
| float G3D::Vector3::x |
| float G3D::Vector3::y |
| float G3D::Vector3::z |
1.8.8