Namespace AS2.Visuals
Classes
CircleDistributionCircleArea
Helper class for distributing points evenly inside a circle. Uses a modified version of Lloyd's algorithm. The random number generator used by the algorithm is reset on every call so that the results are deterministic.
CircleDistributionCircleLine
Helper class for distributing points evenly on a circle. Uses a modified version of Lloyd's algorithm. The random number generator used by the algorithm is reset on every call so that the results are deterministic.
InstancedDrawer
Helper for instanced drawing of matrices. Contains a dynamically extendable list of matrices and lets you add matrices that should be drawn. Automatically adds new matrix arrays if the max. count of instanced drawing is reached. Once the structure is built, created lists stay in the system, so no new objects are created and the system works with maximal efficiency.
MaterialPropertyBlockData
Wrapper for a UnityEngine.MaterialPropertyBlock
.
Can contain methods that dynamically set its values.
MaterialPropertyBlockData_Circuits
Contains a MaterialPropertyBlock
instance for
the circuit system. Used for updating the block.
MaterialPropertyBlockData_Objects
Contains a MaterialPropertyBlock
instance for
rendering objects.
MaterialPropertyBlockData_Particles
Contains a UnityEngine.MaterialPropertyBlock
instance
for the particle renderer. Used for updating the block.
MeshCreator_CircularView
Creates the meshes for the circular view.
MeshCreator_HexagonalView
Creates the meshes for the hexagonal views.
ObjectGraphicsAdapter
Representation of a ParticleObject in the render system. Stores all graphics-specific data of the object.
PSetDragHandler
Handles the dragging of partition sets using the partition set drag tool.
ParticleGraphicsAdapterImpl
Implementation of IParticleGraphicsAdapter.
ParticlePinGraphicState
A class that is created by the system to store a simplified version of the current state of the circuits of a single particle. This serves as a data container which updates the render system in each new configuration of the system.
ParticlePinGraphicState.PSetData
Stores information belonging to a single partition set.
ParticlePinGraphicState.PSetData.GraphicalData
Stores internal graphical data belonging to a ParticlePinGraphicState.PSetData instance.
PriorityQueue<T>
RenderSystem
Base class for all the rendering of the particles. Stores most render settings and initiates the render process. The render system is a tree-like structure with multiple sub-parts which all have their individual tasks. RendererBackground: Renders the background. RendererParticles: Renders particles, circuits and connections. RendererUI: Renders the overlay over particles.
RendererBackground
Renders the background grid. Both the hexagonal grid and the graph view are supported.
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.
RendererCircuitsAndBonds
The renderer for the circuits and bonds. In 2 instances which alternate in drawing to the screen, we update the graphical data and draw the instance once all data is ready and the new round should be displayed. After the displayed data is not shown anymore, everything is discarded and built up again. We make sure that no matrices are ever discarded and do not get garbage collection issues.
(The idea with the instances is used to possibly update data over multiple frames and still show the old instance, so the performance does not drop when a new round is calculated. This system has not yet been implemented completely since the idea came later, so we still build everything in one round, which is performant enough for a certain amount of particles. The particle rendering and render loop steering would also need to be updated to fully make use of the new system.)
RendererCircuits_Instance
The circuit and bond renderer instance that handles all the data that is added in a round. Has render batches for circuits (colorized lines) and pins (colorized dots) grouped by data with the same properties (like type, color, etc.). These batches are all rendered when the draw loop is called.
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.
RendererObjects
Renders all objects in the system.
RendererParticles
The base class of all particle rendering. Particles that are added to the system give continuous updates on their state over the ParticleGraphicsAdapterImpl class, while the system handles the necessary updates of the visual data to perform the display on the screen.
RendererParticles_RenderBatch
The renderer for the base particles and pins.
Stores many matrices in which the data for the
mesh instancing is stored and rendered with
UnityEngine.Graphics.DrawMeshInstanced(Mesh, int, Material, List{Matrix4x4})
.
RendererUI
Renderer for the UI. Basically draws the overlay for the currently selected tool over the particles and forwards the current tool input to the corresponding handler.
TextureCreator
This class dynamically creates textures at runtime. For example, we take textures like hexagons as input and print a variable number of pins onto it. The class also uses the generated textures to create materials.
Structs
ObjectGraphicsAdapter.VertexInfo
Helper struct storing vertex information on a single hexagon for mesh generation.
ParticleBondGraphicState
Contains the visual information for a single bond for a single round.
ParticleGraphicsAdapterImpl.PositionSnap
A snap of a position that is used to determine the current state of the particle.
ParticleJointMovementState
Contains the joint movement information for a single particle in a single round.
ParticleMovementState
Contains the position and movement information for a single particle in a single round.
ParticlePinGraphicState.PinDef
The definition of a single pin. Contains directions, id and if this pin is in the head of the particle.
Polar2DCoordinate
A polar coordinate that can be used to define positions relative to the center of a circle/quad.
RenderBatchIndex
Stores the location of a rendered object (like a matrix) in a batch structure. A batch is usually a list of arrays such that each array can be rendered in a single batch.
RendererCircuitPins_RenderBatch.PropertyBlockData
An extendable struct that functions as the key for the mapping of particles to their render class.
RendererCircuits_Instance.GDRef
A reference to graphical data belongig to a single partition set, combined with information on a line or partition set handle.
RendererCircuits_Instance.ParticleCircuitData
Represents the graphical data related to the circuit information of a single particle. Provides methods to check whether a partition set of the particle is near a given position and to update the partition set and circuit connector positions (used for the partition set dragging feature).
RendererCircuits_Instance.ParticleCircuitData.PSetInnerPinRef
Represents a single inner "pin", which can be a partition set handle or a circuit line connector. Stores the pin's position and a reference to the partition set data.
RendererCircuits_RenderBatch.PropertyBlockData
An extendable struct that functions as the key for the mapping of particles to their render class.
RendererParticles_RenderBatch.PropertyBlockData
An extendable struct that functions as the key for the mapping of particles to their render class. Particles with identical properties can be rendered in the same batch.
Interfaces
IGenerateDynamicMesh
Interface that is implemented by classes that need to regenerate meshes when certain parameters change.
IObjectInfo
Interface implemented by objects so that they can be selected and modified through the UI.
IParticleGraphicsAdapter
Serves as the bridge between the particles of the simulator and the render system. All particles have an instance of an implementation of this interface. Used to pass visual information to the graphical system and draw the particle with circuits and bonds to the screen.
IParticleState
Implemented by the particles. Contains helpful methods for the view to access standardized data from particles.
Enums
ParticleGraphicsAdapterImpl.ParticleMovement
Possible movement phases of a particle.
ParticlePinGraphicState.CodeOverrideType_Node
Types of partition set placement modes set by code override.
ParticlePinGraphicState.NeighborPinConnection
Visibility types of connections to neighboring particles.
ParticlePinGraphicState.PSetData.GraphicalData.CodeOverrideType_PSet
Types of partition set placement overrides.
PartitionSetViewType
The various placement types for partition sets inside a particle.
RendererCircuits_Instance.ParticleCircuitData.PSetInnerPinRef.PinType
Types of "pins" representing partition sets inside of a particle.
RendererCircuits_RenderBatch.PropertyBlockData.ActiveState
Simulation state for which the lines should be drawn.
RendererCircuits_RenderBatch.PropertyBlockData.LineType
The type of line that is being drawn.
ViewType
The types of views of the simulation environment. Circular = Graph View (like in the first AmoebotSim), Hexagonal = Hexagonal Grid with Hexagonal Particles, HexagonalCirc = Hexagonal Grid with Rounded Particles