mirror of
https://github.com/minetest/minetest.git
synced 2025-06-30 15:10:23 +02:00
Remove vector metatable setting
This not only makes the vector functions faster, but also makes them more consistent with other functions.
This commit is contained in:
committed by
Perttu Ahola
parent
b3591019ad
commit
12504a18ec
@ -1037,22 +1037,12 @@ vector.length(v) -> number
|
||||
vector.normalize(v) -> vector
|
||||
vector.round(v) -> vector
|
||||
vector.equal(v1, v2) -> bool
|
||||
For the folowing x can be either a vector or a number.
|
||||
vector.add(v, x) -> vector
|
||||
^ x can be annother vector or a number
|
||||
vector.subtract(v, x) -> vector
|
||||
vector.multiply(v, x) -> vector
|
||||
vector.divide(v, x) -> vector
|
||||
|
||||
You can also use Lua operators on vectors.
|
||||
For example:
|
||||
v1 = vector.new()
|
||||
v1 = v1 + 5
|
||||
v2 = vector.new(v1)
|
||||
v1 = v1 * v2
|
||||
if v1 == v2 then
|
||||
error("Math broke")
|
||||
end
|
||||
|
||||
Helper functions
|
||||
-----------------
|
||||
dump2(obj, name="_", dumped={})
|
||||
|
Reference in New Issue
Block a user