Skip to content

Commit

Permalink
Update Game Pieces
Browse files Browse the repository at this point in the history
  • Loading branch information
nab138 committed Dec 21, 2024
1 parent 2552305 commit d4198cf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ jobs:
uses: actions/checkout@v4

- name: Setup Theos
uses: Randomblock1/theos-action@v1
uses: nab138/theos-action@main
with:
theos-src: "https://github.com/nab138/theos"
# cache-dir-theos: ${{ github.workspace }}/theos
# cache-dir-sdks: ${{ github.workspace }}/theos/sdks
cache-dir-theos: ${{ github.workspace }}/theos
cache-dir-sdks: ${{ github.workspace }}/theos/sdks

- name: Cache Visp3 Framework
uses: actions/cache@v4
Expand Down
15 changes: 10 additions & 5 deletions src/utils/ARSceneView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,18 @@ class ARSceneView: ARSCNView {
}
gamePieceNodes = Array(gamePieceNodes.prefix(points.count))
}
if points.count > gamePieceNodes.count {
for i in gamePieceNodes.count..<points.count {
let gamePieceNode = gamePieceModel.clone()
gamePieceNode.position = points[i]
gamePieceNodes.append(gamePieceNode)
scene.rootNode.addChildNode(gamePieceNode)
}
}

// Place instances of the model at each location
for point in points {
let gamePieceNode = gamePieceModel.clone()
gamePieceNode.position = point
gamePieceNodes.append(gamePieceNode)
scene.rootNode.addChildNode(gamePieceNode)
for i in 0..<points.count {
gamePieceNodes[i].position = points[i]
}

// Update transforms
Expand Down

0 comments on commit d4198cf

Please sign in to comment.