No matching definitions.

math/vec3

src/math/vec3.tur
defn

vec3

(vec3 [x : float y : float z : float] :)

construct a 3D vector.

xx component
yy component
zz component

Opaque :int handle to a heap-allocated Vec3.

(vec3 1.0 2.0 3.0)

Since: P1

defn

v3-x

(v3-x [v : int] :)

get x component. Since: P1

defn

v3-y

(v3-y [v : int] :)

get y component. Since: P1

defn

v3-z

(v3-z [v : int] :)

get z component. Since: P1

defn

v3-add

(v3-add [a : int b : int] :)

add two Vec3 values. Since: P1

defn

v3-sub

(v3-sub [a : int b : int] :)

subtract two Vec3 values. Since: P1

defn

v3-scale

(v3-scale [v : int s : float] :)

scale a Vec3 by a scalar. Since: P1

defn

v3-dot

(v3-dot [a : int b : int] :)

dot product of two Vec3 values. Since: P1

defn

v3-cross

(v3-cross [a : int b : int] :)

cross product of two Vec3 values.

New Vec3 perpendicular to both a and b.

(v3-cross (vec3 1.0 0.0 0.0) (vec3 0.0 1.0 0.0))  ; => (0, 0, 1)

Since: P1

defn

v3-length

(v3-length [v : int] :)

Euclidean length of a Vec3. Since: P1

defn

v3-normalize

(v3-normalize [v : int] :)

return a unit-length Vec3. Since: P1

defn

v3-lerp

(v3-lerp [a : int b : int t : float] :)

linearly interpolate between two Vec3 values. Since: P1