Guest User

Untitled

a guest
Mar 24th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.90 KB | None | 0 0
  1. using Microsoft.Xna.Framework;
  2. using Microsoft.Xna.Framework.Graphics;
  3. using Microsoft.Xna.Framework.Graphics.PackedVector;
  4.  
  5. namespace CoOpSpRpG
  6. {
  7.     /// <summary>
  8.     /// Custom vertex structure for drawing particles.
  9.     /// </summary>
  10.     struct ParticleVertexAdv
  11.     {
  12.         // Stores which corner of the particle quad this vertex represents.
  13.         public Vector2 Corner;
  14.  
  15.         // Stores the starting position of the particle.
  16.         public Vector3 Position;
  17.  
  18.         // Stores the starting velocity of the particle.
  19.         public Vector3 Velocity;
  20.  
  21.         // Four random values, used to make each particle look slightly different.
  22.         public Color Random;
  23.  
  24.         // The time (in seconds) at which this particle was created.
  25.         public float Time;
  26.  
  27.         public Vector2 Parameters;
  28.  
  29.  
  30.  
  31.         // Describe the layout of this vertex structure.
  32.         public static readonly VertexDeclaration VertexDeclaration = new VertexDeclaration
  33.         (
  34.             new VertexElement(0, VertexElementFormat.Vector2,
  35.                                  VertexElementUsage.TextureCoordinate, 0),
  36.  
  37.             new VertexElement(8, VertexElementFormat.Vector3,
  38.                                  VertexElementUsage.Position, 0),
  39.  
  40.             new VertexElement(20, VertexElementFormat.Vector3,
  41.                                   VertexElementUsage.Normal, 0),
  42.  
  43.             new VertexElement(32, VertexElementFormat.Color,
  44.                                   VertexElementUsage.Color, 0),
  45.  
  46.             new VertexElement(36, VertexElementFormat.Single,
  47.                                   VertexElementUsage.TextureCoordinate, 1),
  48.  
  49.             new VertexElement(40, VertexElementFormat.Vector2,
  50.                                   VertexElementUsage.TextureCoordinate, 2)
  51.  
  52.         );
  53.  
  54.  
  55.         // Describe the size of this vertex structure.
  56.         public const int SizeInBytes = 48;
  57.     }
  58. }
Add Comment
Please, Sign In to add comment