Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.

Unity gravity and spatial mapping "progress"/completion

Hi!
I have created a very simple app that uses the spatial mapping collider to generate my collider-mesh.. I then also have placed a simple cube in the scene.
The cube has a rigidbody and a box-collider and has useGravity = true.
Now to the problem...
Once I load the game in my Hololens.. the cube keeps falling "through" the floor, and my guess is that this is due to the fact that the spatial mapper has not been able to map my room in time, and therefore there is no mesh for the box to collide with.
I solved this temporarily by simply raycasting "downwards" from my box and if the raycast hits something.. then I enable the gravity for the rigidbody.. however.. I find that to be quite an "ugly" solution..
Is there anyway that I could get a status from the spatial mapper (for instance some sort of "progress" of how much has been "scanned".. or like a "complete"-event or something?

Answers

  • Honestly, your solution seems okay. If you dig into the scripts in the HoloToolkit for spatial mapping, you'll see that one piece of information you get is the bounding volume contained by any particular mesh. In theory you could enable the cube's gravity when a mesh is imported that would contain the cube, but that might not be sufficient. First, the cube might be in an empty area without a mesh at all. Second, the floor might not be contained in the volume and the cube would still have nothing to fall onto.

    What I would do is let the human decide when the space has been sufficiently mapped scanned and give them a voice command or button to tap that would enable physics on my scene.

    ===
    This post provided as-is with no warranties and confers no rights. Using information provided is done at own risk.

    (Daddy, what does 'now formatting drive C:' mean?)

  • Hi!

    Something important to always keep in mind is physics layers and "layer-based collision detection":
    https://docs.unity3d.com/Manual/LayerBasedCollision.html

    Might not be a solution for your problem but is relevant.

    Building the future of holographic navigation. We're hiring.

  • Hi guys,
    I have the same problem, in my case the gameobject (with rigidbody and collision collider on the layer default) fell trough the spatial mesh. The spatial mapping prefab is on layer 31 and I also assigned the layer to the spatial collision collider.
    Do you know how to fix this problem?

Sign In or Register to comment.