Differences From
Artifact [80f52c4aaf]:
- File
lib/math.lua
— part of check-in
[147592b8e9]
at
2020-10-26 03:58:08
on branch trunk
— add over-time spellcasting abstraction to enable metamagic and in particular disjunction, add more animations and sound effects, add excavation spell, possibly some others, forget when the last commit was, edit a bunch of magitech to make it subject to the disjunction mechanism (throw up a disjunction aura and waltz right through those force fields bby, wheee), also illumination spells, tweak runeforge and rune frequence to better the balance and also limit player frustration, move some math functions into their own library category, various tweaks and bugfixes, probably other shit i don't remember
(user:
lexi,
size: 583)
[annotate]
[blame]
[check-ins using]
1 1 local fn = {}
2 2
3 3 fn.vsep = function(vec) -- separate a vector into a direction + magnitude
4 - local magnitude = math.max(math.abs(vec.x), math.abs(vec.y), math.abs(vec.z))
5 - local inv = 1 / magnitude
6 - return vector.multiply(vec,inv), magnitude
4 + return vec:normalize(), vec:length()
7 5 end
8 6
9 7 fn.vdcomp = function(dist,v1,v2) -- compare the distance between two points
10 8 -- (cheaper than calculating distance outright)
11 9 local d if v2
12 10 then d = vector.subtract(v1,v2)
13 11 else d = v1