Hello everyone.

We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.

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.

The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.

On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.

So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. 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. And always feel free to hit us up on Twitter @MxdRealityDev.

Prevent hologram from interacting with spatial mapped environment

I have a simple test, in which I have a hologram of a ball bouncing on a platform. I use spatial mapping to move the platform and place it in the environment. In unity the ball is a child of the platform so that when I move and place the platform the ball moves with it. However when I move the platform around, the ball interacts with the spatially mapped environment and gets distorted, deformed or thrown around. How do I prevent it from being affected by the environment and just continue bouncing on the platform. I have already implemented layer based collision detection and frozen some movement axis, but the ball continues to get distorted as soon as it hits any of the surfaces in the spatial environment.

Answers

  • Hey, @shekit

    One way would be to remove the spatial mapping collider altogether if you won't need it for something else.

    Another would be to disable cross-collisions between the layer where spatial mapping collider is (probably SpatialMapping) and the layer where you ball is (probably Default). This can be done in Edit->Project Settings->Physics->Layer Collision Matrix.

    https://docs.unity3d.com/Manual/LayerBasedCollision.html

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

  • Hey @stepan_stulov, thanks for the response! I do need spatial mapping for the platform, just don't need it for the ball bouncing on that platform.

    I did however follow your suggestion:

    • placed spatial mapping on its own layer
    • added the ball on its own layer
    • switched off collision between the spatial layer and ball layer
    • left collision on between the platform layer and spatial layer

    However the issue still persists, the ball still gets affected by the mapping.

  • This is the matrix if it helps.

    -The ball is on the nocollision layer
    -Spatial mapping is on the spatialmap layer
    -The platform(that the ball bounces on) is on layer1

  • Hey, @shekit

    SpatialMapping is a special beast. I usually create SpatialMapping layer at 31 and there are two places to specify that layer at: the first is the game object that contains the SpatialMappingCollider component and the second one something like Mesh Layer within the component itself. Don't forget both.

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

Sign In or Register to comment.