First at all, I wanna to TANKS YOU. I'm really surprised to have a so nice and complet reply !!!!! Amazing !!!!!
I've create a new project to test your code, and I've a simple but unsolvable trouble, is XCode can't found SpatialTrackingSession : "Cannot find 'SpatialTrackingSession' in scope".
I've searched over the web and I've not found how to have it. Could you help me please ?
Cheers and THANKS !
Mathis
Post
Replies
Boosts
Views
Activity
Hello Apple,
Ok understand need to have VisionPro OS 2 and last XCode Beta.
I've no word, your sample runs very well and enjoy me. I can make many many things from this.
"I love you" !!!
Thanks and thanks and thanks !!!!
Mathis
Hello Apple,
Ok understand need to have VisionPro OS 2 and last XCode Beta.
I've no word, your sample runs very well and enjoy me. I can make many many things from this.
"I love you" !!!
Thanks and thanks and thanks !!!! Mathis
Hello Me again,
I've tried to change one ligne of your code to have ball in place of the cube. I've replaced
by: let throwable = ModelEntity(mesh: .generateSphere(radius: 0.1), materials: [SimpleMaterial(color: .red, isMetallic: true)])
and what's funny is the ball not roll when are o the ground, or, to be clear, they roll really strange :(
other test is to use my ball I've in my scene :
{
Set_Entity_Params( entity: temp, mass: 0.70, friction: kBoules_Friction, rebond: 0.0005, ralentissement: 1, mode: .static)
temp.components.set( ImageBasedLightComponent(source: .single( environmentLight!)))
temp.components.set( ImageBasedLightReceiverComponent( imageBasedLight: temp))
temp.isEnabled = true
mLesBoules.append( temp)
temp.generateCollisionShapes(recursive: true)
}
{
entity.components.set( InputTargetComponent( ))// Permet d'etre saisisable à la main
entity.components.set( GroundingShadowComponent(castsShadow: true))
var spherePhysics = PhysicsBodyComponent( massProperties: .init(mass: mass), material: .generate(staticFriction: friction, dynamicFriction: friction, restitution: rebond), mode: mode)
spherePhysics.isRotationLocked = (x:false, y:false, z:false)
spherePhysics.isContinuousCollisionDetectionEnabled = false
spherePhysics.angularDamping = 0.9 // rotation de fin de mouvement (+ il roule moins longtemps)
spherePhysics.linearDamping = ralentissement // amortissement linéaire : Plus le chiffre est haut moins la boule part loin (comme si le terrain etait sablonneux)
entity.components.set( spherePhysics)
}
And all running pretty well, I can get my ball in hand, move it, but when I release it from my hand, it disappeared :(
Linear impulse it pretty the same than I've with your cubes. But, I don't know why my ball goes very very far of me, also if I make no move, just drop it in place..
I hope you could help me because I've consumed this day and I begun to be crazy 8o(
Cheers and thanks for your help !!!
Mathis
Oppsss, it removed my first code line :(
if let temp = scene.findEntity(named: "Boule_A")
{
Set_Entity_Params( entity: temp, mass: 0.70, friction: kBoules_Friction, rebond: 0.0005, ralentissement: 1, mode: .static)
temp.components.set( ImageBasedLightComponent(source: .single( environmentLight!)))
temp.components.set( ImageBasedLightReceiverComponent( imageBasedLight: temp))
temp.isEnabled = true
mLesBoules.append( temp)
temp.generateCollisionShapes(recursive: true)
}
and the function :
func Set_Entity_Params( entity: Entity, mass: Float, friction: Float, rebond: Float, ralentissement: Float, mode: PhysicsBodyMode = .dynamic)
{
entity.components.set( InputTargetComponent( ))// Permet d'etre saisisable à la main
entity.components.set( GroundingShadowComponent(castsShadow: true))
var spherePhysics = PhysicsBodyComponent( massProperties: .init(mass: mass), material: .generate(staticFriction: friction, dynamicFriction: friction, restitution: rebond), mode: mode)
spherePhysics.isRotationLocked = (x:false, y:false, z:false)
spherePhysics.isContinuousCollisionDetectionEnabled = false
spherePhysics.angularDamping = 0.9 // rotation de fin de mouvement (+ il roule moins longtemps)
spherePhysics.linearDamping = ralentissement // amortissement linéaire : Plus le chiffre est haut moins la boule part loin (comme si le terrain etait sablonneux)
entity.components.set( spherePhysics)
}
Ok soled, I've changed the velocity index of "let forceMultiplier:Float = 2.0".
From my move, the hand (closed fingers) could be out of the Vision pro cameras (but it is always in scope when finger be opened). When the hand is out of Vision Camera, the code thinks the hand is opened. Existing a way to have the hand considering closed in this case please ?
Cheers and THANKS
Mathis
AMAZING !!!! big big big thanks !!!
Hello Sydney, that very good !!! it is possible to have the text window placed just over the ball, on top of it, on same place ?
Cheers and THANKS
Mathis
Other (last) little question : how to know if the user pinch on no object (empty space) ?
In fact, I've a balls in my environment. I would like to have the user to pinch one or other and display it distance to another central ball. He can pinch one ball, one other and one other and have information one by one, and when he want to not have information, he pinch in empty space.
Oki, little question : The windows opened is nice and readable. But if I move it away of me on my object, the window and it content are "smaller". Normal!
But on a normal glass window, when I move it away, the window size change but the contents is always readable (auto adaptation to have it readable)
How can I do that? existing automatic system to set for a window to have this automatic ?
Cheers
Mathis