diff options
Diffstat (limited to 'examples/resources/lib/vector3.lua')
| -rw-r--r-- | examples/resources/lib/vector3.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/resources/lib/vector3.lua b/examples/resources/lib/vector3.lua index 7059690..1b5cdd3 100644 --- a/examples/resources/lib/vector3.lua +++ b/examples/resources/lib/vector3.lua @@ -3,6 +3,8 @@ if table.unpack == nil then table.unpack = unpack end +local Vector2 = require( "vector2" ) + Vector3 = {} Vector3.meta = { __index = Vector3, @@ -78,6 +80,18 @@ function Vector3:clone() return Vector3:new( self.x, self.y, self.z ) end +function Vector3:getVectorXY() + return Vector2:new( self.x, self.y ) +end + +function Vector3:getVectorXZ() + return Vector2:new( self.x, self.z ) +end + +function Vector3:getVectorZY() + return Vector2:new( self.z, self.y ) +end + function Vector3:abs() return Vector3:new( math.abs( self.x ), math.abs( self.y ), math.abs( self.z ) ) end |
