Class ObjectGraphicsAdapter
Representation of a ParticleObject in the render system. Stores all graphics-specific data of the object.
Inheritance
Namespace: AS2.Visuals
Assembly: .dll
Syntax
public class ObjectGraphicsAdapter
Constructors
| Edit this page View SourceObjectGraphicsAdapter(ParticleObject, RendererObjects)
Declaration
public ObjectGraphicsAdapter(ParticleObject obj, RendererObjects renderer)
Parameters
Type | Name | Description |
---|---|---|
ParticleObject | obj | |
RendererObjects | renderer |
Fields
| Edit this page View SourceisRegistered
Whether this object is already registered in a renderer.
Declaration
private bool isRegistered
Field Value
Type | Description |
---|---|
bool |
jmOffset
The joint movement offset registered for the current round.
Declaration
public Vector2Int jmOffset
Field Value
Type | Description |
---|---|
Vector2Int |
mesh
The mesh used to draw the object. Its origin is at
the object's origin. Is null
as long as no
mesh has been generated.
Declaration
public Mesh mesh
Field Value
Type | Description |
---|---|
Mesh |
obj
The object represented by this adapter.
Declaration
public ParticleObject obj
Field Value
Type | Description |
---|---|
ParticleObject |
propertyBlock
The property block used to render this object.
Is null
as long as the object has not been
registered for rendering.
Declaration
public MaterialPropertyBlockData_Objects propertyBlock
Field Value
Type | Description |
---|---|
MaterialPropertyBlockData_Objects |
renderer
The renderer responsible for rendering this object.
Declaration
public RendererObjects renderer
Field Value
Type | Description |
---|---|
RendererObjects |
Properties
| Edit this page View SourceColor
The color in which the object should be rendered.
Declaration
public Color Color { get; }
Property Value
Type | Description |
---|---|
Color |
IsRegistered
Whether the object adapter is registered in the render system.
Declaration
public bool IsRegistered { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page View SourceAddObject()
Adds this object to the render system.
Declaration
public void AddObject()
CalculateMatrix(bool, float)
Calculates the TRS matrix of the object's mesh for the current position and movement.
Declaration
public Matrix4x4 CalculateMatrix(bool animated = false, float animationPercentage = 1)
Parameters
Type | Name | Description |
---|---|---|
bool | animated | Whether the current movement should be animated. |
float | animationPercentage | The current percentage
of the animation. |
Returns
Type | Description |
---|---|
Matrix4x4 | The TRS matrix corresponding to the object's current position that can be applied to its mesh. |
GenerateMesh(bool)
Generates the mesh for this object.
Declaration
public void GenerateMesh(bool debug = false)
Parameters
Type | Name | Description |
---|---|---|
bool | debug | Whether the mesh lines should be displayed for debugging. |
RemoveObject()
Removes this object from the render system.
Declaration
public void RemoveObject()
UpdateColor()
Updates the object adapter's color to match the object's color.
Declaration
public void UpdateColor()