Last active
February 12, 2025 11:33
Robot View with pointer position control
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import SceneKit | |
import IndustrialKit | |
//... | |
struct RobotView: View | |
{ | |
//... | |
var body: some View | |
{ | |
VStack(spacing: 0) | |
{ | |
ObjectSceneView(scene: robot_scene, on_init: { scene_view in prepare_scene() }) | |
.frame(width: 280, height: 280) | |
.background | |
{ | |
Rectangle() | |
.fill(.thinMaterial) | |
.shadow(radius: 4) | |
} | |
PositionControl(location: $arm.pointer_location, rotation: $arm.pointer_rotation, scale: $arm.space_scale) | |
.frame(width: 320) | |
.disabled(arm.performed) | |
} | |
} | |
//... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment