oculus-samples / Unity-DepthAPI

Examples of using Depth API for real-time, dynamic occlusions
Other
192 stars 24 forks source link

What is the best way to dynamically add static objects into the scene, so that they are resting on the floor or on the walls or celling? #17

Closed PG13park closed 9 months ago

PG13park commented 9 months ago

This is more of a genral Scene question. But I am wondering how I can find the positions of the floor and walls and celling, so that I can randomly place an object on them. I would need to know the position of the planes normal x,y,z value and if the random position I choose on the plane is inside the players playspace.

TudorJude commented 9 months ago

This looks like your app requires some scene understanding. I recommend using MRUK, it's a great set of tools for this exact kind of thing. https://developer.oculus.com/downloads/package/meta-xr-mr-utility-kit-upm/

Alternatively, there's a simple use case in our samples. SceneAPIPlacement uses a raycaster to detect Walls. Look under the "Room Model" gameobject in that scene.

PG13park commented 9 months ago

I dont know why, but raycasting has not been workiong for me. Also I cant debug, because I have to build the app to play it. I will try out this toolkit though thank you very much

TudorJude commented 9 months ago

Did you scan your room beforehand? Entering the scene should normally prompt you to do that if you haven't.

BogomilP commented 9 months ago

This looks like your app requires some scene understanding. I recommend using MRUK, it's a great set of tools for this exact kind of thing. https://developer.oculus.com/downloads/package/meta-xr-mr-utility-kit-upm/

Alternatively, there's a simple use case in our samples. SceneAPIPlacement uses a raycaster to detect Walls. Look under the "Room Model" gameobject in that scene.

Oh wow...

MRUK?

Is this something new? I've been developing my MR first game on Unity for years and never seen this.

When going from the deprecated Oculus Integration to Meta Package Manager packages I also did not see this.

Do you possibly have any other tools such as this that have been obstructed from public view?

Maybe a blog post about MR fist tools?

TudorJude commented 9 months ago

Here's the blog post: https://developer.oculus.com/blog/introducing-mr-utility-kit-build-spatially-aware-apps-faster/

PG13park commented 9 months ago

I keep running into problems trying to import the new meta sdks. Heres the error I am getting : An error occurred while resolving packages: Project has invalid dependencies: com.meta.xr.sdk.all: Package [com.meta.xr.sdk.all@60.0.0] cannot be found

A re-import of the project may be required to fix the issue or a manual modification of C:/Parker/Unity/Mini Golf/Packages/manifest.json file.

Does anybody know the fix.

TudorJude commented 9 months ago

I'm not familiar with sdk.all oackage of the top of my head. Have you tried following the documentation? The only dependencies that depth api should need are meta.sdk.core v60 and the untiy xr.oculus package from unity.

PG13park commented 9 months ago

I figured it out I will try and use the MR Utilites thank you so much