Back to class index
float3[Class Summary]
x
y
z
zero[static][const]
one[static][const]
unitX[static][const]
unitY[static][const]
unitZ[static][const]
nan[static][const]
inf[static][const]
ctor (+4 overloads)
ptr() (+1 overload)
operator[](index) (+1 overload)
At(index) (+1 overload)
operators +,-,*,/(v)[const] (+1 overload)
operators +=,-=,*=,/=(v)
Add/Sub/Mul/Div(v)[const] (+1 overload)
xx/xy/xz/..()[const]
xyz/xzy/yzx/..()[const]
Swizzled(i,j,k,l)[const] (+2 overloads)
SetFromScalar(scalar)
Set(x,y,z)
SetFromSphericalCoordinates(...) (+2 overloads)
ToPos4()[const]
ToDir4()[const]
ToSphericalCoordinates()[const]
ToSphericalCoordinatesNormalized()[const]
Length()[const]
LengthSq()[const]
Normalize()
Normalized()[const]
ScaleToLength(newLength)
ScaledToLength(newLength)[const]
IsNormalized(epsilonSq)[const]
IsZero(epsilonSq)[const]
IsFinite()[const]
IsPerpendicular(other,epsilonSq)[const]
Equals(other,epsilon)[const] (+1 overload)
BitEquals(other)[const]
ToString()[const]
SerializeToString()[const]
SerializeToCodeString()[const]
SumOfElements()[const]
ProductOfElements()[const]
AverageOfElements()[const]
MinElement()[const]
MinElementIndex()[const]
MaxElement()[const]
MaxElementIndex()[const]
Abs()[const]
Neg()[const]
Recip()[const]
Min(ceil)[const] (+1 overload)
Max(floor)[const] (+1 overload)
Clamp(floor,ceil)[const] (+1 overload)
Clamp01()[const]
ClampLength(maxLength)[const] (+1 overload)
Distance(point)[const] (+9 overloads)
DistanceSq(point)[const]
Dot(v)[const]
Cross(v)[const]
OuterProduct(rhs)[const]
Perpendicular(hint,hint2)[const]
AnotherPerpendicular(hint,hint2)[const]
PerpendicularBasis(outB,outC)[const]
RandomPerpendicular(rng)[const]
Reflect(normal)[const]
Refract(...)[const]
ProjectTo(direction)[const]
ProjectToNorm(direction)[const]
AngleBetween(other)[const]
AngleBetweenNorm(normalizedVector)[const]
Decompose(...)[const]
Lerp(b,t)[const]
FromScalar(scalar)[static]
FromSphericalCoordinates(...)[static] (+2 overloads)
AreCollinear(p1,p2,p3,epsilonSq)[static]
FromString(str,outEndStr)[static] (+1 overload)
ScalarTripleProduct(u,v,w)[static]
Lerp(a,b,t)[static]
Orthogonalize(a,b)[static] (+1 overload)
AreOrthogonal(a,b,epsilon)[static] (+1 overload)
Orthonormalize(a,b)[static] (+1 overload)
AreOrthonormal(a,b,epsilon)[static] (+1 overload)
RandomDir(lcg,length)[static]
RandomSphere(lcg,center,radius)[static]
RandomBox(...)[static] (+2 overloads)
RandomGeneral(...)[static]

float3::Add/Sub/Mul/Div

Syntax

float3 float3::Add(const float3 &v) const; [1 line of code]

Adds a vector to this vector.

Return Value

(x+v.x, y+v.y, z+v.z).

Syntax

float3 float3::Add(float s) const; [4 lines of code]

Adds the vector (s,s,s) to this vector.

Note
Mathematically, the addition of a vector and scalar is not defined in linear space structures, but this function is provided here for syntactical convenience.

Return Value

(x+s, y+s, z+s).

Syntax

float3 float3::Sub(const float3 &v) const; [1 line of code]

Subtracts a vector from this vector.

Return Value

(x-v.x, y-v.y, z-v.z).

Syntax

float3 float3::Sub(float s) const; [4 lines of code]

Subtracts the vector (s,s,s) from this vector.

Note
Mathematically, the subtraction of a vector by a scalar is not defined in linear space structures, but this function is provided here for syntactical convenience.

Return Value

(x-s, y-s, z-s).

Syntax

float3 float3::SubLeft(float s) const; [4 lines of code]

Subtracts this vector from the vector (s,s,s).

Note
Mathematically, the subtraction of a scalar by a vector is not defined in linear space structures, but this function is provided here for syntactical convenience.

Return Value

(s-x, s-y, s-z).

Syntax

float3 float3::Mul(const float3 &v) const; [4 lines of code]

Multiplies this vector by a vector, element-wise.

Note
Mathematically, the multiplication of two vectors is not defined in linear space structures, but this function is provided here for syntactical convenience.

Return Value

(x*v.x, y*v.y, z*v.z).

Syntax

float3 float3::Mul(float s) const; [1 line of code]

Multiplies this vector by a scalar.

Return Value

(x*s, y*s, z*s).

Syntax

float3 float3::Div(const float3 &v) const; [4 lines of code]

Divides this vector by a vector, element-wise.

Note
Mathematically, the division of two vectors is not defined in linear space structures, but this function is provided here for syntactical convenience.

Return Value

(x/v.x, y/v.y, z/v.z).

Syntax

float3 float3::Div(float s) const; [1 line of code]

Divides this vector by a scalar.

Return Value

(x/s, y/s, z/s).

Syntax

float3 float3::DivLeft(float s) const; [4 lines of code]

Divides the vector (s,s,s) by this vector, element-wise.

Note
Mathematically, the division of a scalar by a vector is not defined in linear space structures, but this function is provided here for syntactical convenience.

Return Value

(s/x, s/y, s/z).