Class PointCloudDrawing
MonoBehaviour that renders a billboard-quad point cloud by accumulating per-point geometry into a single Mesh and uploading it each frame.
Inherited Members
Namespace: Unity.SimulationPro.Foundation.Visualizations
Assembly: Unity.SimulationPro.Foundation.Visualizations.dll
Syntax
public class PointCloudDrawing : MonoBehaviour
Methods
AddPoint(Vector3, Color32, float)
Appends a billboard quad at the given world position with the specified color and radius, and marks the mesh dirty.
Declaration
public void AddPoint(Vector3 point, Color32 color, float radius)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | point | The world-space center position of the point. |
| Color32 | color | The vertex color applied to all four quad vertices. |
| float | radius | The billboard radius in world units, stored in the UV's z channel for the shader. |
AddTriangle(Vector3, Color32, float)
Appends an equilateral-triangle billboard at the given world position with the specified color and radius, and marks the mesh dirty.
Declaration
public void AddTriangle(Vector3 point, Color32 color, float radius)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | point | The world-space center position of the triangle. |
| Color32 | color | The vertex color applied to all three triangle vertices. |
| float | radius | The billboard radius in world units, stored in the UV's z channel for the shader. |
Awake()
Initializes the Mesh, MeshFilter, and MeshRenderer components on Awake.
Declaration
public void Awake()
Bake()
Immediately bakes all buffered point and triangle data into the mesh, then clears the buffers and disables the component. In most cases this is not needed; the mesh is generated automatically in Update.
Declaration
public void Bake()
Clear()
Clears all buffered point and triangle geometry and marks the mesh dirty so it is rebuilt on the next Update.
Declaration
public void Clear()
Create(GameObject, int, Material)
Creates a new PointCloudDrawing GameObject, optionally parented and pre-sized, and assigns a material to it.
Declaration
public static PointCloudDrawing Create(GameObject parent = null, int numPoints = 0, Material material = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | parent | Optional parent |
| int | numPoints | Expected number of points; used to pre-allocate internal buffer capacity. |
| Material | material | The material to render with; if |
Returns
| Type | Description |
|---|---|
| PointCloudDrawing | The newly created PointCloudDrawing. |
SetCapacity(int)
Pre-allocates internal buffer capacity for the given number of points to avoid repeated allocations when adding many points.
Declaration
public void SetCapacity(int numPoints)
Parameters
| Type | Name | Description |
|---|---|---|
| int | numPoints | The expected maximum number of points. |
SetMaterial(Material)
Assigns the rendering material; if null, falls back to UnlitPointCloudMaterial.
Declaration
public void SetMaterial(Material material)
Parameters
| Type | Name | Description |
|---|---|---|
| Material | material | The material to use, or |
Update()
Rebuilds the mesh from buffered data each frame, then disables the component until more points are added.
Declaration
public void Update()