22 private Matrix4x4? overrideMatrix;
24 if (overrideMatrix !=
null) {
return overrideMatrix.Value; }
26 return Matrix4x4.identity;
31 else {
return (
b -
a).magnitude * 0.125f; }
37 Matrix4x4? overrideMatrix =
null)
46 this.overrideMatrix = overrideMatrix;
54 Matrix4x4? overrideMatrix =
null)
59 overrideMatrix: overrideMatrix);
68 Matrix4x4? overrideMatrix =
null)
73 overrideMatrix: overrideMatrix);
81 Matrix4x4? overrideMatrix =
null)
86 overrideMatrix: overrideMatrix);
89 public void DrawLines(System.Action<Vector3, Vector3> drawLine) {
92 var localLength = (
b -
a).magnitude;
93 if (localLength == 0f) { localLength = 0.0001f; }
94 var localDirection = (
b -
a) / localLength;
96 var circle =
new Geometry.Circle(
98 direction: localDirection,
102 var startPos =
matrix.MultiplyPoint3x4(
a);
103 var endPos =
matrix.MultiplyPoint3x4(
b);
106 drawLine(startPos, point);
107 drawLine(point, endPos);
110 drawLine(edge.a, edge.b);
static Bipyramid Arrowhead(Vector3 a, Vector3 b, int polySegments=6, float lengthFraction=0.38f, float? radiusFraction=0.16f, float? absoluteRadius=null, Transform transform=null, Matrix4x4? overrideMatrix=null)
Arrowhead defaults for a bipyramid. Can override any of the parameters like a normal bipyramid constr...
Bipyramid(Vector3 a, Vector3 b, int polySegments=6, float lengthFraction=0.5f, float? radiusFraction=null, float? absoluteRadius=null, Transform transform=null, Matrix4x4? overrideMatrix=null)
void DrawLines(System.Action< Vector3, Vector3 > drawLine)
static Bipyramid ModelBone(Vector3 a, Vector3 b, int polySegments=4, float lengthFraction=0.38f, float? radiusFraction=0.0125f, float? absoluteRadius=null, Transform transform=null, Matrix4x4? overrideMatrix=null)
Rig model bone defaults for a bipyramid. Can override any of the parameters like a normal bipyramid c...
static Bipyramid ThinArrow(Vector3 a, Vector3 b, int polySegments=4, float lengthFraction=0.3f, float? radiusFraction=null, float? absoluteRadius=0.005f, Transform transform=null, Matrix4x4? overrideMatrix=null)
Thin directed arrow, good for adding directionality to an edge between two points....