first iteration
This commit is contained in:
parent
da9f955a59
commit
cccfc3a3dc
@ -272,9 +272,7 @@ do
|
|||||||
local tokenTemplate = tokenTemplates[loadTokenType]
|
local tokenTemplate = tokenTemplates[loadTokenType]
|
||||||
|
|
||||||
-- Take ONLY the Y-value for rotation, so we don't flip the token coming out of the bag
|
-- Take ONLY the Y-value for rotation, so we don't flip the token coming out of the bag
|
||||||
local rot = Vector(tokenTemplate.Transform.rotX,
|
local rot = Vector(tokenTemplate.Transform.rotX, 270, tokenTemplate.Transform.rotZ)
|
||||||
270,
|
|
||||||
tokenTemplate.Transform.rotZ)
|
|
||||||
if rotation ~= nil then
|
if rotation ~= nil then
|
||||||
rot.y = rotation.y
|
rot.y = rotation.y
|
||||||
end
|
end
|
||||||
@ -469,11 +467,20 @@ do
|
|||||||
---@return table: Array of global positions to spawn the clues at
|
---@return table: Array of global positions to spawn the clues at
|
||||||
internal.buildClueOffsets = function(card, count)
|
internal.buildClueOffsets = function(card, count)
|
||||||
local pos = card.getPosition()
|
local pos = card.getPosition()
|
||||||
|
local rot = card.getRotation()
|
||||||
local cluePositions = {}
|
local cluePositions = {}
|
||||||
for i = 1, count do
|
for i = 1, count do
|
||||||
local row = math.floor(1 + (i - 1) / 4)
|
local row = math.floor(1 + (i - 1) / 4)
|
||||||
local column = (i - 1) % 4
|
local column = (i - 1) % 4
|
||||||
table.insert(cluePositions, Vector(pos.x + 1.5 - 0.55 * row, pos.y + 0.15, pos.z - 0.825 + 0.55 * column))
|
local cluePos = Vector(pos.x + 1.5 - 0.55 * row, pos.y + 0.15, pos.z - 0.825 + 0.55 * column)
|
||||||
|
|
||||||
|
-- rotate clue offsets to card rotation
|
||||||
|
local lCluePos = card.positionToLocal(cluePos)
|
||||||
|
lCluePos:rotateOver("y", 270 - rot.y)
|
||||||
|
cluePos = card.positionToWorld(lCluePos)
|
||||||
|
|
||||||
|
-- add clue position to table
|
||||||
|
table.insert(cluePositions, cluePos)
|
||||||
end
|
end
|
||||||
return cluePositions
|
return cluePositions
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user