From b011b2ca4e161fea2a742cb9b1673cd84cf0eba5 Mon Sep 17 00:00:00 2001 From: jussi Date: Mon, 5 Aug 2024 23:35:57 +0300 Subject: GetRayBoxCells fix. --- examples/resources/lib/vector3.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'examples/resources/lib/vector3.lua') diff --git a/examples/resources/lib/vector3.lua b/examples/resources/lib/vector3.lua index bfecb07..7b339f6 100644 --- a/examples/resources/lib/vector3.lua +++ b/examples/resources/lib/vector3.lua @@ -3,8 +3,6 @@ if table.unpack == nil then table.unpack = unpack end -local Vector2 = Vector2 or require( "vector2" ) - local Vector3 = {} local metatable = { __index = Vector3, @@ -38,6 +36,12 @@ local metatable = { __eq = function( v1, v2 ) return RL.Vector3Equals( v1, v2 ) end, + __lt = function( v1, v2 ) + return v1.x < v2.x and v1.y < v2.y and v1.z < v2.z + end, + __le = function( v1, v2 ) + return v1.x <= v2.x and v1.y <= v2.y and v1.z <= v2.z + end, __concat = function( a, b ) return tostring( a )..tostring( b ) end, @@ -232,6 +236,10 @@ function Vector3:equals( v2 ) return RL.Vector3Equals( self, v2 ) end +function Vector3:sign() + return Vector3:new( RL.Sign( self.x ), RL.Sign( self.y ), RL.Sign( self.z ) ) +end + function Vector3:addEq( v2 ) self.x = self.x + v2.x self.y = self.y + v2.y -- cgit v1.2.3