Skip to content

Game.Tools.ClearAreaData

Assembly: Game
Namespace: Game.Tools

Type: struct

Base: System.ValueType

Summary:
Represents a small data container used by the "clear area" tool/system. It holds a triangle (area footprint), a top Y coordinate for the area, and a flag indicating whether the area is on the ground. Typically used when determining which geometry or terrain to clear within a triangular region.


Fields

  • public Colossal.Mathematics.Triangle3 m_Triangle
    Holds the triangle that defines the area footprint to clear. The Triangle3 value contains the triangle's vertex positions in world (or local) space and is used for spatial tests and overlap checks.

  • public float m_TopY
    The top Y coordinate (height) for the clearing operation. This can be used to limit clearing to a vertical extent or to decide which objects/terrain heights are affected.

  • public bool m_OnGround
    Flag indicating whether the area/triangle is considered to be on the ground. Useful to differ behavior for on-ground clearing versus elevated/airborne regions.

Properties

  • None.

Constructors

  • public ClearAreaData()
    Structs have an implicit parameterless constructor that initializes fields to their default values (m_Triangle zeroed, m_TopY = 0, m_OnGround = false). You can also initialize instances via an object initializer or custom constructor where appropriate.

Methods

  • None.

Usage Example

using Colossal.Mathematics;
using UnityEngine;
using Game.Tools;

// Example: create a ClearAreaData instance for a triangular area
Vector3 v0 = new Vector3(0f, 0f, 0f);
Vector3 v1 = new Vector3(10f, 0f, 0f);
Vector3 v2 = new Vector3(0f, 0f, 10f);

ClearAreaData clearData = new ClearAreaData
{
    m_Triangle = new Triangle3(v0, v1, v2), // construct Triangle3 from vertices
    m_TopY = 5.0f,                           // top height for clearing
    m_OnGround = true                        // treat as ground-level clearing
};

// Use clearData in tool logic to test overlaps / perform clearing operations