コード例 #1
0
 public DrawCircles(int capacity)
 {
     for (var i = 0; i < capacity; i++)
     {
         freePrimitives.AddFirst(new CirclePrimitive( ));
     }
 }
コード例 #2
0
ファイル: DrawStrings.cs プロジェクト: hww/VARP2
 public DrawStrings(int capacity)
 {
     for (var i = 0; i < capacity; i++)
     {
         freePrimitives.AddFirst(new TextPrimitive( ));
     }
 }
コード例 #3
0
 public DrawQuads(int capacity)
 {
     for (var i = 0; i < capacity; i++)
     {
         freePrimitives.AddFirst(new QuadPrimitive( ));
     }
 }
コード例 #4
0
        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);
        }
コード例 #5
0
ファイル: DrawTriangles.cs プロジェクト: hww/VARP2
 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 );
 }
コード例 #6
0
ファイル: DrawLines.cs プロジェクト: hww/VARP2
        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);
        }
コード例 #7
0
ファイル: DrawStrings.cs プロジェクト: hww/VARP2
        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);
        }
コード例 #8
0
ファイル: DrawTriangles.cs プロジェクト: hww/VARP2
 public DrawTriangles ( int capacity )
 {
     for ( var i = 0 ; i < capacity ; i++ )
         freePrimitives.AddFirst ( new TrianglePrimitive ( ) );
 }