ShapeBuilderCommon Class
Namespace: Stride.Particles.ShapeBuildersAssembly: Stride.Particles.dll
The common shape builder provides additive animation for the particle's position and size fields, assuming that all derived shape builders will have position and size fields
[DataContract("ShapeBuilderCommon")]
public abstract class ShapeBuilderCommon : ShapeBuilder
Name | Description | |
---|---|---|
Properties | ||
SamplerPosition | Additive animation for the particle position. If present, particle's own position will be added to the sampled curve value |
|
SamplerSize | Additive animation for the particle size. If present, particle's own size will be multiplied with the sampled curve value |
|
Methods | ||
BuildVertexBuffer(ref ParticleBufferState, Vector3, Vector3, ref Vector3, ref Quaternion, Single, ref ParticleList, ref Matrix) | ||
GetParticlePosition(Particle, ParticleFieldAccessor<Vector3>, ParticleFieldAccessor<Single>) | Gets the combined position for the particle, adding its field value (if any) to its sampled value from the curve |
|
GetParticleSize(Particle, ParticleFieldAccessor<Single>, ParticleFieldAccessor<Single>) | Gets the combined size for the particle, adding its field value (if any) to its sampled value from the curve |
|
PreUpdate() |
Properties
SamplerPosition
Additive animation for the particle position. If present, particle's own position will be added to the sampled curve value
[DataMember(100)]
[Display("Additive Position Animation", null)]
public ComputeCurveSampler<Vector3> SamplerPosition { get; set; }
Property Value
Type | Description |
---|---|
ComputeCurveSampler<Vector3> |
SamplerSize
Additive animation for the particle size. If present, particle's own size will be multiplied with the sampled curve value
[DataMember(200)]
[Display("Additive Size Animation", null)]
public ComputeCurveSampler<float> SamplerSize { get; set; }
Property Value
Type | Description |
---|---|
ComputeCurveSampler<System.Single> |
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
GetParticlePosition(Particle, ParticleFieldAccessor<Vector3>, ParticleFieldAccessor<Single>)
Gets the combined position for the particle, adding its field value (if any) to its sampled value from the curve
protected Vector3 GetParticlePosition(Particle particle, ParticleFieldAccessor<Vector3> positionField, ParticleFieldAccessor<float> lifeField)
Parameters
Type | Name | Description |
---|---|---|
Particle | particle | |
ParticleFieldAccessor<Vector3> | positionField | |
ParticleFieldAccessor<System.Single> | lifeField | Normalized life for sampling |
Returns
Type | Description |
---|---|
Vector3 | Particle's current 3D position |
GetParticleSize(Particle, ParticleFieldAccessor<Single>, ParticleFieldAccessor<Single>)
Gets the combined size for the particle, adding its field value (if any) to its sampled value from the curve
protected float GetParticleSize(Particle particle, ParticleFieldAccessor<float> sizeField, ParticleFieldAccessor<float> lifeField)
Parameters
Type | Name | Description |
---|---|---|
Particle | particle | Target particle |
ParticleFieldAccessor<System.Single> | sizeField | Size field accessor |
ParticleFieldAccessor<System.Single> | lifeField | Normalized life for sampling |
Returns
Type | Description |
---|---|
System.Single | Particle's current uniform size |
PreUpdate()
public override void PreUpdate()