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.

TapToPlace Placement Surfaces Problems

Hello guys,

I use the TapToPlace and Placeable scripts from HoloToolkit to pick and place objects in my scene. The objects interact correctly with the Spatial Mesh of the room but not with each other. This interaction is however very important for my app since i want the user to be able to** place objects one on top of the other**. Physics should also work.

How can I add a third "Custom" option to the PlacementSurfaces of the Placeable, so that I can place an object on top of another object?
And secondly how can i activate and allow two PlacemantSurfaces at the same time, e.g. Horizontal + Custom?

Thanks in advance!

Answers

  • This is because your holograms don't currently have any colliders attached to them. Try to use Box, Sphere or Capsule colliders when possible because the at fast. If they don't look correct you can use a MeshCollider with the tradeoff being performance.

    Once you have applied colliders to your holograms, everything should work as expected.

    Our Holographic world is here

    RoadToHolo.com      WikiHolo.net      @jbienz
    I work in Developer Experiences at Microsoft. My posts are based on my own experience and don't represent Microsoft or HoloLens.

  • @jbienzms said:
    This is because your holograms don't currently have any colliders attached to them. Try to use Box, Sphere or Capsule colliders when possible because the at fast. If they don't look correct you can use a MeshCollider with the tradeoff being performance.

    Once you have applied colliders to your holograms, everything should work as expected.

    Thanks for the answer. Howerver, I have already assigned Colliders to my holograms and that didn´t work during Placing with TapToPlace.
    The solution that worked for me, as far as collisions are concerned, is to also add SpatialMappingColliders to all my holograms.

    Now i have the issue of not being able to place holograms one on top of the other, since Placeable does not allow it.
    In Placeable script i found:
    // Cast a ray from the center of the box collider face to the surface RaycastHit centerHit; if (!Physics.Raycast(facePoints[0], raycastDirection, out centerHit, maximumPlacementDistance, SpatialMappingManager.Instance.LayerMask))

    That part seems to ignore the SpatialMappingCollider i put on my holograms. How can I make the raycast also interact with my holograms so that I am able to "stack" them?

  • I am looking for the solution for this as well. would be good to now how to resolve it. Cheers.

  • Still no luck with this issue...I have also tried to create a new Layer for my Holograms and have the RaycastHit it but it didnt work.

  • Not a difficult one. Try change layermask: SpatialMappingManager.Instance.LayerMask | YOURLAYERMASK

  • @civitas said:
    Not a difficult one. Try change layermask: SpatialMappingManager.Instance.LayerMask | YOURLAYERMASK

    Hallo civitas. That should do the trick, but where should I put this code in Placeable?

  • This is not to difficult although it took me a few hours to figure it out myself. First I placed al my holograms on a layer named "Holograms". Then I created a layermask in TapToPlace.cs.

    private int hologramLayer;

    In the Start() function get the mask:

    hologramLayer = LayerMask.GetMask("Holograms");

    Search for this line in TapToPlace.cs:

    if (Physics.Raycast(headPosition, gazeDirection, out hitInfo, 30.0f, spatialMappingManager.LayerMask))

    And add your hologramlayer to it:

    if (Physics.Raycast(headPosition, gazeDirection, out hitInfo, 30.0f, spatialMappingManager.LayerMask | hologramLayer))

    To make sure the hologram doesn't collide with itself add this line bellow it:

    if (hitInfo.collider.gameObject != gameObject) {
    // do stuff
    }

    I hope this helps

Sign In or Register to comment.