mirror of
https://github.com/HybridDog/vector_extras.git
synced 2024-11-29 19:03:51 +01:00
Remove the vector.cross and deprecate vector.scalar; those functions are in minetest now
This commit is contained in:
parent
9c6e53dd0a
commit
d1a3c95286
12
init.lua
12
init.lua
@ -255,18 +255,6 @@ function funcs.sort_positions(ps, preferred_coords)
|
|||||||
table.sort(ps, ps_sorting)
|
table.sort(ps, ps_sorting)
|
||||||
end
|
end
|
||||||
|
|
||||||
function funcs.scalar(v1, v2)
|
|
||||||
return v1.x*v2.x + v1.y*v2.y + v1.z*v2.z
|
|
||||||
end
|
|
||||||
|
|
||||||
function funcs.cross(v1, v2)
|
|
||||||
return {
|
|
||||||
x = v1.y*v2.z - v1.z*v2.y,
|
|
||||||
y = v1.z*v2.x - v1.x*v2.z,
|
|
||||||
z = v1.x*v2.y - v1.y*v2.x
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Tschebyschew norm
|
-- Tschebyschew norm
|
||||||
function funcs.maxnorm(v)
|
function funcs.maxnorm(v)
|
||||||
return math.max(math.max(math.abs(v.x), math.abs(v.y)), math.abs(v.z))
|
return math.max(math.max(math.abs(v.x), math.abs(v.y)), math.abs(v.z))
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
local funcs = vector_extras_functions
|
local funcs = vector_extras_functions
|
||||||
|
|
||||||
|
function funcs.scalar(v1, v2)
|
||||||
|
minetest.log("deprecated", "[vector_extras] vector.scalar is " ..
|
||||||
|
"deprecated, use vector.dot instead.")
|
||||||
|
return vector.dot(v1, v2)
|
||||||
|
end
|
||||||
|
|
||||||
function funcs.get_data_from_pos(tab, z,y,x)
|
function funcs.get_data_from_pos(tab, z,y,x)
|
||||||
minetest.log("deprecated", "[vector_extras] get_data_from_pos is " ..
|
minetest.log("deprecated", "[vector_extras] get_data_from_pos is " ..
|
||||||
"deprecated, use the minetest pos hash function instead.")
|
"deprecated, use the minetest pos hash function instead.")
|
||||||
|
Loading…
Reference in New Issue
Block a user