void LateUpdate() { IMDraw.Axis3D(Vector3.zero, Quaternion.identity, 1000f, 0.2f); IMDraw.LabelShadowed(Screen.width / 2f, 10f, Color.white, LabelPivot.UPPER_CENTER, LabelAlignment.CENTER, "EXAMPLE SCENE 2: COLLIDERS & CONTACT POINTS"); IMDraw.LabelShadowed(10f, Screen.height - 10f, Color.white, LabelPivot.LOWER_LEFT, LabelAlignment.LEFT, m_Controls); }
public void Tick(World model) { IMDraw.Axis3D(Vector3.zero, Quaternion.identity, 1000f, 0.2f); IMDraw.Grid3D(Vector3.zero, Quaternion.identity, 5f, 5f, 10, 10, new Color(1f, 1f, 1f, 0.5f)); foreach (var p in model.points.Values) { if (model.debugSettings.isShowingNodes) { GraphicsService.DrawCube(p.pos.Vector3(), Vector3.one * 0.25f, Config.Colors.Blue); GraphicsService.DrawLabel(p.pos.Vector3(), Config.Colors.White, p.id.ToString() + "\n" + p.pos.ToString()); } float y = 0f; foreach (var c in p.colors) { y += 0.2f; GraphicsService.DrawCube( p.pos.Vector3() + new Vector3(0.2f, 0f, y - 0.2f), Vector3.one * 0.1f, ColorService.GetUnityColor(c) ); } } foreach (var c in model.connections.Values) { Point fromPoint = PointService.GetPointWithId(model, c.fromPointId); Point toPoint = PointService.GetPointWithId(model, c.toPointId); var color = ColorService.GetUnityColor(c.color); color.a = 0.75f; GraphicsService.DrawLine3D(fromPoint.pos.Vector3(), toPoint.pos.Vector3(), 0.1f, color); if (model.debugSettings.isShowingConnectionInfo) { GraphicsService.DrawLabel( Vector.Lerp(fromPoint.pos, toPoint.pos, 0.5f).Vector3(), Config.Colors.White, c.id.ToString() ); } } Color trainColor = ColorService.GetUnityColor(model.train.nextColor); GraphicsService.DrawCube(model.train.pos.Vector3(), Vector3.one * 0.5f, trainColor); GraphicsService.DrawLabel(model.train.pos.Vector3(), trainColor, "TRAIN" + "\n" + model.train.toGridPos); }
void LateUpdate() { IMDraw.Axis3D(Vector3.zero, Quaternion.identity, 100f, 0.2f); float deltaTime = Time.deltaTime; m_TestList[m_TestIndex].Execute(deltaTime); float screenHeight = Screen.height; IMDraw.LabelShadowed(Screen.width / 2f, 10f, Color.white, LabelPivot.UPPER_CENTER, LabelAlignment.CENTER, "EXAMPLE SCENE 3: API TEST"); IMDraw.LabelShadowed(Screen.width / 2f, 24f, Color.white, LabelPivot.UPPER_CENTER, LabelAlignment.CENTER, m_TestTitle); IMDraw.LabelShadowed(10f, screenHeight - 10f, Color.white, LabelPivot.LOWER_LEFT, LabelAlignment.LEFT, m_Controls); }
void LateUpdate() { //float screenWidth = Screen.width; float screenHeight = Screen.height; float deltaTime = Time.deltaTime; m_EulerRotation.x += deltaTime * 90f; m_EulerRotation.x = Mathf.Repeat(m_EulerRotation.x, 360f); m_EulerRotation.z = m_EulerRotation.y = m_EulerRotation.x; m_RotationY = Mathf.Repeat(m_RotationY + (deltaTime * 45f), 360f); Vector3 origin = Vector3.zero; Vector3 position; Quaternion objectRotation = Quaternion.Euler(m_EulerRotation); Quaternion rotation = Quaternion.Euler(0f, m_RotationY, 0f); IMDraw.Axis3D(Vector3.zero, Quaternion.identity, 100f, 1f); IMDraw.Grid3D(Vector3.zero, Quaternion.identity, 5f, 5f, 10, 10, new Color(1f, 1f, 1f, 0.5f)); position = origin + (rotation * new Vector3(-2f, 2f, 0f)); IMDraw.Quad3D(position, objectRotation, 1f, 1f, m_TestAxis, ToColor(m_ColorQuad, 0.25f)); IMDraw.Grid3D(position, objectRotation, 1f, 1f, 1, 1, m_TestAxis, m_ColorQuad); IMDraw.LabelShadowed(position, m_ColorQuad, LabelPivot.MIDDLE_CENTER, LabelAlignment.CENTER, "QUAD"); position = origin + (rotation * new Vector3(0f, 2f, 0f)); IMDraw.Box3D(position, objectRotation, new Vector3(1f, 1f, 1f), ToColor(m_ColorBox, 0.25f)); IMDraw.WireBox3D(position, objectRotation, new Vector3(1f, 1f, 1f), m_ColorBox); IMDraw.LabelShadowed(position, m_ColorBox, LabelPivot.MIDDLE_CENTER, LabelAlignment.CENTER, "BOX"); position = origin + (rotation * new Vector3(2f, 2f, 0f)); float pyramidHeight = 1f, pyramidWidth = 0.5f; IMDraw.Pyramid3D(position, objectRotation, pyramidHeight, pyramidWidth, m_TestAxis, ToColor(m_ColorPyramid, 0.25f)); IMDraw.WirePyramid3D(position, objectRotation, pyramidHeight, pyramidWidth, m_TestAxis, m_ColorPyramid); IMDraw.LabelShadowed(position, m_ColorPyramid, LabelPivot.MIDDLE_CENTER, LabelAlignment.CENTER, "PYRAMID"); position = origin + (rotation * new Vector3(0f, 2f, 2f)); float rhombusHeight = 2f, rhombusWidth = 0.75f; IMDraw.Rhombus3D(position, objectRotation, rhombusHeight, rhombusWidth, m_TestAxis, ToColor(m_ColorRhombus, 0.25f)); IMDraw.WireRhombus3D(position, objectRotation, rhombusHeight, rhombusWidth, m_TestAxis, m_ColorRhombus); IMDraw.LabelShadowed(position, m_ColorRhombus, LabelPivot.MIDDLE_CENTER, LabelAlignment.CENTER, "RHOMBUS"); position = origin + (rotation * new Vector3(0f, 2f, -2f)); IMDraw.Disc3D(position, objectRotation, 0.5f, m_TestAxis, ToColor(m_ColorDisc, 0.25f)); IMDraw.WireDisc3D(position, objectRotation, 0.5f, m_TestAxis, m_ColorDisc); IMDraw.LabelShadowed(position, m_ColorDisc, LabelPivot.MIDDLE_CENTER, LabelAlignment.CENTER, "DISC"); position = origin + (rotation * new Vector3(0f, -2f, 0f)); IMDraw.WireSphere3D(position, objectRotation, 0.5f, m_ColorSphere); IMDraw.Sphere3D(position, objectRotation, 0.5f, ToColor(m_ColorSphere, 0.25f)); IMDraw.LabelShadowed(position, m_ColorSphere, LabelPivot.MIDDLE_CENTER, LabelAlignment.CENTER, "SPHERE"); position = origin + (rotation * new Vector3(2f, -2f, 0f)); IMDraw.Cylinder3D(position, objectRotation, 2f, 0.25f, IMDrawAxis.X, ToColor(m_ColorCylinder, 0.25f)); IMDraw.WireCylinder3D(position, objectRotation, 2f, 0.25f, IMDrawAxis.X, ToColor(m_ColorCylinder, 0.25f)); IMDraw.LabelShadowed(position, m_ColorCylinder, LabelPivot.MIDDLE_CENTER, LabelAlignment.CENTER, "CYLINDER"); position = origin + (rotation * new Vector3(-2f, -2f, 0f)); IMDraw.Capsule3D(position, objectRotation, 2f, 0.25f, IMDrawAxis.Y, ToColor(m_ColorCapsule, 0.25f)); IMDraw.WireCapsule3D(position, objectRotation, 2f, 0.25f, IMDrawAxis.Y, m_ColorCapsule); IMDraw.LabelShadowed(position, m_ColorCapsule, LabelPivot.MIDDLE_CENTER, LabelAlignment.CENTER, "CAPSULE"); position = origin + (rotation * new Vector3(0f, -2f, 2f)); Vector3 ellipsoidSize = new Vector3(2f, 1f, 1f); IMDraw.Ellipsoid3D(position, objectRotation, ellipsoidSize, ToColor(m_ColorEllipsoid, 0.25f)); IMDraw.WireEllipsoid3D(position, objectRotation, ellipsoidSize, m_ColorEllipsoid); IMDraw.LabelShadowed(position, m_ColorEllipsoid, LabelPivot.MIDDLE_CENTER, LabelAlignment.CENTER, "ELLIPSOID"); position = origin + (rotation * new Vector3(0f, -2f, -2f)); IMDraw.Cone3D(position, objectRotation, 1f, 0.5f, m_TestAxis, ToColor(m_ColorCone, 0.25f)); IMDraw.WireCone3D(position, objectRotation, 1f, 0.5f, m_TestAxis, m_ColorCone); IMDraw.LabelShadowed(position, m_ColorCone, LabelPivot.MIDDLE_CENTER, LabelAlignment.CENTER, "CONE"); if (m_TestParticleSystemRenderer != null) { IMDraw.Bounds(m_TestParticleSystemRenderer.bounds, Color.green); } IMDraw.LabelShadowed(Screen.width / 2f, 10f, Color.white, LabelPivot.UPPER_CENTER, LabelAlignment.CENTER, "EXAMPLE SCENE 1: PRIMITIVES & LABELS"); IMDraw.LabelShadowed(10f, screenHeight - 10f, Color.white, LabelPivot.LOWER_LEFT, LabelAlignment.LEFT, m_Controls); }