Table of Contents

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 nint
builder ParticleVertexBuilder

Fields

CurrentParticleIndex

public int CurrentParticleIndex

Field Value

int

CurrentVertex

public int CurrentVertex

Field Value

int

VertexBuffer

public nint VertexBuffer

Field Value

nint

VertexBufferOrigin

public readonly nint VertexBufferOrigin

Field Value

nint

VertexStride

public int VertexStride

Field Value

int

VerticesPerSegCurrent

public int VerticesPerSegCurrent

Field Value

int

VerticesPerSegFirst

public int VerticesPerSegFirst

Field Value

int

VerticesPerSegLast

public int VerticesPerSegLast

Field Value

int

VerticesPerSegMiddle

public int VerticesPerSegMiddle

Field Value

int

Properties

DefaultTexCoords

public AttributeDescription DefaultTexCoords { get; }

Property Value

AttributeDescription

Methods

GetAccessor(AttributeDescription)

public AttributeAccessor GetAccessor(AttributeDescription desc)

Parameters

desc AttributeDescription

Returns

AttributeAccessor

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 AttributeAccessor

Accessor to the vertex data

ptrRef nint

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

accessor AttributeAccessor

Accessor to the vertex data

ptrRef nint

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

accessor AttributeAccessor

Accessor to the vertex data

ptrRef nint

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

verticesForFirstSegment int

Number of vertices for the first segment

verticesForMiddleSegment int

Number of vertices for the middle segments

verticesForLastSegment int

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 : struct

Parameters

accessorFrom AttributeAccessor
accessorTo AttributeAccessor
transformMethod 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 AttributeAccessor

Vertex attribute accessor to the source attribute

accessorTo AttributeAccessor

Vertex attribute accessor to the destination attribute

transformMethod IAttributeTransformer<T, U>

Transform method for the type data

transformer U

Type Parameters

T

Type data

U