Пример #1
0
 public object Clone()
 {
     DrawArgs result = new DrawArgs(Vector3Pool.Instance.New<float>(Position.X, Position.Y, Position.Z), Vector, _Material, Scale, Rotation);
     result.LightingEnabled = LightingEnabled;
     result.Color = (Color4)Color.Clone();
     return (object)result;
 }
Пример #2
0
        public void Draw(DrawArgs args)
        {
            Vector3 c_pos = CameraManager.Current.position;
            float c_dist = (float)(Math.Pow(args.Position.X - c_pos.X, 2) + Math.Pow(args.Position.Y - c_pos.Y, 2) + Math.Pow(args.Position.Y - c_pos.Y, 2));

            BatchEntry r = new BatchEntry(this, c_dist, (DrawArgs)args.Clone());
            BatchManager.Current.Add(r);
        }
Пример #3
0
 public void Draw(DrawArgs args)
 {
     if (args.LightingEnabled)
     {
         Gl.glEnable(Gl.GL_LIGHTING);
         args._Material.ApplyMaterial();
     }
     else
     {
         Gl.glDisable(Gl.GL_LIGHTING);
         Gl.glColor3fv((float[])args.Color);
     }
     Gl.glPointSize(args.Scale.X);
     Gl.glBegin(Gl.GL_POINTS);
     Gl.glVertex3fv((float[])args.Position);
     Gl.glEnd();
 }
Пример #4
0
        internal virtual void DepthDraw(DrawArgs args)
        {
            Gl.glPushMatrix();
            Gl.glTranslatef(args.Position.X, args.Position.Y, args.Position.Z);
            configBillboard(args.Position);

            //Draw the billboard with texture coordinates
            Gl.glBindTexture(Gl.GL_TEXTURE_2D, (int)Image);

            if (args.LightingEnabled)
            {
                Gl.glEnable(Gl.GL_LIGHTING);
                if (args._Material == null) throw new ArgumentNullException();
                args._Material.ApplyMaterial();
            }
            else
            {
                if (args.Color == null) throw new ArgumentNullException();
                Gl.glColor4fv((float[])args.Color);
            }

            Gl.glScalef(scale, scale, scale);

            Gl.glBegin(Gl.GL_POLYGON);
            Gl.glTexCoord2f(1, 1); Gl.glVertex3d(args.Scale.X, args.Scale.Y, 0);
            Gl.glTexCoord2f(0, 1); Gl.glVertex3d(-args.Scale.X, args.Scale.Y, 0);
            Gl.glTexCoord2f(0, 0); Gl.glVertex3d(-args.Scale.X, -args.Scale.Y, 0);
            Gl.glTexCoord2f(1, 0); Gl.glVertex3d(args.Scale.X, -args.Scale.Y, 0);
            Gl.glEnd();

            if (LockType == BillboardLockType.Cylindrical || LockType == BillboardLockType.Spherical)
            {
                Gl.glPopMatrix();
            }
            Gl.glPopMatrix();
        }