GpuVec3¶
Import: import system.gpu;
This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation. Shader-only declarations can be used only inside shader entry points and helpers reached from them; using them elsewhere is a compile error.
GpuVec3¶
A vector of three floats, laid out like a GPU float3, for positions, directions, normals and RGB colors. Use it on the CPU and in shaders alike. Arithmetic works component by component, and a float operand applies to every component.
x¶
The first component.
y¶
The second component.
z¶
The third component.
constructor¶
Creates the vector (x, y, z).
constructor¶
Creates a vector with every component equal to value.
xy¶
The first two components.
dot¶
The dot product.
cross¶
The cross product, perpendicular to both vectors, following the right-hand rule.
length¶
The vector's Euclidean length.
normalize¶
The vector scaled to length 1. A zero vector gives non-finite components.