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.

Spatial mapping issue

Hi to everyone,

I want to move objects and place it on real objects e.g. a table.
Therefore I used the Manipulated Function to move objects after made the pressed gesture.
When I use the the ready gesture I'm able to touch the object.
In both cases I use Trigger events to interact with the hologram.

Now I want to move the object and put it on a table.
As a preparation I made the spatial mapping tutorials but I didn't want to use the gaze for the placement.
When I tried to place the object e.g a table it fell downwards to infinity.

Do you have some hints to solve this issue ?



Best Answers


  • Options
    dbarrettdbarrett ✭✭✭

    When you make an object a trigger, it no longer collides with other objects and they can pass through them.

    AR Developer

  • Options

    @dbarrett and @Sopheareach_Te thank you for your hints. ;)
    I have another question I want to prevent my cube to go into the spatial mesh.
    At the tim, my cube has a rigidbody and a collider upon it. I got the collision info via TriggerEvent like I did it for the ready and the tapped gesture to interact with the cube.
    For the movement of the cube and the ready/ pressed gesture icon I used the transform.position.
    Do you know how I could prevent that the object gets into the spatial mesh of real objects?

  • Options

    @dbarrett I tested it already with the rigidbody.moveposition but this didn't work, the GO got also through the spatial map. I tried also Add Force, that works but I got 1 vector3 object with the actual coordinates and the GO has to move to that position.
    I also working with adding a velocity but this isn't that good.
    Do you further methods?

  • Options
    dbarrettdbarrett ✭✭✭

    Make sure you have interpolation set to Interpolate and Collision Detection set to Continuous Dynamic.

    AR Developer

  • Options

    I set the interpolate and the Collision Detection like you suggested but it moves trough the mesh :(

  • Options

    The cube is also bouncing up and down..

  • Options

    From what you mentioned, I guess you make the cube move back whenever it collides with the spatial mesh but the cube has the velocity so it will eventually fell back into the spatial mesh. This will create a loop of collision back and forth between the cube and spatial mesh. I recommend to check spatial mesh collider. Since if two objects have collider then they won't go through each other and there is no need to set it move back when it collides with each other. if it still go into each other, you might resize the cube collider a bit then I guess it will work out.

  • Options

    @Sopheareach_Te I tested two versions. In the first one I applied a velocity at the cube and when the cube collides with the spatial map the cube velocity will be set to 0.

    In the second one I moved it only with the rigidbody.MovePosition.

    Could be the problem that I set the cube to the coordinates of the hand with TryGetPosition and on the other handside I apply the motion to the rigidbody?

  • Options

    @ChristophMarko Could you give me more detail regard to set the cube to coordinates of the hand? Is it a hand GameObject or spatial mesh of your hand? If possible attach an image of the issue would be great.

  • Options

    I set the coordinates of the cube depending on the position of the hand with the following code:

    obj.state.sourcePose.TryGetPosition(out position_hand);


    hand_vec = new Vector3(position_hand.x, position_hand.y, position_hand.z);

    pos_z = position_hand.z + (float)(1.1);
    cube_vec = new Vector3(position_hand.x, position_hand.y, pos_z);

    cube_rig = cube.gameObject.GetComponent();

    cube_rig.collisionDetectionMode = CollisionDetectionMode.ContinuousDynamic;

    cube_rig.interpolation = RigidbodyInterpolation.Interpolate;


    pressed.transform.position = new Vector3(position_hand.x , position_hand.y , position_hand.z + 1 );

    I used for the hand the CursorWithFeedback gameobject.

  • Options

    Here is the attached file of the issue ;)

Sign In or Register to comment.