public static void DrawBar(this RuntimeGizmoDrawer drawer, float amount, Vector3 position, Vector3 direction, Color color, float scale = 1f) { var thickness = 0.10f; drawer.color = color; drawer.PushMatrix(); drawer.matrix = Matrix4x4.TRS(position, Quaternion.LookRotation(direction), Vector3.one * scale); var bar = new Vector3(thickness, thickness, amount); drawer.DrawWireCube(amount * 0.5f * Vector3.forward, bar + (Vector3.one * thickness)); drawer.DrawCube(amount * 0.5f * Vector3.forward, bar); drawer.PopMatrix(); }
public static void DrawPose(this RuntimeGizmoDrawer drawer, Pose pose, float radius = 0.10f, bool drawCube = false) { drawer.PushMatrix(); drawer.matrix = Matrix4x4.TRS(pose.position, pose.rotation, Vector3.one); var origColor = drawer.color; //drawer.DrawWireSphere(Vector3.zero, radius); if (drawCube) { drawer.DrawCube(Vector3.zero, Vector3.one * radius * 0.3f); } drawer.DrawPosition(Vector3.zero, radius * 2); drawer.color = origColor; drawer.PopMatrix(); }