Game.Net.EdgeNodeGeometry
Assembly: Game
Namespace: Game.Net
Type: struct
Base: System.ValueType
Summary:
EdgeNodeGeometry is a lightweight data container used by the net rendering/geometry systems to describe the shape and bounds of an "edge node" (the geometry connecting two sides of a road/segment). It packs the left/right segment geometry, a middle Bezier curve, bounding volume and a few small helper values. The struct is designed to be blittable and compact so it can be used in performance-sensitive code paths (rendering, physics overlap checks, or Jobs/Burst code).
Fields
-
public Segment m_Left
Represents the geometry for the left side segment of the edge node. Typically contains the segment endpoints/tangents/offsets that describe the left wing of the connection. -
public Segment m_Right
Represents the geometry for the right side segment of the edge node. Same role as m_Left but for the opposite side. -
public Bezier4x3 m_Middle
A 4-control-point Bezier (3D) describing the middle curve of the node. This is often used for smoothly interpolating the center geometry between left and right wings. -
public Bounds3 m_Bounds
Axis-aligned bounding box enclosing this node's geometry. Used for frustum/collision checks and quick overlap tests. Should be updated whenever the other geometry fields change. -
public float4 m_SyncVertexTargetsLeft
Packed helper data for the left-side vertex synchronization. Typically encodes per-vertex target values (offsets, heights, or indices) for up to four vertices on the left wing. Stored as a Unity.Mathematics.float4 for compactness and SIMD-friendly layout. -
public float4 m_SyncVertexTargetsRight
Packed helper data for the right-side vertex synchronization; same format and purpose as m_SyncVertexTargetsLeft but for the right wing. -
public float m_MiddleRadius
A scalar radius/half-width associated with the middle Bezier. Used for quick intersection checks, approximate collision radius, or LOD decisions for the middle curve.
Properties
- This struct does not expose any C# properties; it is a plain data-only value type.
Constructors
public EdgeNodeGeometry()
(implicit default)
As a struct, EdgeNodeGeometry has an implicit parameterless constructor that zero-initializes all fields. Users typically populate the fields manually or via helper/factory methods elsewhere in the net code.
Methods
- This struct declares no methods. All manipulation/utility logic (building the bezier, computing bounds, filling sync targets) is handled by the higher-level code that produces instances of this struct.
Usage Example
// Example: creating and populating an EdgeNodeGeometry instance.
// Note: Segment, Bezier4x3 and Bounds3 are types from the game's math library (Colossal.Mathematics).
EdgeNodeGeometry node = new EdgeNodeGeometry();
// Fill left and right segments (example values; actual Segment constructor/fields vary)
node.m_Left = new Segment {
// set fields like P0, P1, tangents, etc.
};
node.m_Right = new Segment {
// set fields
};
// Build a middle Bezier from four control points
node.m_Middle = new Bezier4x3(
new float3(0f, 0f, 0f),
new float3(1f, 0f, 0f),
new float3(2f, 0f, 0f),
new float3(3f, 0f, 0f)
);
// Set sync targets (for example: per-vertex offsets or heights)
node.m_SyncVertexTargetsLeft = new float4(0f, 0.1f, 0.2f, 0f);
node.m_SyncVertexTargetsRight = new float4(0f, -0.1f, -0.2f, 0f);
// Compute/update bounds (pseudo-code; actual Bounds3 API may differ)
node.m_Bounds = Bounds3.FromPoints(
/* supply points from m_Left, m_Right and m_Middle control points */
);
// Set a middle radius for quick tests
node.m_MiddleRadius = 0.6f;
// The populated node can now be used by rendering, collision checks, or passed into Jobs/Burst code.
Notes and tips: - EdgeNodeGeometry is intended to be a simple POD (plain-old-data) struct. It is well-suited for use inside Unity Jobs / Burst because it contains only value types and Unity.Mathematics types. - When updating geometry you must also update m_Bounds to keep spatial queries correct. - The meaning/packing of m_SyncVertexTargetsLeft/Right is context-dependent; refer to the code path that consumes these fields for the exact interpretation (e.g., vertex index vs. offset vs. normalized parameter).