Class ShapeBuilderHexagon
- Namespace
- Stride.Particles.ShapeBuilders
- Assembly
- Stride.Particles.dll
Shape builder which builds each particle as a camera-facing hexagon
[DataContract("ShapeBuilderHexagon")]
[Display("Hexagon", null)]
public class ShapeBuilderHexagon : ShapeBuilderCommon
- Inheritance
-
ShapeBuilderHexagon
- 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<float> 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
bufferStateParticleBufferStateTarget particle buffer state, used to populate the assigned vertex buffer
invViewXVector3Unit vector X (right) in camera space, extracted from the inverse view matrix
invViewYVector3Unit vector Y (up) in camera space, extracted from the inverse view matrix
spaceTranslationVector3Translation of the target draw space in regard to the particle data (world or local)
spaceRotationQuaternionRotation of the target draw space in regard to the particle data (world or local)
spaceScalefloatUniform scale of the target draw space in regard to the particle data (world or local)
sorterParticleListParticle enumerator which can be iterated and returns sported particles
viewProjMatrixThe View-Projection matrix which is used for some shape builders
Returns
GetParticleRotation(Particle, ParticleFieldAccessor<float>, ParticleFieldAccessor<float>)
Gets the combined rotation for the particle, adding its field value (if any) to its sampled value from the curve
protected float GetParticleRotation(Particle particle, ParticleFieldAccessor<float> rotationField, ParticleFieldAccessor<float> lifeField)
Parameters
particleParticleTarget particle
rotationFieldParticleFieldAccessor<float>Rotation field accessor
lifeFieldParticleFieldAccessor<float>Normalized particle life for sampling
Returns
- float
Screen space rotation in radians, positive is clockwise
PreUpdate()
public override void PreUpdate()