Class ShapeBuilderQuad
- Namespace
- Stride.Particles.ShapeBuilders
- Assembly
- Stride.Particles.dll
Shape builder which builds each particle as a up-facing quad, further rotated by the particle's rotation in 3d space
[DataContract("ShapeBuilderQuad")]
[Display("Quad", null)]
public class ShapeBuilderQuad : ShapeBuilderCommon
- Inheritance
-
ShapeBuilderQuad
- Inherited Members
Properties
QuadsPerParticle
Returns the number of quads required per particle to draw all particles. Assuming 1 Quad = 4 Vertices = 6 Indices
public override int QuadsPerParticle { get; protected set; }
Property Value
SamplerRotation
Additive animation for the particle rotation. If present, particle's own rotation will be added to the sampled curve value
[DataMember(300)]
[Display("Additive Rotation Animation", null)]
public ComputeCurveSampler<Quaternion> SamplerRotation { get; set; }
Property Value
Methods
BuildVertexBuffer(ref ParticleBufferState, Vector3, Vector3, ref Vector3, ref Quaternion, float, ref ParticleList, ref Matrix)
Builds the actual vertex buffer for the current frame using the particle data
public override int BuildVertexBuffer(ref ParticleBufferState bufferState, Vector3 invViewX, Vector3 invViewY, ref Vector3 spaceTranslation, ref Quaternion spaceRotation, float spaceScale, ref ParticleList sorter, ref Matrix viewProj)
Parameters
bufferState
ParticleBufferStateTarget particle buffer state, used to populate the assigned vertex buffer
invViewX
Vector3Unit vector X (right) in camera space, extracted from the inverse view matrix
invViewY
Vector3Unit vector Y (up) in camera space, extracted from the inverse view matrix
spaceTranslation
Vector3Translation of the target draw space in regard to the particle data (world or local)
spaceRotation
QuaternionRotation of the target draw space in regard to the particle data (world or local)
spaceScale
floatUniform scale of the target draw space in regard to the particle data (world or local)
sorter
ParticleListParticle enumerator which can be iterated and returns sported particles
viewProj
MatrixThe View-Projection matrix which is used for some shape builders
Returns
GetParticleRotation(Particle, ParticleFieldAccessor<Quaternion>, ParticleFieldAccessor<float>)
Gets the combined rotation for the particle, adding its field value (if any) to its sampled value from the curve
protected Quaternion GetParticleRotation(Particle particle, ParticleFieldAccessor<Quaternion> rotationField, ParticleFieldAccessor<float> lifeField)
Parameters
particle
ParticleTarget particle
rotationField
ParticleFieldAccessor<Quaternion>Rotation field accessor
lifeField
ParticleFieldAccessor<float>Normalized particle life for sampling
Returns
- Quaternion
Quaternion rotation of the quad particle, assuming flat horizontal square at neutral rotation
PreUpdate()
public override void PreUpdate()