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.
Options

Hologram - spatial map collision

I am struggling with getting collision behavior similar to the Holograms app. I have looked closely at the Holograms app and it appears that they are using some sort of physics because the hologram will rotate if not aligned and pushed against a wall. But it doesn't appear that they are applying a force as the hologram moves with the gesture. I am transforming a model using manipulation similar to that app. I have tried using a rigid body and setting IsKinematic to false during the manipulation, but it doesn't, as documented, collide when transforming the position manually. Does anyone have a solution they have found or could provide a suggestion?

Tagged:

Answers

  • Options

    @bfichter,
    I would recommend taking a look at the Holograms 230 course in the Holographic Academy. This course covers Spatial Mapping and gives an example of placing objects on the mesh (Placeable.cs).

    The interesting code is in the Move() method where the Placeable script raycasts to the Spatial Mapping layer (defined as layer 31 in the project) and positions the hologram being placed just above / in front of the mesh (the hoverDistance value).

    Hope this helps!
    David

  • Options
    bfichterbfichter
    edited December 2016

    If I remember correctly, this is using gaze to place (I'll have to go back and look - forgive me if I'm wrong). I am using manipulation. I suppose I could cast a ray in the direction of travel of my model dictated by my manipulation and then stop if it is within a defined distance. Might work, seems a little hacky. Not like the Holograms app, but could work in a pinch.

  • Options

    @bfichter,
    Correct, Placeable uses gaze to move and place the Hologram. Adapting the logic to using the manipulation gesture could definitely be done.

    Thanks,
    David

  • Options

    @bfichter Were you able to get this working? I also need some help for the similar implementation.

  • Options
    ReeleyReeley ✭✭✭

    @hitesh_sharma dont know if you still need it, but i wanted to do a similar thing and edited the HandDraggable script to get kind of this behaviour.

    DragToMove script

    Basically it just does movement with forces, so it adds a rigidbody to the gameobject everytime you drag it and deletes this rb again when the dragging stops. Its far from perfect but maybe it will help :)

Sign In or Register to comment.