ShapeBuilderQuad Class
Namespace: Stride.Particles.ShapeBuildersAssembly: 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
Name | Description | |
---|---|---|
Properties | ||
QuadsPerParticle | Returns the number of quads required per particle to draw all particles. Assuming 1 Quad = 4 Vertices = 6 Indices |
|
SamplerRotation | Additive animation for the particle rotation. If present, particle's own rotation will be added to the sampled curve value |
|
Methods | ||
BuildVertexBuffer(ref ParticleBufferState, Vector3, Vector3, ref Vector3, ref Quaternion, Single, ref ParticleList, ref Matrix) | ||
GetParticleRotation(Particle, ParticleFieldAccessor<Quaternion>, ParticleFieldAccessor<Single>) | Gets the combined rotation for the particle, adding its field value (if any) to its sampled value from the curve |
|
PreUpdate() |
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
Type | Description |
---|---|
System.Int32 |
Overrides
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
Type | Description |
---|---|
ComputeCurveSampler<Quaternion> |
Methods
BuildVertexBuffer(ref ParticleBufferState, Vector3, Vector3, ref Vector3, ref Quaternion, Single, ref ParticleList, ref Matrix)
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
Type | Name | Description |
---|---|---|
ParticleBufferState | bufferState | |
Vector3 | invViewX | |
Vector3 | invViewY | |
Vector3 | spaceTranslation | |
Quaternion | spaceRotation | |
System.Single | spaceScale | |
ParticleList | sorter | |
Matrix | viewProj |
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
GetParticleRotation(Particle, ParticleFieldAccessor<Quaternion>, ParticleFieldAccessor<Single>)
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
Type | Name | Description |
---|---|---|
Particle | particle | Target particle |
ParticleFieldAccessor<Quaternion> | rotationField | Rotation field accessor |
ParticleFieldAccessor<System.Single> | lifeField | Normalized particle life for sampling |
Returns
Type | Description |
---|---|
Quaternion | Quaternion rotation of the quad particle, assuming flat horizontal square at neutral rotation |
PreUpdate()
public override void PreUpdate()