extensions/urho3d: More Vector3 and Node methods

This commit is contained in:
Perttu Ahola 2014-10-12 23:48:27 +03:00
parent 3b0f63ded1
commit aa64aad4d7

View File

@ -80,10 +80,20 @@ function M.define(dst, util)
function(x, y, z)
return util.wrap_instance("Vector3", Vector3(x, y, z))
end),
instance = {
Length = util.self_function(
"Length", {"number"}, {"Vector3"}),
},
instance_meta = {
__mul = util.wrap_function({"Vector3", "number"}, function(self, n)
return util.wrap_instance("Vector3", self * n)
end),
__add = util.wrap_function({"Vector3", "Vector3"}, function(self, other)
return util.wrap_instance("Vector3", self + other)
end),
__sub = util.wrap_function({"Vector3", "Vector3"}, function(self, other)
return util.wrap_instance("Vector3", self - other)
end),
},
properties = {
x = util.simple_property("number"),
@ -315,6 +325,7 @@ function M.define(dst, util)
),
SetVar = util.self_function("SetVar", {},
{"Node", "StringHash", "Variant"}),
GetWorldPosition = util.self_function("GetWorldPosition", {dst.Vector3}, {"Node"}),
},
properties = {
scale = util.simple_property(dst.Vector3),