2023 Spatial ComputingGraphics & Games
WWDC23 · 15 min · Spatial Computing / Graphics & Games
Bring your Unity VR app to a fully immersive space
Discover how you can bring your existing Unity VR apps and games to visionOS. We’ll explore workflows that can help you get started and show you how to build for eyes and hands in your apps and games with the Unity Input System. Learn about Unity’s XR Interaction Toolkit, tips for foveated rendering, and best practices.
Watch at developer.apple.com ↗Chapters
Code shown on screen · 1 snippet
Translate raw joints into gameplay actions
// Translate raw joints into gameplay actions
static bool IsIndexExtended(XRHand hand)
{
if (!(hand.GetJoint(XRHandJointID.Wrist).TryGetPose(out var wristPose) &&
hand.GetJoint(XRHandJointID.IndexTip).TryGetPose(out var tipPose) &&
hand.GetJoint(XRHandJointID.IndexIntermediate).TryGetPose(out var intermediatePose)))
{
return false;
}
var wristToTip = tipPose.position - wristPose.position;
var wristToIntermediate = intermediatePose.position - wristPose.position;
return wristToTip.sqrMagnitude > wristToIntermediate.sqrMagnitude;
} Resources
Related sessions
-
16 min -
18 min