Class ShapeBuilderTrail
- Namespace
- Stride.Particles.ShapeBuilders
- Assembly
- Stride.Particles.dll
Shape builder which builds all particles as a trail, connecting adjacent particles in a ribbon defined by a fixed 3d axis
[DataContract("ShapeBuilderTrail")]
[Display("Trail", null)]
public class ShapeBuilderTrail : ShapeBuilder
- Inheritance
-
ShapeBuilderTrail
- Inherited Members
Properties
EdgePolicy
Should the axis of control point be treated as the trail's edge or the trail's center
[DataMember(8)]
[Display("Axis", null)]
public EdgePolicy EdgePolicy { get; set; }
Property Value
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
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
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
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
TextureCoordinatePolicy
Specifies how texture coordinates for the ribbons should be built
[DataMember(10)]
[Display("UV Coords", null)]
public TextureCoordinatePolicy TextureCoordinatePolicy { get; set; }
Property Value
UVRotate
Texture coordinates flip and rotate policy
[DataMember(30)]
[Display("UV Rotate", null)]
public UVRotate UVRotate { 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
SetRequiredQuads(int, int, int)
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)