public DrawCircles(int capacity) { for (var i = 0; i < capacity; i++) { freePrimitives.AddFirst(new CirclePrimitive( )); } }
public DrawStrings(int capacity) { for (var i = 0; i < capacity; i++) { freePrimitives.AddFirst(new TextPrimitive( )); } }
public DrawQuads(int capacity) { for (var i = 0; i < capacity; i++) { freePrimitives.AddFirst(new QuadPrimitive( )); } }
public void Add(Vector3 center, Vector3 normal, float radius, Color color, float hideAt = 0) { var primitive = freePrimitives.First; if (primitive == null) { primitive = new CirclePrimitive( ); } else { primitive.Remove( ); } normal = normal.normalized; Vector3 forward = normal == Vector3.up ? Vector3.ProjectOnPlane(Vector3.forward, normal).normalized : Vector3.ProjectOnPlane(Vector3.up, normal).normalized; Vector3 right = Vector3.Cross(normal, forward); primitive.Value.center = center; primitive.Value.forward = forward; primitive.Value.right = right; primitive.Value.radius = radius; primitive.Value.color = color; primitive.Value.hideAt = hideAt; usedPrimitives.AddFirst(primitive); }
public void Add ( Vector3 point1, Vector3 point2, Vector3 point3, Color color, float hideAt = 0 ) { var primitive = freePrimitives.First; if ( primitive == null ) primitive = new TrianglePrimitive ( ); else primitive.Remove ( ); primitive.Value.point1 = point1; primitive.Value.point2 = point2; primitive.Value.point3 = point3; primitive.Value.color = color; primitive.Value.hideAt = hideAt; usedPrimitives.AddFirst ( primitive ); }
public void Add(Vector3 point1, Vector3 point2, Color color, float hideAt = 0) { var primitive = freePrimitives.First; if (primitive == null) { primitive = new LinePrimitive( ); } else { primitive.Remove( ); } primitive.Value.point1 = point1; primitive.Value.point2 = point2; primitive.Value.color = color; primitive.Value.hideAt = hideAt; usedPrimitives.AddFirst(primitive); }
public void Add(Vector3 position, string text, Color color, float hideAt = 0) { var primitive = freePrimitives.First; if (primitive == null) { primitive = new TextPrimitive( ); } else { primitive.Remove( ); } var textPrim = primitive.Value; textPrim.position = position; textPrim.text = text; textPrim.color = color; textPrim.hideAt = hideAt; usedPrimitives.AddFirst(primitive); }
public DrawTriangles ( int capacity ) { for ( var i = 0 ; i < capacity ; i++ ) freePrimitives.AddFirst ( new TrianglePrimitive ( ) ); }