public override void OnDebugDraw() { Transform transform = CsgjsScript.Actor.Transform; Vector3 halfSize = HalfSize; Vector3 center = transform.TransformPoint(Center); Vector3 size = halfSize * transform.Scale; Vector2 sizeXY = new Vector2(size.X, size.Y); Vector2 sizeYZ = new Vector2(size.Y, size.Z); Vector2 sizeXZ = new Vector2(size.X, size.Z); CustomDebugDraw.DrawEllipse(center, transform.Orientation, sizeXZ, SelectionColor, 0, false); CustomDebugDraw.DrawEllipse(center, transform.Orientation * Quaternion.RotationZ(Mathf.PiOverTwo), sizeYZ, SelectionColor, 0, false); CustomDebugDraw.DrawEllipse(center, transform.Orientation * Quaternion.RotationX(Mathf.PiOverTwo), sizeXY, SelectionColor, 0, false); }
public override void OnDebugDraw() { Transform transform = CsgjsScript.Actor.Transform; Vector3 halfSize = HalfSize; Vector3 top = transform.TransformPoint(Center + Vector3.UnitY * halfSize.Y); Vector3 bottom = transform.TransformPoint(Center - Vector3.UnitY * halfSize.Y); Vector2 ellipseSize = new Vector2(halfSize.X * transform.Scale.X, halfSize.Z * transform.Scale.Z); CustomDebugDraw.DrawEllipse(top, transform.Orientation, ellipseSize, SelectionColor, 0, false); CustomDebugDraw.DrawEllipse(bottom, transform.Orientation, ellipseSize, SelectionColor, 0, false); Vector3 axisX = Vector3.UnitX * ellipseSize.X * transform.Orientation; Vector3 axisZ = Vector3.UnitZ * ellipseSize.Y * transform.Orientation; DebugDraw.DrawLine(top + axisX, bottom + axisX, SelectionColor, 0, false); DebugDraw.DrawLine(top - axisX, bottom - axisX, SelectionColor, 0, false); DebugDraw.DrawLine(top + axisZ, bottom + axisZ, SelectionColor, 0, false); DebugDraw.DrawLine(top - axisZ, bottom - axisZ, SelectionColor, 0, false); }