Struct ParticleBufferState
- Namespace
- Stride.Particles.VertexLayouts
- Assembly
- Stride.Particles.dll
public struct ParticleBufferState- Inherited Members
Constructors
ParticleBufferState(nint, ParticleVertexBuilder)
public ParticleBufferState(nint vertexBufferPtr, ParticleVertexBuilder builder)Parameters
- vertexBufferPtrnint
- builderParticleVertexBuilder
Fields
CurrentParticleIndex
public int CurrentParticleIndexField Value
CurrentVertex
public int CurrentVertexField Value
VertexBuffer
public nint VertexBufferField Value
VertexBufferOrigin
public readonly nint VertexBufferOriginField Value
VertexStride
public int VertexStrideField Value
VerticesPerSegCurrent
public int VerticesPerSegCurrentField Value
VerticesPerSegFirst
public int VerticesPerSegFirstField Value
VerticesPerSegLast
public int VerticesPerSegLastField Value
VerticesPerSegMiddle
public int VerticesPerSegMiddleField Value
Properties
DefaultTexCoords
public AttributeDescription DefaultTexCoords { get; }Property Value
Methods
GetAccessor(AttributeDescription)
public AttributeAccessor GetAccessor(AttributeDescription desc)Parameters
- descAttributeDescription
Returns
NextParticle()
Advances the pointer to the next particle in the buffer, so that its first vertex can be written
public void NextParticle()NextSegment()
Advances the pointer to the next segment in the buffer, so that its first vertex can be written
public void NextSegment()NextVertex()
Advances the pointer to the next vertex in the buffer, so that it can be written
public void NextVertex()SetAttribute(AttributeAccessor, nint)
Sets the data for the current vertex using the provided AttributeAccessor
public void SetAttribute(AttributeAccessor accessor, nint ptrRef)Parameters
- accessorAttributeAccessor
- Accessor to the vertex data 
- ptrRefnint
- Pointer to the source data 
SetAttributePerParticle(AttributeAccessor, nint)
Sets the same data for the all vertices in the current particle using the provided AttributeAccessor
public void SetAttributePerParticle(AttributeAccessor accessor, nint ptrRef)Parameters
- accessorAttributeAccessor
- Accessor to the vertex data 
- ptrRefnint
- Pointer to the source data 
SetAttributePerSegment(AttributeAccessor, nint)
Sets the same data for the all vertices in the current particle using the provided AttributeAccessor
public void SetAttributePerSegment(AttributeAccessor accessor, nint ptrRef)Parameters
- accessorAttributeAccessor
- Accessor to the vertex data 
- ptrRefnint
- Pointer to the source data 
SetVerticesPerSegment(int, int, int)
Sets how many vertices are associated with the first, middle and last quad segments of the buffer. In case of billboards 1 segment = 1 quad but other shapes might be laid out differently
public void SetVerticesPerSegment(int verticesForFirstSegment, int verticesForMiddleSegment, int verticesForLastSegment)Parameters
- verticesForFirstSegmentint
- Number of vertices for the first segment 
- verticesForMiddleSegmentint
- Number of vertices for the middle segments 
- verticesForLastSegmentint
- Number of vertices for the last segment 
StartOver()
Moves the index to the beginning of the buffer so that the data can be filled from the first particle again
public void StartOver()TransformAttributePerParticle<T, U>(AttributeAccessor, AttributeAccessor, IAttributeTransformer<T, U>, ref U)
public void TransformAttributePerParticle<T, U>(AttributeAccessor accessorFrom, AttributeAccessor accessorTo, IAttributeTransformer<T, U> transformMethod, ref U transformer) where T : struct where U : structParameters
- accessorFromAttributeAccessor
- accessorToAttributeAccessor
- transformMethodIAttributeTransformer<T, U>
- transformerU
Type Parameters
- T
- U
TransformAttributePerSegment<T, U>(AttributeAccessor, AttributeAccessor, IAttributeTransformer<T, U>, ref U)
Transforms attribute data using already written data from another attribute
public void TransformAttributePerSegment<T, U>(AttributeAccessor accessorFrom, AttributeAccessor accessorTo, IAttributeTransformer<T, U> transformMethod, ref U transformer) where T : struct where U : structParameters
- accessorFromAttributeAccessor
- Vertex attribute accessor to the source attribute 
- accessorToAttributeAccessor
- Vertex attribute accessor to the destination attribute 
- transformMethodIAttributeTransformer<T, U>
- Transform method for the type data 
- transformerU
Type Parameters
- T
- Type data 
- U