dlsl.vector

dlsl.vector

Members

Aliases

dvec2
alias dvec2 = Vector!(double, 2)
Undocumented in source.
dvec3
alias dvec3 = Vector!(double, 3)
Undocumented in source.
dvec4
alias dvec4 = Vector!(double, 4)
Undocumented in source.
isInfinity
alias isInfinity = isinf

query if any entry is inf

isNaN
alias isNaN = isnan

query if any entry is nan

isValid
alias isValid = isvalid

query if all entries are not nan and not inf

ivec2
alias ivec2 = Vector!(int, 2)
Undocumented in source.
ivec2b
alias ivec2b = Vector!(byte, 2)
Undocumented in source.
ivec2s
alias ivec2s = Vector!(short, 2)
Undocumented in source.
ivec3
alias ivec3 = Vector!(int, 3)
Undocumented in source.
ivec3b
alias ivec3b = Vector!(byte, 3)
Undocumented in source.
ivec3s
alias ivec3s = Vector!(short, 3)
Undocumented in source.
ivec4
alias ivec4 = Vector!(int, 4)
Undocumented in source.
ivec4b
alias ivec4b = Vector!(byte, 4)
Undocumented in source.
ivec4s
alias ivec4s = Vector!(short, 4)
Undocumented in source.
uvec2
alias uvec2 = Vector!(uint, 2)
Undocumented in source.
uvec2b
alias uvec2b = Vector!(ubyte, 2)
Undocumented in source.
uvec2s
alias uvec2s = Vector!(ushort, 2)
Undocumented in source.
uvec3
alias uvec3 = Vector!(uint, 3)
Undocumented in source.
uvec3b
alias uvec3b = Vector!(ubyte, 3)
Undocumented in source.
uvec3s
alias uvec3s = Vector!(ushort, 3)
Undocumented in source.
uvec4
alias uvec4 = Vector!(uint, 4)
Undocumented in source.
uvec4b
alias uvec4b = Vector!(ubyte, 4)
Undocumented in source.
uvec4s
alias uvec4s = Vector!(ushort, 4)
Undocumented in source.
vec2
alias vec2 = Vector!(float, 2)

Pre-defined vector types

vec3
alias vec3 = Vector!(float, 3)
Undocumented in source.
vec4
alias vec4 = Vector!(float, 4)
Undocumented in source.

Functions

abs
V abs(V v)

Calculates the absolute value per component.

almostEqual
bool almostEqual(T a, S b, float epsilon)
Undocumented in source. Be warned that the author may not have intended to support it.
cross
V cross(V a, V b)

Vector cross product

distance
V.valueType distance(V a, V b)

Distance between two vectors

dot
V.valueType dot(V a, V b)

Vector dot product

faceforward
V faceforward(V N, V I, V Nref)

Flip the Vector N based on an incident vector I and a reference Vector Nref

isinf
bool isinf(V vec)
Undocumented in source. Be warned that the author may not have intended to support it.
isnan
bool isnan(V vec)
Undocumented in source. Be warned that the author may not have intended to support it.
isvalid
bool isvalid(V vec)
Undocumented in source. Be warned that the author may not have intended to support it.
length
auto length(V v)

Vector length floating point valueType

lengthSquared
auto lengthSquared(V v)

Vector squared length floating point valueType, essentially dot( vec, vec );

normalize
V normalize(V v)

Vector normalize

reflect
V reflect(V I, V N)

Reflect the Vector I on a plane with normal N The normal N must already to be normalized

refract
V.valueType refract(V I, V N, V.valueType eta)

For the incident vector I and surface normal N, and the ratio of indices of refraction eta, return the refraction vector The input parameters for the incident vector I and the surface normal N must already be normalized

Structs

Vector
struct Vector(type, int dim)

Base template for all vector-types.

Templates

isVector
template isVector(T)

If T is a vector, this evaluates to true, otherwise false

Meta

Authors

Peter Particle ( based on gl3n by David Herberth )

License

MIT

Note: All methods marked with pure are weakly pure since, they all access an instance member. All static methods are strongly pure.