Skip to content

Commit

Permalink
Merge pull request #3 from maxxfrazer/ruitext
Browse files Browse the repository at this point in the history
RealityUI Text v1.1.0
  • Loading branch information
maxxfrazer authored Dec 17, 2020
2 parents b083f72 + bcda04b commit ec938ec
Show file tree
Hide file tree
Showing 15 changed files with 369 additions and 109 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ The User Interface controls in this repository so far are made to be familiar to
- Swift 5.2
- Xcode 11

RUISlider gestures are not working with macOS currently.

## Content

- [Installation](#installation)
Expand Down Expand Up @@ -68,7 +66,7 @@ RUISlider uses `.pan`, but I would just recommend using `.all` to avoid issues,

For the sake of all these examples, the _Simple_ heading will create an Entity with no custom properties or callbacks, and for _Functional_, imagine there is a `ModelEntity` in the scene which we can reference from the variable `adjustmentCuboid`.

By default all RealityUI Entities are quite large. This is used to standardize the sizes so that you always know what to expect. For example, all UI thumbs are spheres with a diameter of 1 meter, which is 1 unit in RealityKit, ± any padding adjustments. All RealityUI Entities face `[0, 0, 1]` by default, in the same way as a ModelEntity with a [plane mesh](https://developer.apple.com/documentation/realitykit/meshresource/3244419-generateplane).
By default all RealityUI Entities are quite large. This is used to standardize the sizes so that you always know what to expect. For example, all UI thumbs are spheres with a diameter of 1 meter, which is 1 unit in RealityKit, ± any padding adjustments. All RealityUI Entities face `[0, 0, -1]` by default. To have them point at the user camera, or `.zero`, you can use the [`.look(at:,from:,relativeTo:)`](https://developer.apple.com/documentation/realitykit/entity/3244094-look) method like so: `.look(at: .zero, from: [0, 0, 1])`. Or if you want it to turn around straight away if you've positioned it at `[0, 0, -1]`, set the orientation to `simd_quatf(angle: .pi, axis: [0, 1, 0])`. Using the [.look()](https://developer.apple.com/documentation/realitykit/entity/3244094-look) method works here by setting the `at:` value to the direction the button should be used from.

## RUISwitch Creation

Expand Down
67 changes: 50 additions & 17 deletions RealityUI+Examples/RealityUI+Examples.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,18 @@
F3414195246FF540006B1ECA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F3414194246FF540006B1ECA /* Assets.xcassets */; };
F3414198246FF540006B1ECA /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F3414196246FF540006B1ECA /* LaunchScreen.storyboard */; };
F34141B12471A595006B1ECA /* ShowTime in Frameworks */ = {isa = PBXBuildFile; productRef = F34141B02471A595006B1ECA /* ShowTime */; };
F37D9C9E2482E88200AF5A5F /* RealityUI in Frameworks */ = {isa = PBXBuildFile; productRef = F37D9C9D2482E88200AF5A5F /* RealityUI */; };
F38598C2247AE28F007BBC88 /* Entity+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F38598C1247AE28F007BBC88 /* Entity+Extensions.swift */; };
F3DB9D81247D8BF8006D6CE5 /* ViewController+NonRealityUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3DB9D80247D8BF8006D6CE5 /* ViewController+NonRealityUI.swift */; };
F3F68530256BB91D0090A6C0 /* RUIText.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3F68526256BB91D0090A6C0 /* RUIText.swift */; };
F3F68531256BB91D0090A6C0 /* RealityUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3F68527256BB91D0090A6C0 /* RealityUI.swift */; };
F3F68532256BB91D0090A6C0 /* RUILongTouchGestureRecognizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3F68528256BB91D0090A6C0 /* RUILongTouchGestureRecognizer.swift */; };
F3F68533256BB91D0090A6C0 /* RUIStepper.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3F68529256BB91D0090A6C0 /* RUIStepper.swift */; };
F3F68534256BB91D0090A6C0 /* RUISwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3F6852A256BB91D0090A6C0 /* RUISwitch.swift */; };
F3F68535256BB91D0090A6C0 /* HasPivotTouch.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3F6852B256BB91D0090A6C0 /* HasPivotTouch.swift */; };
F3F68536256BB91D0090A6C0 /* RUIButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3F6852C256BB91D0090A6C0 /* RUIButton.swift */; };
F3F68537256BB91D0090A6C0 /* HasRUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3F6852D256BB91D0090A6C0 /* HasRUI.swift */; };
F3F68538256BB91D0090A6C0 /* HasClick.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3F6852E256BB91D0090A6C0 /* HasClick.swift */; };
F3F68539256BB91D0090A6C0 /* RUISlider.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3F6852F256BB91D0090A6C0 /* RUISlider.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -28,6 +37,16 @@
F3414199246FF540006B1ECA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
F38598C1247AE28F007BBC88 /* Entity+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Entity+Extensions.swift"; sourceTree = "<group>"; };
F3DB9D80247D8BF8006D6CE5 /* ViewController+NonRealityUI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ViewController+NonRealityUI.swift"; sourceTree = "<group>"; };
F3F68526256BB91D0090A6C0 /* RUIText.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RUIText.swift; path = ../../../Sources/RealityUI/RUIText.swift; sourceTree = "<group>"; };
F3F68527256BB91D0090A6C0 /* RealityUI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RealityUI.swift; path = ../../../Sources/RealityUI/RealityUI.swift; sourceTree = "<group>"; };
F3F68528256BB91D0090A6C0 /* RUILongTouchGestureRecognizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RUILongTouchGestureRecognizer.swift; path = ../../../Sources/RealityUI/RUILongTouchGestureRecognizer.swift; sourceTree = "<group>"; };
F3F68529256BB91D0090A6C0 /* RUIStepper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RUIStepper.swift; path = ../../../Sources/RealityUI/RUIStepper.swift; sourceTree = "<group>"; };
F3F6852A256BB91D0090A6C0 /* RUISwitch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RUISwitch.swift; path = ../../../Sources/RealityUI/RUISwitch.swift; sourceTree = "<group>"; };
F3F6852B256BB91D0090A6C0 /* HasPivotTouch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HasPivotTouch.swift; path = ../../../Sources/RealityUI/HasPivotTouch.swift; sourceTree = "<group>"; };
F3F6852C256BB91D0090A6C0 /* RUIButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RUIButton.swift; path = ../../../Sources/RealityUI/RUIButton.swift; sourceTree = "<group>"; };
F3F6852D256BB91D0090A6C0 /* HasRUI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HasRUI.swift; path = ../../../Sources/RealityUI/HasRUI.swift; sourceTree = "<group>"; };
F3F6852E256BB91D0090A6C0 /* HasClick.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HasClick.swift; path = ../../../Sources/RealityUI/HasClick.swift; sourceTree = "<group>"; };
F3F6852F256BB91D0090A6C0 /* RUISlider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RUISlider.swift; path = ../../../Sources/RealityUI/RUISlider.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -36,7 +55,6 @@
buildActionMask = 2147483647;
files = (
F34141B12471A595006B1ECA /* ShowTime in Frameworks */,
F37D9C9E2482E88200AF5A5F /* RealityUI in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -67,13 +85,31 @@
F301D8A7247A62ED004AE1FA /* ViewController+RealityControls.swift */,
F3DB9D80247D8BF8006D6CE5 /* ViewController+NonRealityUI.swift */,
F38598C1247AE28F007BBC88 /* Entity+Extensions.swift */,
F3F68525256BB8FB0090A6C0 /* RealityUI */,
F3414194246FF540006B1ECA /* Assets.xcassets */,
F3414196246FF540006B1ECA /* LaunchScreen.storyboard */,
F3414199246FF540006B1ECA /* Info.plist */,
);
path = "RealityUI+Examples";
sourceTree = "<group>";
};
F3F68525256BB8FB0090A6C0 /* RealityUI */ = {
isa = PBXGroup;
children = (
F3F6852E256BB91D0090A6C0 /* HasClick.swift */,
F3F6852B256BB91D0090A6C0 /* HasPivotTouch.swift */,
F3F6852D256BB91D0090A6C0 /* HasRUI.swift */,
F3F68527256BB91D0090A6C0 /* RealityUI.swift */,
F3F6852C256BB91D0090A6C0 /* RUIButton.swift */,
F3F68528256BB91D0090A6C0 /* RUILongTouchGestureRecognizer.swift */,
F3F6852F256BB91D0090A6C0 /* RUISlider.swift */,
F3F68529256BB91D0090A6C0 /* RUIStepper.swift */,
F3F6852A256BB91D0090A6C0 /* RUISwitch.swift */,
F3F68526256BB91D0090A6C0 /* RUIText.swift */,
);
path = RealityUI;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand All @@ -93,7 +129,6 @@
name = "RealityUI+Examples";
packageProductDependencies = (
F34141B02471A595006B1ECA /* ShowTime */,
F37D9C9D2482E88200AF5A5F /* RealityUI */,
);
productName = "RealityUI+Examples";
productReference = F341418D246FF53E006B1ECA /* RealityUI+Examples.app */;
Expand Down Expand Up @@ -125,7 +160,6 @@
mainGroup = F3414184246FF53E006B1ECA;
packageReferences = (
F34141AF2471A595006B1ECA /* XCRemoteSwiftPackageReference "ShowTime" */,
F37D9C9C2482E88200AF5A5F /* XCRemoteSwiftPackageReference "/" */,
);
productRefGroup = F341418E246FF53E006B1ECA /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -174,11 +208,21 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F3F68534256BB91D0090A6C0 /* RUISwitch.swift in Sources */,
F3F68532256BB91D0090A6C0 /* RUILongTouchGestureRecognizer.swift in Sources */,
F3F68533256BB91D0090A6C0 /* RUIStepper.swift in Sources */,
F3F68538256BB91D0090A6C0 /* HasClick.swift in Sources */,
F3F68539256BB91D0090A6C0 /* RUISlider.swift in Sources */,
F38598C2247AE28F007BBC88 /* Entity+Extensions.swift in Sources */,
F3414193246FF53E006B1ECA /* ViewController.swift in Sources */,
F3F68531256BB91D0090A6C0 /* RealityUI.swift in Sources */,
F3F68536256BB91D0090A6C0 /* RUIButton.swift in Sources */,
F3F68537256BB91D0090A6C0 /* HasRUI.swift in Sources */,
F3F68535256BB91D0090A6C0 /* HasPivotTouch.swift in Sources */,
F3DB9D81247D8BF8006D6CE5 /* ViewController+NonRealityUI.swift in Sources */,
F301D8A8247A62ED004AE1FA /* ViewController+RealityControls.swift in Sources */,
F3414191246FF53E006B1ECA /* AppDelegate.swift in Sources */,
F3F68530256BB91D0090A6C0 /* RUIText.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -321,6 +365,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -338,6 +383,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -376,14 +422,6 @@
minimumVersion = 2.5.2;
};
};
F37D9C9C2482E88200AF5A5F /* XCRemoteSwiftPackageReference "/" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "file://../";
requirement = {
branch = main;
kind = branch;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
Expand All @@ -392,11 +430,6 @@
package = F34141AF2471A595006B1ECA /* XCRemoteSwiftPackageReference "ShowTime" */;
productName = ShowTime;
};
F37D9C9D2482E88200AF5A5F /* RealityUI */ = {
isa = XCSwiftPackageProductDependency;
package = F37D9C9C2482E88200AF5A5F /* XCRemoteSwiftPackageReference "/" */;
productName = RealityUI;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = F3414185246FF53E006B1ECA /* Project object */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import RealityKit

import RealityUI
//import RealityUI

class ContainerCube: Entity, HasPhysicsBody, HasModel {
private static var boxPositions: [SIMD3<Float>] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import RealityKit
import Foundation
import Combine

import RealityUI
//import RealityUI

class ControlsParent: Entity, HasAnchoring, HasCollision, HasModel, HasPivotTouch {
func updateMaterials() {}
Expand All @@ -22,6 +22,7 @@ class ControlsParent: Entity, HasAnchoring, HasCollision, HasModel, HasPivotTouc
self.anchoring = AnchoringComponent(.plane(
.horizontal, classification: .any, minimumBounds: [0.5, 0.5]
))
self.maxPivotDistance = 0.75
self.addControls()
/// Uncomment this to try out HasPivotTouch, but it's still in an experimental stage.
if let rotateImg = try? TextureResource.load(named: "rotato") {
Expand All @@ -46,7 +47,7 @@ class ControlsParent: Entity, HasAnchoring, HasCollision, HasModel, HasPivotTouc
)
button.transform = Transform(
scale: .init(repeating: 0.2),
rotation: simd_quatf(angle: -.pi / 2, axis: [1, 0, 0]),
rotation: simd_quatf(angle: .pi / 2, axis: [1, 0, 0]),
translation: .zero
)
self.addChild(button)
Expand All @@ -59,37 +60,37 @@ class ControlsParent: Entity, HasAnchoring, HasCollision, HasModel, HasPivotTouc
}
})
toggle.transform = Transform(
scale: .init(repeating: 0.15), rotation: .init(), translation: [0, 0.25, -0.25]
scale: .init(repeating: 0.15), rotation: .init(angle: .pi, axis: [0, 1, 0]), translation: [0, 0.25, -0.25]
)
self.addChild(toggle)

let slider = RUISlider(slider: SliderComponent(startingValue: 0.5, steps: 0)) { (slider, _) in
for child in self.tumblingCubes {
child.scale = .init(repeating: slider.value + 0.5)
}
self.tumblingCubes.forEach { $0.scale = .init(repeating: slider.value + 0.5)}
}
slider.transform = Transform(scale: .init(repeating: 0.1), rotation: .init(), translation: [0, 1.15, -0.25])
slider.transform = Transform(
scale: .init(repeating: 0.1),
rotation: .init(angle: .pi, axis: [0, 1, 0]),
translation: [0, 1.15, -0.25]
)
self.addChild(slider)

let minusPlusStepper = RUIStepper(upTrigger: { _ in
if self.tumblingCubes.count <= 8 {
self.spawnShape(with: SIMD3<Float>(repeating: slider.value + 0.5))
}
}, downTrigger: { _ in
self.removeCube()
})
}, downTrigger: { _ in self.removeCube() })
minusPlusStepper.transform = Transform(
scale: .init(repeating: 0.15), rotation: .init(), translation: [-0.5, 0.25, -0.25]
scale: .init(repeating: 0.15), rotation: .init(angle: .pi, axis: [0, 1, 0]), translation: [-0.5, 0.25, -0.25]
)
self.addChild(minusPlusStepper)

let shapeStepper = RUIStepper(style: .arrowLeftRight, upTrigger: { stepper in
self.shiftShape(1, on: stepper)
}, downTrigger: { stepper in
self.shiftShape(-1, on: stepper)
})
let shapeStepper = RUIStepper(
style: .arrowLeftRight,
upTrigger: { stepper in self.shiftShape(1, on: stepper) },
downTrigger: { stepper in self.shiftShape(-1, on: stepper) }
)
shapeStepper.transform = Transform(
scale: .init(repeating: 0.15), rotation: .init(), translation: [0.5, 0.25, -0.25]
scale: .init(repeating: 0.15), rotation: .init(angle: .pi, axis: [0, 1, 0]), translation: [0.5, 0.25, -0.25]
)
self.addChild(shapeStepper)
self.shiftShape(0, on: shapeStepper)
Expand All @@ -113,21 +114,22 @@ extension ViewController {
var anchorFoundCallback: Cancellable?
anchorFoundCallback = self.arView.scene.subscribe(
to: SceneEvents.AnchoredStateChanged.self, on: controlsAnchor, { anchorEvent in
if anchorEvent.isAnchored {
controlsAnchor.entityAnchored()
if ViewController.letRotate {
let visBounds = controlsAnchor.visualBounds(relativeTo: controlsAnchor)
print(visBounds.center)
controlsAnchor.collision = CollisionComponent(shapes: [
ShapeResource.generateBox(size: visBounds.extents * 1.1).offsetBy(translation: visBounds.center)
])
self.arView.installGestures(.rotation, for: controlsAnchor)
}
DispatchQueue.main.async {
anchorFoundCallback?.cancel()
if anchorEvent.isAnchored {
controlsAnchor.entityAnchored()
if ViewController.letRotate {
let visBounds = controlsAnchor.visualBounds(relativeTo: controlsAnchor)
controlsAnchor.collision = CollisionComponent(shapes: [
ShapeResource.generateBox(size: visBounds.extents * 1.1).offsetBy(translation: visBounds.center)
])
self.arView.installGestures(.rotation, for: controlsAnchor)
}
DispatchQueue.main.async { anchorFoundCallback?.cancel() }
}
}
})
)
self.arView.scene.addAnchor(controlsAnchor)
let textAbove = RUIText(with: "RealityUI")
textAbove.look(at: [0, 1.5, 0], from: [0, 1.5, -1], relativeTo: nil)
controlsAnchor.addChild(textAbove)
}
}
2 changes: 1 addition & 1 deletion RealityUI+Examples/RealityUI+Examples/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
import RealityKit
import ARKit

import RealityUI
//import RealityUI

class ViewController: UIViewController {

Expand Down
5 changes: 0 additions & 5 deletions Sources/RealityUI/HasClick.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
//

import RealityKit
#if os(iOS)
import UIKit
#elseif os(macOS)
import AppKit
#endif

public protocol HasClick: HasRUI, HasCollision {
var tapAction: ((HasClick, SIMD3<Float>?) -> Void)? {get set}
Expand Down
16 changes: 12 additions & 4 deletions Sources/RealityUI/HasPivotTouch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ public struct PivotComponent: Component {
internal var lastTouchAngle: Float?
internal var lastGlobalPosition: SIMD3<Float> = .zero
public var pivotAxis: SIMD3<Float>
public init(pivot: SIMD3<Float> = [0, 1, 0]) {
self.pivotAxis = pivot
public var maxPivotDistance: Float?
public init(pivotAxis: SIMD3<Float> = [0, 1, 0], maxPivotDistance: Float? = nil) {
self.pivotAxis = pivotAxis
self.maxPivotDistance = maxPivotDistance
}
}

internal extension HasPivotTouch {
public extension HasPivotTouch {
var pivotRotation: simd_quatf {
simd_quaternion(self.pivotAxis, [0, 1, 0])
}
Expand All @@ -61,7 +63,13 @@ internal extension HasPivotTouch {
get { self.pivotTouch.pivotAxis }
set { self.pivotTouch.pivotAxis = newValue }
}
var lastGlobalPosition: SIMD3<Float> {

/// Maximum distance away from the center of the object where the pivot touch is active
var maxPivotDistance: Float? {
get { self.pivotTouch.maxPivotDistance }
set { self.pivotTouch.maxPivotDistance = newValue }
}
internal var lastGlobalPosition: SIMD3<Float> {
get { self.pivotTouch.lastGlobalPosition }
set { self.pivotTouch.lastGlobalPosition = newValue }
}
Expand Down
5 changes: 5 additions & 0 deletions Sources/RealityUI/HasRUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ internal extension HasRUI {
func getModel(part: String) -> ModelEntity? {
self.findEntity(named: part) as? ModelEntity
}
func ruiOrientation() {
if let startOrient = RealityUI.startingOrientation {
self.orientation = startOrient
}
}
func addModel(part: String) -> ModelEntity {
if let modelPart = self.getModel(part: part) {
return modelPart
Expand Down
7 changes: 4 additions & 3 deletions Sources/RealityUI/RUIButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import RealityKit
/// A RealityUI Button to be added to a RealityKit scene.
public class RUIButton: Entity, HasButton, HasModel, HasPhysics {

public var collisionPlane: float4x4? = nil
public var collisionPlane: float4x4?

public var touchUpCompleted: ((HasButton) -> Void)?

Expand All @@ -28,6 +28,7 @@ public class RUIButton: Entity, HasButton, HasModel, HasPhysics {
super.init()
self.RUI = RUI ?? RUIComponent()
self.button = button ?? ButtonComponent()
self.ruiOrientation()
self.makeModels()
}

Expand Down Expand Up @@ -192,13 +193,13 @@ internal extension HasButton {
var buttonOutPos: SIMD3<Float> {
return [
0, 0,
(self.button.size.z + self.innerBoxSize.z * (2 * extrude - 1)) / 2
-(self.button.size.z + self.innerBoxSize.z * (2 * extrude - 1)) / 2
]
}
var buttonInPos: SIMD3<Float> {
return [
0, 0,
(self.button.size.z + self.innerBoxSize.z * (2 * compress - 1)) / 2
-(self.button.size.z + self.innerBoxSize.z * (2 * compress - 1)) / 2
]
}

Expand Down
Loading

0 comments on commit ec938ec

Please sign in to comment.