/// 2 ------------- 3 /// / / /// 1 ------------ 4 public static GravityOverrideQuad DrawQuadWithBorders(ExtQuad quad, GravityOverrideQuad quadGravity, Color color, out bool hasChanged) { hasChanged = false; bool changed = hasChanged; float sizeLine = quad.LocalScale.magnitude / 35; float sizePoint = quad.LocalScale.magnitude / 30; Color colorFace = new Color(color.r, color.g, color.b, color.a * 0.5f); Color colorLine = new Color(color.r, color.g, color.b, color.a * 0.8f); quadGravity.Face1 = DrawQuadFace(quad, quadGravity.Face1, quad.AllowBottom, colorFace, out changed); hasChanged = (changed) ? true : hasChanged; quadGravity.Line1 = ExtGravityOverrideEditor.DrawLineTrunk(quadGravity.Line1, quad.P1, quad.P2, colorLine, sizeLine, out changed); hasChanged = (changed) ? true : hasChanged; quadGravity.Line2 = ExtGravityOverrideEditor.DrawLineTrunk(quadGravity.Line2, quad.P2, quad.P3, colorLine, sizeLine, out changed); hasChanged = (changed) ? true : hasChanged; quadGravity.Line3 = ExtGravityOverrideEditor.DrawLineTrunk(quadGravity.Line3, quad.P3, quad.P4, colorLine, sizeLine, out changed); hasChanged = (changed) ? true : hasChanged; quadGravity.Line4 = ExtGravityOverrideEditor.DrawLineTrunk(quadGravity.Line4, quad.P4, quad.P1, colorLine, sizeLine, out changed); hasChanged = (changed) ? true : hasChanged; quadGravity.Point1 = ExtGravityOverrideEditor.DrawPoint(quadGravity.Point1, quad.P1, color, sizePoint, out changed); hasChanged = (changed) ? true : hasChanged; quadGravity.Point2 = ExtGravityOverrideEditor.DrawPoint(quadGravity.Point2, quad.P2, color, sizePoint, out changed); hasChanged = (changed) ? true : hasChanged; quadGravity.Point3 = ExtGravityOverrideEditor.DrawPoint(quadGravity.Point3, quad.P3, color, sizePoint, out changed); hasChanged = (changed) ? true : hasChanged; quadGravity.Point4 = ExtGravityOverrideEditor.DrawPoint(quadGravity.Point4, quad.P4, color, sizePoint, out changed); hasChanged = (changed) ? true : hasChanged; return(quadGravity); }
public static GravityOverrideLineTopDown DrawLine3d(ExtLine3d line, GravityOverrideLineTopDown lineGravity, Color color, out bool hasChanged) { float sizeLine = line.LocalScale.magnitude / 25; float sizePoint = line.LocalScale.magnitude / 20; hasChanged = false; bool changed = hasChanged; lineGravity.Trunk = ExtGravityOverrideEditor.DrawLineTrunk(lineGravity.Trunk, line.P1, line.P2, color, sizeLine, out changed); hasChanged = (changed) ? true : hasChanged; lineGravity.Top = ExtGravityOverrideEditor.DrawPoint(lineGravity.Top, line.P1, color, sizePoint, out changed); hasChanged = (changed) ? true : hasChanged; lineGravity.Bottom = ExtGravityOverrideEditor.DrawPoint(lineGravity.Bottom, line.P2, color, sizePoint, out changed); hasChanged = (changed) ? true : hasChanged; return(lineGravity); }
public static GravityOverrideLineTopDown DrawCapsule(ExtCapsule capsule, GravityOverrideLineTopDown capsuleGravity, Color color, out bool hasChanged) { float sizeLine = capsule.LocalScale.magnitude / 25; float sizePoint = capsule.LocalScale.magnitude / 20; hasChanged = false; bool changed = hasChanged; capsuleGravity.Trunk = ExtGravityOverrideEditor.DrawLineTrunk(capsuleGravity.Trunk, capsule.P1, capsule.P2, color, sizeLine, out changed); hasChanged = (changed) ? true : hasChanged; capsuleGravity.Top = ExtGravityOverrideEditor.DrawPoint(capsuleGravity.Top, capsule.P1, color, sizePoint, out changed); hasChanged = (changed) ? true : hasChanged; capsuleGravity.Bottom = ExtGravityOverrideEditor.DrawPoint(capsuleGravity.Bottom, capsule.P2, color, sizePoint, out changed); hasChanged = (changed) ? true : hasChanged; return(capsuleGravity); }
public static GravityOverrideLineTopDown[] DrawPolyLines(ExtPolyLines polyLine, GravityOverrideLineTopDown[] polyLineGravity, Color color, out bool hasChanged) { float sizeLine = polyLine.LocalScale.magnitude / 25; float sizePoint = polyLine.LocalScale.magnitude / 20; hasChanged = false; bool changed = hasChanged; for (int i = 0; i < polyLineGravity.Length; i++) { polyLineGravity[i].Trunk = ExtGravityOverrideEditor.DrawLineTrunk(polyLineGravity[i].Trunk, polyLine.LineAt(i).P1, polyLine.LineAt(i).P2, color, sizeLine, out changed); hasChanged = (changed) ? true : hasChanged; polyLineGravity[i].Top = ExtGravityOverrideEditor.DrawPoint(polyLineGravity[i].Top, polyLine.LineAt(i).P1, color, sizePoint, out changed); hasChanged = (changed) ? true : hasChanged; polyLineGravity[i].Bottom = ExtGravityOverrideEditor.DrawPoint(polyLineGravity[i].Bottom, polyLine.LineAt(i).P2, color, sizePoint, out changed); hasChanged = (changed) ? true : hasChanged; } return(polyLineGravity); }
public static GravityOverrideConeSphereBase DrawConeSphereBase(ExtConeSphereBase cone, GravityOverrideConeSphereBase coneGravity, Color color, out bool hasChanged) { float sizeLine = cone.LocalScale.magnitude / 20; float sizePoint = cone.LocalScale.magnitude / 15; hasChanged = false; bool changed = hasChanged; coneGravity.Base = ExtGravityOverrideEditor.DrawDisc(cone.Base, coneGravity.Base, color, false, out changed); hasChanged = (changed) ? true : hasChanged; Color colorLine = new Color(color.r, color.g, color.b, color.a * 0.8f); coneGravity.Trunk = ExtGravityOverrideEditor.DrawLineTrunk(coneGravity.Trunk, cone.P1, cone.P2, colorLine, sizeLine, out changed); hasChanged = (changed) ? true : hasChanged; coneGravity.Top = ExtGravityOverrideEditor.DrawPoint(coneGravity.Top, cone.P1, color, sizePoint, out changed); hasChanged = (changed) ? true : hasChanged; return(coneGravity); }