summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-11-17 09:55:01 +0800
committerchai <chaifix@163.com>2021-11-17 09:55:01 +0800
commitd56308e585e056038dca8a32cc79d131015581de (patch)
tree10c3776330210551a5536750c8d4e4d8a29f04eb
parent867543de42a0c3d7fa6554e5e9672fe469ae9386 (diff)
*misc
-rw-r--r--Data/BuiltIn/Libraries/GameLab/Engine/Math/Matrix44.lua16
-rw-r--r--Data/BuiltIn/Libraries/GameLab/Engine/Math/Vector2.lua29
2 files changed, 41 insertions, 4 deletions
diff --git a/Data/BuiltIn/Libraries/GameLab/Engine/Math/Matrix44.lua b/Data/BuiltIn/Libraries/GameLab/Engine/Math/Matrix44.lua
index 9386daf..4e833a1 100644
--- a/Data/BuiltIn/Libraries/GameLab/Engine/Math/Matrix44.lua
+++ b/Data/BuiltIn/Libraries/GameLab/Engine/Math/Matrix44.lua
@@ -8,6 +8,22 @@ Matrix44.Ctor = function(self)
end
end
+Matrix44.get_colum1 = function(self)
+
+end
+
+Matrix44.get_colum2 = function(self)
+
+end
+
+Matrix44.get_colum3 = function(self)
+
+end
+
+Matrix44.get_colum4 = function(self)
+
+end
+
Matrix44.Clear = function(self)
for r = 0, 3 do
for c = 0, 3 do
diff --git a/Data/BuiltIn/Libraries/GameLab/Engine/Math/Vector2.lua b/Data/BuiltIn/Libraries/GameLab/Engine/Math/Vector2.lua
index 8aeb30a..24aa233 100644
--- a/Data/BuiltIn/Libraries/GameLab/Engine/Math/Vector2.lua
+++ b/Data/BuiltIn/Libraries/GameLab/Engine/Math/Vector2.lua
@@ -1,14 +1,29 @@
local Vector2 = GameLab.GlobalClass("GameLab.Engine.Math.Vector2")
+local Vector4 = GameLab.Include("GameLab.Engine.Math.Vector4")
function Vector2:Ctor(x, y)
self.x = x or 0
self.y = y or 0
end
-function Vector2:__add(other)
- self.x = self.x + other.x
- self.y = self.y + other.y
- return self
+function Vector2:get_xyxy()
+ local v = Vector4(self.x, self.y, self.x, self.y)
+ return v
+end
+
+function Vector2:get_xx()
+ local v = Vector2(self.x, self.x)
+ return v
+end
+
+function Vector2:get_yy()
+ local v = Vector2(self.y, self.y)
+ return v
+end
+
+function Vector2:get_yx()
+ local v = Vector2(self.y, self.x)
+ return v
end
function Vector2:Set(other)
@@ -22,6 +37,12 @@ function Vector2:Add(other)
return self
end
+function Vector2:__add(other)
+ self.x = self.x + other.x
+ self.y = self.y + other.y
+ return self
+end
+
function Vector2:__tostring()
return string.format("%0.3f,%0.3f", self.x, self.y)
end