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
vertexBufferPtr
nintbuilder
ParticleVertexBuilder
Fields
CurrentParticleIndex
public int CurrentParticleIndex
Field Value
CurrentVertex
public int CurrentVertex
Field Value
VertexBuffer
public nint VertexBuffer
Field Value
VertexBufferOrigin
public readonly nint VertexBufferOrigin
Field Value
VertexStride
public int VertexStride
Field Value
VerticesPerSegCurrent
public int VerticesPerSegCurrent
Field Value
VerticesPerSegFirst
public int VerticesPerSegFirst
Field Value
VerticesPerSegLast
public int VerticesPerSegLast
Field Value
VerticesPerSegMiddle
public int VerticesPerSegMiddle
Field Value
Properties
DefaultTexCoords
public AttributeDescription DefaultTexCoords { get; }
Property Value
Methods
GetAccessor(AttributeDescription)
public AttributeAccessor GetAccessor(AttributeDescription desc)
Parameters
desc
AttributeDescription
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
accessor
AttributeAccessorAccessor to the vertex data
ptrRef
nintPointer 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
accessor
AttributeAccessorAccessor to the vertex data
ptrRef
nintPointer 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
accessor
AttributeAccessorAccessor to the vertex data
ptrRef
nintPointer 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
verticesForFirstSegment
intNumber of vertices for the first segment
verticesForMiddleSegment
intNumber of vertices for the middle segments
verticesForLastSegment
intNumber 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 : struct
Parameters
accessorFrom
AttributeAccessoraccessorTo
AttributeAccessortransformMethod
IAttributeTransformer<T, U>transformer
U
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 : struct
Parameters
accessorFrom
AttributeAccessorVertex attribute accessor to the source attribute
accessorTo
AttributeAccessorVertex attribute accessor to the destination attribute
transformMethod
IAttributeTransformer<T, U>Transform method for the type data
transformer
U
Type Parameters
T
Type data
U