Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    ShapeBuilderCommon Class

    Namespace: Stride.Particles.ShapeBuilders
    Assembly: Stride.Particles.dll

    The common shape builder provides additive animation for the particle's position and size fields, assuming that all derived shape builders will have position and size fields

    System.Object → ShapeBuilder → ShapeBuilderCommon
    Derived from ShapeBuilderCommon: ShapeBuilderBillboard ShapeBuilderHexagon ShapeBuilderOrientedQuad ShapeBuilderQuad

    [DataContract("ShapeBuilderCommon")]
    public abstract class ShapeBuilderCommon : ShapeBuilder
    Name Description
    Properties
    SamplerPosition

    Additive animation for the particle position. If present, particle's own position will be added to the sampled curve value

    SamplerSize

    Additive animation for the particle size. If present, particle's own size will be multiplied with the sampled curve value

    Methods
    BuildVertexBuffer(ref ParticleBufferState, Vector3, Vector3, ref Vector3, ref Quaternion, Single, ref ParticleList, ref Matrix)
    GetParticlePosition(Particle, ParticleFieldAccessor<Vector3>, ParticleFieldAccessor<Single>)

    Gets the combined position for the particle, adding its field value (if any) to its sampled value from the curve

    GetParticleSize(Particle, ParticleFieldAccessor<Single>, ParticleFieldAccessor<Single>)

    Gets the combined size for the particle, adding its field value (if any) to its sampled value from the curve

    PreUpdate()
    | Improve this Doc View Source

    Properties


    SamplerPosition

    Additive animation for the particle position. If present, particle's own position will be added to the sampled curve value

    [DataMember(100)]
    [Display("Additive Position Animation", null)]
    public ComputeCurveSampler<Vector3> SamplerPosition { get; set; }
    Property Value
    Type Description
    ComputeCurveSampler<Vector3>

    SamplerSize

    Additive animation for the particle size. If present, particle's own size will be multiplied with the sampled curve value

    [DataMember(200)]
    [Display("Additive Size Animation", null)]
    public ComputeCurveSampler<float> SamplerSize { get; set; }
    Property Value
    Type Description
    ComputeCurveSampler<System.Single>
    | Improve this Doc View Source

    Methods


    BuildVertexBuffer(ref ParticleBufferState, Vector3, Vector3, ref Vector3, ref Quaternion, Single, ref ParticleList, ref Matrix)

    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
    Vector3 invViewX
    Vector3 invViewY
    Vector3 spaceTranslation
    Quaternion spaceRotation
    System.Single spaceScale
    ParticleList sorter
    Matrix viewProj
    Returns
    Type Description
    System.Int32
    Overrides
    ShapeBuilder.BuildVertexBuffer(ref ParticleBufferState, Vector3, Vector3, ref Vector3, ref Quaternion, Single, ref ParticleList, ref Matrix)

    GetParticlePosition(Particle, ParticleFieldAccessor<Vector3>, ParticleFieldAccessor<Single>)

    Gets the combined position for the particle, adding its field value (if any) to its sampled value from the curve

    protected Vector3 GetParticlePosition(Particle particle, ParticleFieldAccessor<Vector3> positionField, ParticleFieldAccessor<float> lifeField)
    Parameters
    Type Name Description
    Particle particle
    ParticleFieldAccessor<Vector3> positionField
    ParticleFieldAccessor<System.Single> lifeField

    Normalized life for sampling

    Returns
    Type Description
    Vector3

    Particle's current 3D position


    GetParticleSize(Particle, ParticleFieldAccessor<Single>, ParticleFieldAccessor<Single>)

    Gets the combined size for the particle, adding its field value (if any) to its sampled value from the curve

    protected float GetParticleSize(Particle particle, ParticleFieldAccessor<float> sizeField, ParticleFieldAccessor<float> lifeField)
    Parameters
    Type Name Description
    Particle particle

    Target particle

    ParticleFieldAccessor<System.Single> sizeField

    Size field accessor

    ParticleFieldAccessor<System.Single> lifeField

    Normalized life for sampling

    Returns
    Type Description
    System.Single

    Particle's current uniform size


    PreUpdate()

    public override void PreUpdate()
    Overrides
    ShapeBuilder.PreUpdate()

    Inherited Members

    ShapeBuilder.QuadsPerParticle
    ShapeBuilder.VertexLayoutHasChanged
    ShapeBuilder.PrepareVertexLayout(ParticlePoolFieldsList)
    ShapeBuilder.UpdateVertexBuilder(ParticleVertexBuilder)
    ShapeBuilder.SetRequiredQuads(Int32, Int32, Int32)
    ShapeBuilder.Circumcenter(Vector3, Vector3, Vector3)

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation