Skip to content

Commit

Permalink
Update for recent change to ARHeadsetKit
Browse files Browse the repository at this point in the history
  • Loading branch information
philipturner committed Oct 20, 2021
1 parent 191e67d commit 273425c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ extension PendulumInterface.Anchor: RayTraceable {

func trace(ray worldSpaceRay: RayTracing.Ray) -> Float? {
let testRay = worldSpaceRay.transformedIntoBoundingBox(boundingBox)
guard testRay.passesInitialBoundingBoxTest(), testRay.getCentralCubeProgress() != nil else {
guard testRay.passesInitialBoundingBoxTest(), testRay.getCubeProgress() != nil else {
return nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ extension PendulumRenderer {
let inverseScale = simd_float3(diameterReciprocal, diameterReciprocal, pendulumWidthReciprocal)
let testRay = RayTracing.Ray(origin: modelSpaceOrigin * inverseScale, direction: modelSpaceDirection * inverseScale)

guard testRay.passesInitialBoundingBoxTest(), testRay.getCentralCylinderProgress() != nil else {
guard testRay.passesInitialBoundingBoxTest(), testRay.getCylinderProgress() != nil else {
return nil
}
}
Expand Down Expand Up @@ -219,7 +219,7 @@ extension PendulumRenderer {
func testBox(_ boundingBox: simd_float2x3) -> Bool {
let transformedRay = modelSpaceRay.transformedIntoBoundingBox(boundingBox)

if transformedRay.passesInitialBoundingBoxTest(), transformedRay.getCentralCubeProgress() != nil {
if transformedRay.passesInitialBoundingBoxTest(), transformedRay.getCubeProgress() != nil {
return true
} else {
return false
Expand Down Expand Up @@ -293,7 +293,7 @@ extension PendulumRenderer {
let inverseScale = simd_float3(.init(repeating: jointDiameterReciprocal), inverseScaleZ)
let testRay = flip(RayTracing.Ray(origin: testOrigin * inverseScale, direction: testDirection * inverseScale))

if testRay.passesInitialBoundingBoxTest(), let progress = testRay.getCentralCylinderProgress() {
if testRay.passesInitialBoundingBoxTest(), let progress = testRay.getCylinderProgress() {
return progress
} else {
return nil
Expand Down Expand Up @@ -334,7 +334,7 @@ extension PendulumRenderer {
let inverseScale = rectangleInverseScale
let testRay = RayTracing.Ray(origin: testOrigin * inverseScale, direction: testDirection * inverseScale)

if testRay.passesInitialBoundingBoxTest(), let progress = testRay.getCentralCubeProgress() {
if testRay.passesInitialBoundingBoxTest(), let progress = testRay.getCubeProgress() {
return progress
} else {
return nil
Expand Down

0 comments on commit 273425c

Please sign in to comment.