ShapeBuilderRibbon Class
Namespace: Stride.Particles.ShapeBuildersAssembly: Stride.Particles.dll
Shape builder which builds all particles as a ribbon, connecting adjacent particles with camera-facing quads
[DataContract("ShapeBuilderRibbon")]
[Display("Ribbon", null)]
public class ShapeBuilderRibbon : ShapeBuilder
Name | Description | |
---|---|---|
Properties | ||
QuadsPerParticle | Returns the number of quads required per particle to draw all particles. Assuming 1 Quad = 4 Vertices = 6 Indices |
|
Segments | If the ribbon is smotthed, how many segments should be used between each two particles |
|
SmoothingPolicy | Smoothing provides the option to additionally smooth the ribbon, enhancing visual quality for sharp angles |
|
TexCoordsFactor | The factor (coefficient) for length to use when building texture coordinates |
|
TextureCoordinatePolicy | Specifies how texture coordinates for the ribbons should be built |
|
UVRotate | Texture coordinates flip and rotate policy |
|
Methods | ||
BuildVertexBuffer(ref ParticleBufferState, Vector3, Vector3, ref Vector3, ref Quaternion, Single, ref ParticleList, ref Matrix) | Builds the actual vertex buffer for the current frame using the particle data |
|
SetRequiredQuads(Int32, Int32, Int32) | Sets the required quads per particle and number of particles so that a sufficiently big buffer can be allocated |
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
Segments
If the ribbon is smotthed, how many segments should be used between each two particles
[DataMember(6)]
[Display("Segments", null)]
public int Segments { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
SmoothingPolicy
Smoothing provides the option to additionally smooth the ribbon, enhancing visual quality for sharp angles
[DataMember(5)]
[Display("Smoothing", null)]
public SmoothingPolicy SmoothingPolicy { get; set; }
Property Value
Type | Description |
---|---|
SmoothingPolicy |
TexCoordsFactor
The factor (coefficient) for length to use when building texture coordinates
[DataMember(20)]
[Display("UV Factor", null)]
public float TexCoordsFactor { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
TextureCoordinatePolicy
Specifies how texture coordinates for the ribbons should be built
[DataMember(10)]
[Display("UV Coords", null)]
public TextureCoordinatePolicy TextureCoordinatePolicy { get; set; }
Property Value
Type | Description |
---|---|
TextureCoordinatePolicy |
UVRotate
Texture coordinates flip and rotate policy
[DataMember(30)]
[Display("UV Rotate", null)]
public UVRotate UVRotate { get; set; }
Property Value
Type | Description |
---|---|
UVRotate |
Methods
BuildVertexBuffer(ref ParticleBufferState, Vector3, Vector3, ref Vector3, ref Quaternion, Single, 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
Type | Name | Description |
---|---|---|
ParticleBufferState | bufferState | Target particle buffer state, used to populate the assigned vertex buffer |
Vector3 | invViewX | Unit vector X (right) in camera space, extracted from the inverse view matrix |
Vector3 | invViewY | Unit vector Y (up) in camera space, extracted from the inverse view matrix |
Vector3 | spaceTranslation | Translation of the target draw space in regard to the particle data (world or local) |
Quaternion | spaceRotation | Rotation of the target draw space in regard to the particle data (world or local) |
System.Single | spaceScale | Uniform scale of the target draw space in regard to the particle data (world or local) |
ParticleList | sorter | Particle enumerator which can be iterated and returns sported particles |
Matrix | viewProj | The View-Projection matrix which is used for some shape builders |
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
SetRequiredQuads(Int32, Int32, Int32)
Sets the required quads per particle and number of particles so that a sufficiently big buffer can be allocated
public override void SetRequiredQuads(int quadsPerParticle, int livingParticles, int totalParticles)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | quadsPerParticle | Required quads per particle, assuming 1 quad = 4 vertices = 6 indices |
System.Int32 | livingParticles | Number of living particles this frame |
System.Int32 | totalParticles | Number of total number of possible particles for the parent emitter |