Constraint.drawArc(LineCanvas, UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.Vector3, bool, float)

Here are the examples of the csharp api Constraint.drawArc(LineCanvas, UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.Vector3, bool, float) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 View Source File : Constraint.cs
License : GNU General Public License v3.0
Project Creator : NoteCAD

void drawArcExtend(LineCanvas renderer, Vector3 p0, Vector3 p1,
                                 Vector3 c, Vector3 to, Vector3 vz,
                                 bool dash, float step) {
		float dd0 = Vector3.Dot(Vector3.Cross(p0 - c, p1 - c), vz);
		bool greater180 = dd0 < 0;
		Vector3 c0 = Vector3.Cross(to - c, p0 - c);
		Vector3 c1 = Vector3.Cross(to - c, p1 - c);
		float d0 = Vector3.Dot(c0, vz);
		float d1 = Vector3.Dot(c1, vz);
		
		if(greater180) {
			if(d0 < 0f || d1 > 0f) return;
		} else {
			if(!(d1 < 0f || d0 > 0f)) return;
		}
		
		Vector3 from = p0;
		if(length(to - p1) < length(to - p0)) from = p1;
		drawArc(renderer, from, to, c, vz, dash, step);
	}