bevy_mod_scripting 0.24.0

Multi language scripting in Bevy
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
local Vec3 = import_namespace("math").Vec3
local a = Vec3.new(2.0, 4.0, 6.0)
local b = Vec3.new(1.0, 2.0, 3.0)

assert((a / 2).x == 1.0, "Division did not work")
assert((a / 2).y == 2.0, "Division did not work")
assert((a / 2).z == 3.0, "Division did not work")

assert((a / b).x == 2.0, "Division did not work")
assert((a / b).y == 2.0, "Division did not work")
assert((a / b).z == 2.0, "Division did not work")

-- a number on the left calls `rdiv` on the vector
assert((12 / a) == Vec3.new(6.0, 3.0, 2.0), "Division with a number on the left did not work")