• Installation Guide
  • Amoebot Model
  • User Guide
  • Model Reference
  • Dev Guide
  • API Documentation
Search Results for

    Show / Hide Table of Contents
    • AS2
      • AlgorithmGenerator
      • AlgorithmGeneratorEditor
      • AlgorithmManager
      • AlgorithmManager.AlgorithmInfo
      • AmoebotFunctions
      • AmoebotSimulator
      • CameraUtils
      • CellRect
      • CellRect.CellRect_Iterator
      • ColorData
      • Config
      • ConfigData
      • ConfigData.AdditionalConfiguration
      • ConfigData.SettingsMenu
      • ConfigurationEditor
      • ConfigurationEditorBehavior
      • Constants
      • Direction
      • DirectionHelpers
      • EventDatabase
      • FileBrowser
      • FileBrowser.FileTypeHandler
      • FilePaths
      • InitModeSaveData
      • InitParticleSaveData
      • InitRandomWithHoles
      • Initialization
      • Initialization.Chirality
      • Initialization.Compass
      • InitializationMethod
      • InitializationMethod.DistanceSortedVectorList
      • InitializationMethodManager
      • InitializationMethodManager.AlgorithmInfo
      • InitializationStateSaveData
      • Log
      • MaterialDatabase
      • MessageSaveData
      • MinMax
      • MouseController
      • PSPlacementMode
      • ParticleAttributeEnumSaveData
      • ParticleAttributePCSaveData
      • ParticleAttributeSaveDataBase
      • ParticleAttributeSaveData<T>
      • ParticleObjectSaveData
      • ParticleStateSaveData
      • PinConfigurationHistorySaveData
      • PinConfigurationSaveData
      • RandomNumberGenerator
      • SaveStateUtility
      • SimulationStateSaveData
      • StatusInfoAttribute
      • TypeConverter
      • TypeConverter.ConversionResult
      • UIDatabase
      • ValueHistorySaveData<T>
    • AS2.Algos.BeepFailureTest
      • BeepFailureTestParticle
    • AS2.Algos.BinOpTest
      • BinOpTestInitializer
      • BinOpTestParticle
      • BinOpTestParticle.Mode
    • AS2.Algos.BoundaryTest
      • BoundaryTestParticle
      • Phase
      • SCMode
    • AS2.Algos.BoundaryTestSub
      • BoundaryTestSubParticle
    • AS2.Algos.ChiralityCompass
      • ChiralityAndCompassInitializer
      • ChiralityAndCompassParticle
      • CoinTossResult
      • DirectionMessage
    • AS2.Algos.CollisionTestAlgo
      • CollisionTestAlgoInitializer
      • CollisionTestAlgoParticle
    • AS2.Algos.CollisionTestAlgo2
      • CollisionTestAlgo2Initializer
      • CollisionTestAlgo2Particle
      • Role
    • AS2.Algos.ExpandedCircuitTest
      • ExpandedCircuitTestInitializer
      • ExpandedCircuitTestParticle
    • AS2.Algos.JMTest
      • JMTestInitializer
      • JMTestParticle
    • AS2.Algos.LeaderElection
      • LeaderElectionInitializer
      • LeaderElectionParticle
    • AS2.Algos.LineFormation
      • LineFormationInitializer
      • LineFormationParticleSync
      • LineFormationParticleSync.LFState
      • MyMessage
      • MyMessage.Direction
    • AS2.Algos.ObjectTest
      • ObjectTestInitializer
      • ObjectTestParticle
    • AS2.Algos.PASCTestAlgo
      • PASCTestAlgoInitializer
      • PASCTestAlgoParticle
    • AS2.Algos.SingleSourceSP
      • SingleSourceSPInitializer
      • SingleSourceSPParticle
      • SingleSourceSPParticle.Phase
    • AS2.Algos.SmartMaterial
      • SmartMaterialInitializer
      • SmartMaterialParticle
    • AS2.Algos.SubroutineTest
      • SubroutineTestInitializer
      • SubroutineTestParticle
    • AS2.Algos.SubroutineTest2
      • SubroutineTest2Initializer
      • SubroutineTest2Particle
    • AS2.Sim
      • ActionType
      • AlgorithmException
      • AmoebotSimException
      • BondMovementInfo
      • BondMovementInfoList
      • Circuit
      • CollisionChecker
      • CollisionChecker.DebugLine
      • EdgeMovement
      • IParticleAttribute
      • IParticleObject
      • IReplayHistory
      • InitializationParticle
      • InvalidActionException
      • JointMovementInfo
      • Message
      • Neighbor<T>
      • OpenInitParticle
      • Particle
      • ParticleAction
      • ParticleAlgorithm
      • ParticleAttributeBase
      • ParticleAttributeFactory
      • ParticleAttributeWithHistory<T>
      • ParticleAttribute_Bool
      • ParticleAttribute_Direction
      • ParticleAttribute_Enum<T>
      • ParticleAttribute_Float
      • ParticleAttribute_Int
      • ParticleAttribute_PinConfiguration
      • ParticleAttribute_String
      • ParticleAttribute<T>
      • ParticleException
      • ParticleFactory
      • ParticleObject
      • ParticleSystem
      • ParticleSystem_Utils
      • PartitionSet
      • Pin
      • PinConfiguration
      • SimulationException
      • SimulatorException
      • SimulatorStateException
      • SysPartitionSet
      • SysPin
      • SysPinConfiguration
      • ValueHistoryBondInfo
      • ValueHistoryJointMovement
      • ValueHistoryMessage
      • ValueHistoryPinConfiguration
      • ValueHistory<T>
    • AS2.Subroutines
      • Subroutine
    • AS2.Subroutines.BinStateHelpers
      • BinAttributeBitField
      • BinAttributeBool
      • BinAttributeDirection
      • BinAttributeEnum<T>
      • BinAttributeInt
      • BinAttribute<T>
    • AS2.Subroutines.BinaryOps
      • BinOpUtils
      • SubAddition
      • SubBinOps
      • SubBinOps.Mode
      • SubComparison
      • SubComparison.ComparisonResult
      • SubDivision
      • SubMSBDetection
      • SubMultiplication
      • SubSubtraction
    • AS2.Subroutines.BoundaryTest
      • SubBoundaryTest
    • AS2.Subroutines.ETT
      • Comparison
      • SubETT
    • AS2.Subroutines.LeaderElection
      • SubLeaderElection
    • AS2.Subroutines.LeaderElectionFast
      • SubLeaderElectionFast
    • AS2.Subroutines.LeaderElectionSync
      • SubLeaderElectionSync
    • AS2.Subroutines.PASC
      • SubPASC
      • SubPASC2
      • SubPASC2.NbrType
    • AS2.UI
      • ButtonHoldTrigger
      • ClickAction
      • ClickAction.ClickButton
      • ClickAction.ClickType
      • InitializationUIHandler
      • InputAction
      • InputAction.InputType
      • InputController
      • InputHandler
      • InputHandler.MouseState
      • InputManager
      • LineDrawer
      • LogUIHandler
      • LogUIHandler.EntryType
      • ObjectUIHandler
      • ParticleUIExtensionSmoothLerp
      • ParticleUIHandler
      • SettingsUIHandler
      • SizeFitter
      • Tooltip
      • TooltipHandler
      • UIHandler
      • UIHandler.UITool
      • UISetting
      • UISetting_Color
      • UISetting_Color.InputType
      • UISetting_Dropdown
      • UISetting_Header
      • UISetting_MinMax
      • UISetting_MinMax.InputType
      • UISetting_Slider
      • UISetting_Spacing
      • UISetting_Text
      • UISetting_Text.InputType
      • UISetting_Toggle
      • UISetting_ValueSlider
      • WorldSpaceBackgroundUIHandler
      • WorldSpaceUIHandler
      • WorldSpaceUIHandler.ParticleTextUIData
      • WorldSpaceUIHandler.TextType
    • AS2.Visuals
      • CircleDistributionCircleArea
      • CircleDistributionCircleLine
      • IGenerateDynamicMesh
      • IObjectInfo
      • IParticleGraphicsAdapter
      • IParticleState
      • InstancedDrawer
      • MaterialPropertyBlockData
      • MaterialPropertyBlockData_Circuits
      • MaterialPropertyBlockData_Objects
      • MaterialPropertyBlockData_Particles
      • MeshCreator_CircularView
      • MeshCreator_HexagonalView
      • ObjectGraphicsAdapter
      • ObjectGraphicsAdapter.VertexInfo
      • PSetDragHandler
      • ParticleBondGraphicState
      • ParticleGraphicsAdapterImpl
      • ParticleGraphicsAdapterImpl.ParticleMovement
      • ParticleGraphicsAdapterImpl.PositionSnap
      • ParticleJointMovementState
      • ParticleMovementState
      • ParticlePinGraphicState
      • ParticlePinGraphicState.CodeOverrideType_Node
      • ParticlePinGraphicState.NeighborPinConnection
      • ParticlePinGraphicState.PSetData
      • ParticlePinGraphicState.PSetData.GraphicalData
      • ParticlePinGraphicState.PSetData.GraphicalData.CodeOverrideType_PSet
      • ParticlePinGraphicState.PinDef
      • PartitionSetViewType
      • Polar2DCoordinate
      • PriorityQueue<T>
      • RenderBatchIndex
      • RenderSystem
      • RendererBackground
      • RendererCircuitPins_RenderBatch
      • RendererCircuitPins_RenderBatch.PropertyBlockData
      • RendererCircuitsAndBonds
      • RendererCircuits_Instance
      • RendererCircuits_Instance.GDRef
      • RendererCircuits_Instance.ParticleCircuitData
      • RendererCircuits_Instance.ParticleCircuitData.PSetInnerPinRef
      • RendererCircuits_Instance.ParticleCircuitData.PSetInnerPinRef.PinType
      • RendererCircuits_RenderBatch
      • RendererCircuits_RenderBatch.PropertyBlockData
      • RendererCircuits_RenderBatch.PropertyBlockData.ActiveState
      • RendererCircuits_RenderBatch.PropertyBlockData.LineType
      • RendererObjects
      • RendererParticles
      • RendererParticles_RenderBatch
      • RendererParticles_RenderBatch.PropertyBlockData
      • RendererUI
      • TextureCreator
      • ViewType
    • AS2.Visuals.Library
      • DegreeConstants
      • InterpolationConstants
      • MatrixConstants
      • MeshConstants
      • VectorConstants
      • BasicSample
      • CanvasSampleSaveFileImage
      • CanvasSampleSaveFileText
      • HexagonalExpansionPrototype

    Class RendererCircuits_RenderBatch

    Renderer for the circuits. Each instance of this class renders circuit lines with the same properties (like color, type, etc.) with Unity's instanced drawing. The class handles circuit lines inside of particles, circuit connections between the particles and bonds. Each instance only renders one type of line.

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

    Constructors

    RendererCircuits_RenderBatch(PropertyBlockData)

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

    Fields

    circuitMatrices_Lines

    Declaration
    private List<Matrix4x4[]> circuitMatrices_Lines
    Field Value
    Type Description
    List<Matrix4x4[]>

    circuitQuad

    Declaration
    private Mesh circuitQuad
    Field Value
    Type Description
    Mesh

    currentIndex

    Declaration
    private int currentIndex
    Field Value
    Type Description
    int

    endPositions1

    Declaration
    private List<Vector2[]> endPositions1
    Field Value
    Type Description
    List<Vector2[]>

    endPositions2

    Declaration
    private List<Vector2[]> endPositions2
    Field Value
    Type Description
    List<Vector2[]>

    lastBeepStartTime

    Declaration
    private float lastBeepStartTime
    Field Value
    Type Description
    float

    lineMaterial

    Declaration
    private Material lineMaterial
    Field Value
    Type Description
    Material

    lineWidth

    Declaration
    private float lineWidth
    Field Value
    Type Description
    float

    maxArraySize

    Declaration
    private const int maxArraySize = 1023
    Field Value
    Type Description
    int

    properties

    Declaration
    public RendererCircuits_RenderBatch.PropertyBlockData properties
    Field Value
    Type Description
    RendererCircuits_RenderBatch.PropertyBlockData

    propertyBlock_circuitMatrices_Lines

    Declaration
    private MaterialPropertyBlockData_Circuits propertyBlock_circuitMatrices_Lines
    Field Value
    Type Description
    MaterialPropertyBlockData_Circuits

    startPositions1

    Declaration
    private List<Vector2[]> startPositions1
    Field Value
    Type Description
    List<Vector2[]>

    startPositions2

    Declaration
    private List<Vector2[]> startPositions2
    Field Value
    Type Description
    List<Vector2[]>

    zOffset

    Declaration
    private float zOffset
    Field Value
    Type Description
    float

    Methods

    AddLine(Vector2, Vector2)

    Adds a line from A to B.

    Declaration
    public RenderBatchIndex AddLine(Vector2 globalLineStartPos, Vector2 globalLineEndPos)
    Parameters
    Type Name Description
    Vector2 globalLineStartPos

    The global start position A of the line.

    Vector2 globalLineEndPos

    The global end position B of the line.

    Returns
    Type Description
    RenderBatchIndex

    The batch index of the new line in this batch.

    AddManuallyUpdatedLine(Vector2, Vector2, Vector2, Vector2)

    Adds a animated line from A to B which can move to the line from A' to B'.

    Declaration
    public void AddManuallyUpdatedLine(Vector2 globalLineStartPos, Vector2 globalLineEndPos, Vector2 globalLineStartPos2, Vector2 globalLineEndPos2)
    Parameters
    Type Name Description
    Vector2 globalLineStartPos

    The start position A of the line at the beginning of the animation.

    Vector2 globalLineEndPos

    The end position B of the line at the beginning of the animation.

    Vector2 globalLineStartPos2

    The start position A' of the line at the end of the animation.

    Vector2 globalLineEndPos2

    The end position B' of the line at the end of the animation.

    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.

    ApplyUpdates(float, float)

    Applies the new data for the timing of animations and beeps.

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

    Start time of the animation.

    float beepStartTime

    Start time of the beeps.

    CalculateAnimationFrame()

    Calculates the interpolated line matrices for a point in time of an animation. This should done every frame if the animations are running.

    DEPRECATED: Try to replace this with the new shader animations. This is more performant and straightforward.

    Declaration
    private void CalculateAnimationFrame()

    CalculateLineMatrix(Vector2, Vector2)

    Calculates the line matrix from the positional information about the line. We basically take a standard quad and transform it so that it forms a line. The pivot of the quad must be at the center of the quad's left side.

    Declaration
    private Matrix4x4 CalculateLineMatrix(Vector2 posStart, Vector2 posEnd)
    Parameters
    Type Name Description
    Vector2 posStart

    The start position of the line.

    Vector2 posEnd

    The end position of the line.

    Returns
    Type Description
    Matrix4x4

    A transformation, rotation, scaling matrix for the new line.

    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()

    Init()

    Initializes the materials based on the circuit render batch type. Also sets certain parameters for the property blocks and general settings of this class.

    Declaration
    public void Init()

    RegenerateMeshes()

    Regenerates the meshes of this class.

    Declaration
    public void RegenerateMeshes()

    Render(ViewType, bool)

    Draws the circuits to the screen based on current settings.

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

    The view type of the system. Useful for deciding what should be shown.

    bool firstRenderFrame

    Set to true if a new round has just begun, so that the new timing settings can be applied.

    UpdateLine(Vector2, Vector2, RenderBatchIndex)

    Updates a line from A to B.

    Declaration
    public void UpdateLine(Vector2 globalLineStartPos, Vector2 globalLineEndPos, RenderBatchIndex index)
    Parameters
    Type Name Description
    Vector2 globalLineStartPos

    The start position A of the line.

    Vector2 globalLineEndPos

    The end position B of the line.

    RenderBatchIndex index

    The index of the line to update.

    Implements

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