Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Graphics;
- using Microsoft.Xna.Framework.Graphics.PackedVector;
- namespace CoOpSpRpG
- {
- /// <summary>
- /// Custom vertex structure for drawing particles.
- /// </summary>
- struct ParticleVertexAdv
- {
- // Stores which corner of the particle quad this vertex represents.
- public Vector2 Corner;
- // Stores the starting position of the particle.
- public Vector3 Position;
- // Stores the starting velocity of the particle.
- public Vector3 Velocity;
- // Four random values, used to make each particle look slightly different.
- public Color Random;
- // The time (in seconds) at which this particle was created.
- public float Time;
- public Vector2 Parameters;
- // Describe the layout of this vertex structure.
- public static readonly VertexDeclaration VertexDeclaration = new VertexDeclaration
- (
- new VertexElement(0, VertexElementFormat.Vector2,
- VertexElementUsage.TextureCoordinate, 0),
- new VertexElement(8, VertexElementFormat.Vector3,
- VertexElementUsage.Position, 0),
- new VertexElement(20, VertexElementFormat.Vector3,
- VertexElementUsage.Normal, 0),
- new VertexElement(32, VertexElementFormat.Color,
- VertexElementUsage.Color, 0),
- new VertexElement(36, VertexElementFormat.Single,
- VertexElementUsage.TextureCoordinate, 1),
- new VertexElement(40, VertexElementFormat.Vector2,
- VertexElementUsage.TextureCoordinate, 2)
- );
- // Describe the size of this vertex structure.
- public const int SizeInBytes = 48;
- }
- }
Add Comment
Please, Sign In to add comment