Class 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})
.
Inheritance
RendererParticles_RenderBatch
Assembly: .dll
Syntax
public class RendererParticles_RenderBatch
Constructors
RendererParticles_RenderBatch(PropertyBlockData)
Declaration
public RendererParticles_RenderBatch(RendererParticles_RenderBatch.PropertyBlockData properties)
Parameters
Fields
circuitHexCircPinMaterial
Declaration
private Material circuitHexCircPinMaterial
Field Value
Type |
Description |
Material |
|
circuitHexPinMaterial
Declaration
private Material circuitHexPinMaterial
Field Value
Type |
Description |
Material |
|
curAnimationLength
Declaration
private float curAnimationLength
Field Value
graphicalDataList
Declaration
private List<ParticleGraphicsAdapterImpl> graphicalDataList
Field Value
hexagonCircWithPinsMaterial
Declaration
private Material hexagonCircWithPinsMaterial
Field Value
Type |
Description |
Material |
|
hexagonWithPinsMaterial
Declaration
private Material hexagonWithPinsMaterial
Field Value
Type |
Description |
Material |
|
jmInterpolation
Declaration
private float jmInterpolation
Field Value
matrixTRS_zero
Declaration
private Matrix4x4 matrixTRS_zero
Field Value
Type |
Description |
Matrix4x4 |
|
maxArraySize
Declaration
private const int maxArraySize = 1023
Field Value
mesh_circle_particle
Declaration
private Mesh mesh_circle_particle
Field Value
mesh_circle_particleConnector
Declaration
private Mesh mesh_circle_particleConnector
Field Value
mesh_hex_particle
Declaration
private Mesh mesh_hex_particle
Field Value
particleMatricesCircle_ConnectionMatrices_Contracted
Declaration
private List<Matrix4x4[]> particleMatricesCircle_ConnectionMatrices_Contracted
Field Value
Type |
Description |
List<Matrix4x4[]> |
|
particleMatricesCircle_ConnectionMatrices_Contracting
Declaration
private List<Matrix4x4[]> particleMatricesCircle_ConnectionMatrices_Contracting
Field Value
Type |
Description |
List<Matrix4x4[]> |
|
particleMatricesCircle_ConnectionMatrices_Expanded
Declaration
private List<Matrix4x4[]> particleMatricesCircle_ConnectionMatrices_Expanded
Field Value
Type |
Description |
List<Matrix4x4[]> |
|
particleMatricesCircle_ConnectionMatrices_Expanding
Declaration
private List<Matrix4x4[]> particleMatricesCircle_ConnectionMatrices_Expanding
Field Value
Type |
Description |
List<Matrix4x4[]> |
|
particleMatricesCircle_Contracted
Declaration
private List<Matrix4x4[]> particleMatricesCircle_Contracted
Field Value
Type |
Description |
List<Matrix4x4[]> |
|
particleMatricesCircle_Contracting
Declaration
private List<Matrix4x4[]> particleMatricesCircle_Contracting
Field Value
Type |
Description |
List<Matrix4x4[]> |
|
particleMatricesCircle_Expanded
Declaration
private List<Matrix4x4[]> particleMatricesCircle_Expanded
Field Value
Type |
Description |
List<Matrix4x4[]> |
|
particleMatricesCircle_Expanding
Declaration
private List<Matrix4x4[]> particleMatricesCircle_Expanding
Field Value
Type |
Description |
List<Matrix4x4[]> |
|
particleMatricesPins_Contracted
Declaration
private List<Matrix4x4[]> particleMatricesPins_Contracted
Field Value
Type |
Description |
List<Matrix4x4[]> |
|
particleMatricesPins_Contracting
Declaration
private List<Matrix4x4[]> particleMatricesPins_Contracting
Field Value
Type |
Description |
List<Matrix4x4[]> |
|
particleMatricesPins_Expanded
Declaration
private List<Matrix4x4[]> particleMatricesPins_Expanded
Field Value
Type |
Description |
List<Matrix4x4[]> |
|
particleMatricesPins_Expanding
Declaration
private List<Matrix4x4[]> particleMatricesPins_Expanding
Field Value
Type |
Description |
List<Matrix4x4[]> |
|
particlePositionOffsets_jointMovementsInv
Declaration
private List<Vector3[]> particlePositionOffsets_jointMovementsInv
Field Value
Type |
Description |
List<Vector3[]> |
|
particleReferences
Declaration
private List<ParticleGraphicsAdapterImpl[]> particleReferences
Field Value
particleToParticleGraphicalDataMap
Declaration
private Dictionary<IParticleState, ParticleGraphicsAdapterImpl> particleToParticleGraphicalDataMap
Field Value
properties
Declaration
public RendererParticles_RenderBatch.PropertyBlockData properties
Field Value
propertyBlock_circle_connector_contracted
Declaration
private MaterialPropertyBlockData_Particles propertyBlock_circle_connector_contracted
Field Value
propertyBlock_circle_connector_contracting
Declaration
private MaterialPropertyBlockData_Particles propertyBlock_circle_connector_contracting
Field Value
propertyBlock_circle_connector_expanded
Declaration
private MaterialPropertyBlockData_Particles propertyBlock_circle_connector_expanded
Field Value
propertyBlock_circle_connector_expanding
Declaration
private MaterialPropertyBlockData_Particles propertyBlock_circle_connector_expanding
Field Value
propertyBlock_circle_contracted
Declaration
private MaterialPropertyBlockData_Particles propertyBlock_circle_contracted
Field Value
propertyBlock_circle_contracting
Declaration
private MaterialPropertyBlockData_Particles propertyBlock_circle_contracting
Field Value
propertyBlock_circle_expanded
Declaration
private MaterialPropertyBlockData_Particles propertyBlock_circle_expanded
Field Value
propertyBlock_circle_expanding
Declaration
private MaterialPropertyBlockData_Particles propertyBlock_circle_expanding
Field Value
Methods
CutAndCopyMatrices(int, int, int, int)
Copies the values from a specific matrix id
and position to another matrix id and position.
Used for reordering matrix positions.
Declaration
private void CutAndCopyMatrices(int orig_ListNumber, int orig_ListID, int moved_ListNumber, int moved_ListID)
Parameters
Type |
Name |
Description |
int |
orig_ListNumber |
Current list index of the matrices.
|
int |
orig_ListID |
Current array index of the matrices.
|
int |
moved_ListNumber |
New list index of the matrices.
|
int |
moved_ListID |
New array index of the matrices.
|
Init()
Initializes all the property blocks and materials.
Declaration
Particle_Add(ParticleGraphicsAdapterImpl)
Adds a particle to the render batch.
Declaration
public bool Particle_Add(ParticleGraphicsAdapterImpl graphicalData)
Parameters
Returns
Type |
Description |
bool |
true if and only if the particle
was added to this render batch.
|
Particle_Remove(ParticleGraphicsAdapterImpl)
Removes a particle from the render batch. The last element
in the last array takes its position afterwards, so that we
still have valid arrays for the
UnityEngine.Graphics.DrawMeshInstanced(Mesh, int, Material, List{Matrix4x4})
method.
Declaration
public bool Particle_Remove(ParticleGraphicsAdapterImpl graphicalData)
Parameters
Returns
Type |
Description |
bool |
true if and only if the particle
was removed from this render batch.
|
Render(ViewType)
Render loop of the particles. Calculates all timings
of movements and draws the particles on the screen.
Declaration
public void Render(ViewType viewType)
Parameters
Type |
Name |
Description |
ViewType |
viewType |
The view type that should be used
to visualize the particles.
|
Render_Circular()
Circular particle drawing. Part of the render loop.
Declaration
private void Render_Circular()
Render_Hexagonal(ViewType)
Hexagonal particle drawing. Part of the render loop.
Declaration
private void Render_Hexagonal(ViewType viewType)
Parameters
ResetMatrices(int, int)
Zeroes the values at a specific matrix id and position.
If this was rendered, nothing would show up
(but at the position (0,0) the mesh would still be
drawn and have performance impact).
Declaration
private void ResetMatrices(int listNumber, int listID)
Parameters
Type |
Name |
Description |
int |
listNumber |
The list index of the matrices to reset.
|
int |
listID |
The array index of the matrices to reset.
|
SetPinsVisible(bool)
Changes the visibility setting of pins in the base
hexagon or round hexagon view mode.
Declaration
public void SetPinsVisible(bool visible)
Parameters
Type |
Name |
Description |
bool |
visible |
Whether the pins should be
visible.
|
UpdateMatrix(ParticleGraphicsAdapterImpl, bool)
Updates the matrices for a specific particle. Usually done
once per round (if executeJointMovement
is false
).
This method is also used for continuously updating the joint movements each
frame (if executeJointMovement
is set to true
).
Declaration
public void UpdateMatrix(ParticleGraphicsAdapterImpl gd, bool executeJointMovement)
Parameters
Type |
Name |
Description |
ParticleGraphicsAdapterImpl |
gd |
The graphics adapter blonging to the particle to update.
|
bool |
executeJointMovement |
Whether this is the execution of a joint
movement which is done repeatedly.
(this might seem a little odd, but the system was added later and seemed to be easily implementable it this way)
|