From cb1bc03681dff958da6ff851cfe32dfdd83f6f8d Mon Sep 17 00:00:00 2001 From: jussi Date: Wed, 22 May 2024 00:11:40 +0300 Subject: Object lib serialization. --- examples/resources/lib/vector3.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'examples/resources/lib/vector3.lua') diff --git a/examples/resources/lib/vector3.lua b/examples/resources/lib/vector3.lua index 86f5270..216962e 100644 --- a/examples/resources/lib/vector3.lua +++ b/examples/resources/lib/vector3.lua @@ -87,6 +87,10 @@ function Vector3:setV( v ) self.z = v.z end +function Vector3:serialize() + return "Vector3:new("..self.x..","..self.y..","..self.z..")" +end + function Vector3:arr() return { self.x, self.y, self.z } end @@ -123,6 +127,10 @@ function Vector3:max( v2 ) return Vector3:newT( RL.Vector3Max( self, v2 ) ) end +function Vector3:round() + return Vector3:new( RL.Round( self.x ), RL.Round( self.y ), RL.Round( self.z ) ) +end + function Vector3:floor() return Vector3:new( math.floor( self.x ), math.floor( self.y ), math.floor( self.z ) ) end -- cgit v1.2.3