diff options
| author | Ginger Bill <bill@gingerbill.org> | 2016-09-21 23:26:31 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2016-09-21 23:26:31 +0100 |
| commit | 664c2cd7a587feb18f02378506bdade2503343d3 (patch) | |
| tree | 2c0b5e972eaa2cc74ec67c377a9bd8f6e284b24e /code/math.odin | |
| parent | 33bd3f635f9d98636ab4631fac9cff4e9d7fdb4d (diff) | |
Fix enum type comparison; Start demo 003 code
Diffstat (limited to 'code/math.odin')
| -rw-r--r-- | code/math.odin | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/code/math.odin b/code/math.odin index 5fea41adc..e9554f6b5 100644 --- a/code/math.odin +++ b/code/math.odin @@ -96,7 +96,7 @@ remainder :: proc(x, y: f32) -> f32 { fmod :: proc(x, y: f32) -> f32 { y = abs(y) result := remainder(abs(x), y) - if fsign(result) < 0 { + if sign32(result) < 0 { result += y } return copy_sign(result, x) @@ -120,9 +120,9 @@ cross :: proc(x, y: Vec3) -> Vec3 { } -vec2_mag :: proc(v: Vec2) -> f32 { return fsqrt(dot2(v, v)) } -vec3_mag :: proc(v: Vec3) -> f32 { return fsqrt(dot3(v, v)) } -vec4_mag :: proc(v: Vec4) -> f32 { return fsqrt(dot4(v, v)) } +vec2_mag :: proc(v: Vec2) -> f32 { return sqrt32(dot2(v, v)) } +vec3_mag :: proc(v: Vec3) -> f32 { return sqrt32(dot3(v, v)) } +vec4_mag :: proc(v: Vec4) -> f32 { return sqrt32(dot4(v, v)) } vec2_norm :: proc(v: Vec2) -> Vec2 { return v / Vec2{vec2_mag(v)} } vec3_norm :: proc(v: Vec3) -> Vec3 { return v / Vec3{vec3_mag(v)} } |