add missing
This commit is contained in:
parent
a307f89589
commit
19c9ef1b0b
|
@ -1202,6 +1202,19 @@ proc `*`*(q: Quat, v: float32): Quat {.inline.} =
|
|||
result.z = q.z * v
|
||||
result.w = q.w * v
|
||||
|
||||
proc `/`*(q: Quat, v: float32): Quat {.inline.} =
|
||||
## Divide the quaternion by a float32.
|
||||
result.x = q.x / v
|
||||
result.y = q.y / v
|
||||
result.z = q.z / v
|
||||
result.w = q.w / v
|
||||
|
||||
proc `*=`*(a: var Quat, b: float32) {.inline.} =
|
||||
a = a * b
|
||||
|
||||
proc `/=`*(a: var Quat, b: float32) {.inline.} =
|
||||
a = a / b
|
||||
|
||||
proc `*`*(q: Quat, v: Vec3): Vec3 =
|
||||
## Multiply the quaternion by a vector.
|
||||
let
|
||||
|
|
|
@ -1,5 +1,21 @@
|
|||
import vmath, osproc, random, streams
|
||||
|
||||
var v2 = vec2(0, 0)
|
||||
v2 *= 1
|
||||
v2 /= 1
|
||||
|
||||
var v3 = vec3(0, 0, 0)
|
||||
v3 *= 1
|
||||
v3 /= 1
|
||||
|
||||
var v4 = vec4(0, 0, 0, 0)
|
||||
v4 *= 1
|
||||
v4 /= 1
|
||||
|
||||
var q = quat(0, 0, 0, 0)
|
||||
q *= 1
|
||||
q /= 1
|
||||
|
||||
var s = newFileStream("tests/test-output.txt", fmWrite)
|
||||
|
||||
randomize(1234)
|
||||
|
|
Loading…
Reference in a new issue