Search Unity

Unity Physics Visualizations?

Discussion in 'Physics for ECS' started by VolatileCoder, Nov 12, 2020.

  1. VolatileCoder

    VolatileCoder

    Joined:
    Sep 21, 2014
    Posts:
    18
    When will Unity.Physics support the Physics debugger? I've got issues with CompositeColliders created at runtime and I'm literally flying blind here.
     
  2. steveeHavok

    steveeHavok

    Joined:
    Mar 19, 2019
    Posts:
    481
    There is a 'Physics Debug Display' component that can draw colliders, aabbs, events etc. However, it is broken at the minute so results may vary. Alternatively, flip over to using the Havok Physics simulation back end and you can use the Havok Visual Debugger.
     
  3. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    723
    Broken as in "Does potentially not work at all"? I am trying to visualize a simple BoxCollider and can't get it to work with either Untiy Physics and Physics Debug Display or Havok Visual Debugger (as it fails to connect https://forum.unity.com/threads/case-1287632-havok-visual-debugger-fails-to-connect.994189/)


    Code (CSharp):
    1. var entityName  = $"Plane.{entityCount++.ToString()}";
    2. var entity = entityManager.CreateEntity();
    3. entityManager.SetName(entity, entityName);
    4. entityManager.AddComponent<PhysicsCollider>(entity);
    5. entityManager.AddComponent<LocalToWorld>(entity);
    6. var collider  = Unity.Physics.BoxCollider.Create(new BoxGeometry {
    7.                                                                      Center = float3.zero,
    8.                                                                      Orientation = quaternion.identity,
    9.                                                                      Size = new float3(1,1,1)
    10.                                                                  },
    11.                                                  CollisionFilter.Default,
    12.                                                  Unity.Physics.Material.Default);
    13. entityManager.SetComponentData(entity, new PhysicsCollider {Value = collider});
    14. entityManager.SetComponentData(entity, new LocalToWorld {Value =float4x4.TRS(new float3(0f,0f,0f),quaternion.identity, new float3(1f,1f,1f))});
    Does never show up and no Raycast does hit it.
     
  4. VolatileCoder

    VolatileCoder

    Joined:
    Sep 21, 2014
    Posts:
    18
    I got the Havok visual debugger working (you have to follow all the steps on the link above), but it also caused Unity to crash frequently.
     
  5. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    723