Bitwise operations for cross Lua compatibility.

This commit is contained in:
jussi
2024-05-01 15:21:28 +03:00
parent bdd660be01
commit 4452bccfa6
14 changed files with 261 additions and 112 deletions

View File

@@ -183,11 +183,8 @@ end
function Quaternion:temp( x, y, z, w )
local object = tempPool[ curTemp ]
curTemp = curTemp + 1
if TEMP_COUNT < curTemp then
curTemp = 1
end
curTemp = curTemp < TEMP_COUNT and curTemp + 1 or 1
object.x = x or 0
object.y = y or 0
@@ -199,11 +196,8 @@ end
function Quaternion:tempT( t )
local object = tempPool[ curTemp ]
curTemp = curTemp + 1
if TEMP_COUNT < curTemp then
curTemp = 1
end
curTemp = curTemp < TEMP_COUNT and curTemp + 1 or 1
object.x, object.y, object.z, object.w = table.unpack( t )
@@ -212,11 +206,8 @@ end
function Quaternion:tempQ( q )
local object = tempPool[ curTemp ]
curTemp = curTemp + 1
if TEMP_COUNT < curTemp then
curTemp = 1
end
curTemp = curTemp < TEMP_COUNT and curTemp + 1 or 1
object.x = q.x
object.y = q.y