Search Results for

    Show / Hide Table of Contents

    Class RendererCircuitPins_RenderBatch

    Renderer for the circuit pins. Each instance of this class renders pins with the same properties (like color, type, etc.) with Unity's instanced drawing.

    Inheritance
    object
    RendererCircuitPins_RenderBatch
    Implements
    IGenerateDynamicMesh
    Namespace: AS2.Visuals
    Assembly: .dll
    Syntax
    public class RendererCircuitPins_RenderBatch : IGenerateDynamicMesh

    Constructors

    | Edit this page View Source

    RendererCircuitPins_RenderBatch(PropertyBlockData)

    Declaration
    public RendererCircuitPins_RenderBatch(RendererCircuitPins_RenderBatch.PropertyBlockData properties)
    Parameters
    Type Name Description
    RendererCircuitPins_RenderBatch.PropertyBlockData properties

    Fields

    | Edit this page View Source

    circuitMatrices_PinConnectors

    Declaration
    private List<Matrix4x4[]> circuitMatrices_PinConnectors
    Field Value
    Type Description
    List<Matrix4x4[]>
    | Edit this page View Source

    circuitMatrices_Pins

    Declaration
    private List<Matrix4x4[]> circuitMatrices_Pins
    Field Value
    Type Description
    List<Matrix4x4[]>
    | Edit this page View Source

    currentIndex

    Declaration
    private int currentIndex
    Field Value
    Type Description
    int
    | Edit this page View Source

    currentIndex_connectors

    Declaration
    private int currentIndex_connectors
    Field Value
    Type Description
    int
    | Edit this page View Source

    maxArraySize

    Declaration
    private const int maxArraySize = 1023
    Field Value
    Type Description
    int
    | Edit this page View Source

    pinMaterial

    Declaration
    private Material pinMaterial
    Field Value
    Type Description
    Material
    | Edit this page View Source

    pinQuad

    Declaration
    private Mesh pinQuad
    Field Value
    Type Description
    Mesh
    | Edit this page View Source

    properties

    Declaration
    public RendererCircuitPins_RenderBatch.PropertyBlockData properties
    Field Value
    Type Description
    RendererCircuitPins_RenderBatch.PropertyBlockData
    | Edit this page View Source

    propertyBlock_circuitMatrices_PinConnectors

    Declaration
    private MaterialPropertyBlockData_Circuits propertyBlock_circuitMatrices_PinConnectors
    Field Value
    Type Description
    MaterialPropertyBlockData_Circuits
    | Edit this page View Source

    propertyBlock_circuitMatrices_Pins

    Declaration
    private MaterialPropertyBlockData_Circuits propertyBlock_circuitMatrices_Pins
    Field Value
    Type Description
    MaterialPropertyBlockData_Circuits
    | Edit this page View Source

    zOffset

    Declaration
    private float zOffset
    Field Value
    Type Description
    float

    Methods

    | Edit this page View Source

    AddConnectorPin(Vector2)

    Adds a connector pin. A connector pin is an internal pin in expanded particles that connects the two sides of the particle. It has the width and color of the circuit lines, so that two lines that go to the same point do not have visibly sharp edges and seem like a connected structure.

    Declaration
    public RenderBatchIndex AddConnectorPin(Vector2 pinPos)
    Parameters
    Type Name Description
    Vector2 pinPos

    The global pin center position.

    Returns
    Type Description
    RenderBatchIndex
    | Edit this page View Source

    AddPin(Vector2, bool)

    Adds a pin.

    Declaration
    public RenderBatchIndex AddPin(Vector2 pinPos, bool singletonPin)
    Parameters
    Type Name Description
    Vector2 pinPos

    The global pin center position.

    bool singletonPin

    Whether this is a singleton pin. Singleton pins have their own pin size.

    Returns
    Type Description
    RenderBatchIndex

    The index of the new pin's matrix in this batch.

    | Edit this page View Source

    ApplyMovementTimestamps(float, float)

    Applies the timestamps for the movement offsets.

    Declaration
    public void ApplyMovementTimestamps(float movementStartTime, float movementDuration)
    Parameters
    Type Name Description
    float movementStartTime

    Start time of the animation.

    float movementDuration

    Duration of the animation.

    | Edit this page View Source

    ApplyUpdates(float)

    Applies the updates for the animations.

    Declaration
    public void ApplyUpdates(float animationStartTime)
    Parameters
    Type Name Description
    float animationStartTime

    The start time of the animation.

    | Edit this page View Source

    CalculatePinConnectorMatrix(Vector2)

    Calculates the pin connector matrix from the positional information about the pin connector. We basically take a standard quad with a pin texture and transform it so that it forms a pin of the right size.

    Declaration
    private Matrix4x4 CalculatePinConnectorMatrix(Vector2 pinPos)
    Parameters
    Type Name Description
    Vector2 pinPos

    The global position of the pin center.

    Returns
    Type Description
    Matrix4x4

    A translation, rotation and scaling matrix for a pin mesh with the given properties.

    | Edit this page View Source

    CalculatePinMatrix(Vector2, bool)

    Calculates the pin matrix from the positional information about the pin. We basically take a standard quad with a pin texture and transform it so that it forms a pin of the right size.

    Declaration
    private Matrix4x4 CalculatePinMatrix(Vector2 pinPos, bool isSingletonPin)
    Parameters
    Type Name Description
    Vector2 pinPos

    The global position of the pin.

    bool isSingletonPin

    Whether this is a singleton pin. Singleton pins have their own pin size.

    Returns
    Type Description
    Matrix4x4

    A translation, rotation and scaling matrix for a pin mesh with the given properties.

    | Edit this page View Source

    ClearMatrices()

    Clears the matrices, so nothing gets rendered anymore. The lists can be filled with new data now. (Actually just sets the index to 0, so we don't draw anything anymore.)

    Declaration
    public void ClearMatrices()
    | Edit this page View Source

    Init()

    Initializes the materials and settings of this class.

    Declaration
    public void Init()
    | Edit this page View Source

    RegenerateMeshes()

    Regenerates the meshes of this class.

    Declaration
    public void RegenerateMeshes()
    | Edit this page View Source

    Render(ViewType, bool)

    Renders the pins.

    Declaration
    public void Render(ViewType type, bool firstRenderFrame)
    Parameters
    Type Name Description
    ViewType type

    The current view type. Useful for deciding what to show.

    bool firstRenderFrame

    If this is the first frame of the new round.

    | Edit this page View Source

    UpdateConnectorPin(Vector2, RenderBatchIndex)

    Updates a connector pin.

    Declaration
    public void UpdateConnectorPin(Vector2 pinPos, RenderBatchIndex index)
    Parameters
    Type Name Description
    Vector2 pinPos

    The new global pin center position.

    RenderBatchIndex index

    The batch index of the pin to update.

    | Edit this page View Source

    UpdatePin(Vector2, bool, RenderBatchIndex)

    Updates a pin.

    Declaration
    public void UpdatePin(Vector2 pinPos, bool singletonPin, RenderBatchIndex index)
    Parameters
    Type Name Description
    Vector2 pinPos

    The global pin center position.

    bool singletonPin

    Whether this is a singleton pin. Singleton pins have their own pin size.

    RenderBatchIndex index

    The index of the pin to update.

    Implements

    IGenerateDynamicMesh
    • Edit this page
    • View Source
    In this article
    Back to top AmoebotSim 2.0 Documentation v1.11
    Copyright © 2025 AmoebotSim 2.0 Authors
    Generated by DocFX