3 namespace droid.Runtime.Utilities.Misc.Drawing {
6 public static partial class NeodroidDrawingUtilities {
14 public static void ForGizmo(Vector3 pos,
17 float arrow_head_length = 0.25f,
18 float arrow_head_angle = 20.0f) {
19 Gizmos.DrawRay(pos, direction);
20 NeodroidDrawingUtilitiesEnd(
true, pos, direction, color, arrow_head_length, arrow_head_angle);
31 public static void ForDebug(Vector3 pos,
34 float arrow_head_length = 0.25f,
35 float arrow_head_angle = 20.0f,
36 float ray_duration = 0f) {
37 if (ray_duration > 0) {
38 Debug.DrawRay(pos, direction, color, ray_duration);
40 Debug.DrawRay(pos, direction, color);
43 NeodroidDrawingUtilitiesEnd(
false,
52 static void NeodroidDrawingUtilitiesEnd(
bool gizmos,
56 float arrow_head_length = 0.25f,
57 float arrow_head_angle = 20.0f,
58 float ray_duration = 0f) {
59 var right = Quaternion.LookRotation(direction)
60 * Quaternion.Euler(arrow_head_angle, 0, 0)
62 var left = Quaternion.LookRotation(direction)
63 * Quaternion.Euler(-arrow_head_angle, 0, 0)
65 var up = Quaternion.LookRotation(direction) * Quaternion.Euler(0, arrow_head_angle, 0) * Vector3.back;
66 var down = Quaternion.LookRotation(direction)
67 * Quaternion.Euler(0, -arrow_head_angle, 0)
71 Gizmos.DrawRay(pos + direction, right * arrow_head_length);
72 Gizmos.DrawRay(pos + direction, left * arrow_head_length);
73 Gizmos.DrawRay(pos + direction, up * arrow_head_length);
74 Gizmos.DrawRay(pos + direction, down * arrow_head_length);
76 if (ray_duration > 0) {
77 Debug.DrawRay(pos + direction, right * arrow_head_length, color, ray_duration);
78 Debug.DrawRay(pos + direction, left * arrow_head_length, color, ray_duration);
79 Debug.DrawRay(pos + direction, up * arrow_head_length, color, ray_duration);
80 Debug.DrawRay(pos + direction, down * arrow_head_length, color, ray_duration);
82 Debug.DrawRay(pos + direction, right * arrow_head_length, color);
83 Debug.DrawRay(pos + direction, left * arrow_head_length, color);
84 Debug.DrawRay(pos + direction, up * arrow_head_length, color);
85 Debug.DrawRay(pos + direction, down * arrow_head_length, color);