Game.NodeGeometry
Assembly: Assembly-CSharp
Namespace: Game.Net
Type: struct
Base: IComponentData, IQueryTypeParameter, IEmptySerializable
Summary: NodeGeometry is a lightweight ECS component (IComponentData) used to store geometry-related data for a network node (e.g., road/node geometry) in the Cities: Skylines 2 modding environment. It holds an axis-aligned bound, and a few float values describing the node's placement and shape adjustments. As an IQueryTypeParameter it can be used directly in queries, and IEmptySerializable indicates it's compatible with the game's serialization system (empty-serializable marker).
Fields
-
public Bounds3 m_Bounds
Stores the axis-aligned bounding volume for the node. Bounds3 (from Colossal.Mathematics) describes the min/max extents in 3D space and is useful for spatial queries, culling, or overlap tests for the node geometry. -
public float m_Position
A float describing a position parameter for the node. Depending on usage this typically encodes a normalized position along a segment or a relative placement factor for the node's geometry. -
public float m_Flatness
A float indicating how "flat" the node geometry is — e.g., a smoothing/flattening factor used when blending node heights with adjacent segments. Higher or lower values may influence vertical smoothing behavior. -
public float m_Offset
A lateral or vertical offset value applied to the node geometry. This can be used to shift the node relative to a reference line or center, for example to represent lane offsets or minor adjustments to placement.
Properties
- None declared on this struct.
This type exposes only public fields and relies on ECS-style component data access (via EntityManager/ComponentSystem) rather than properties.
Constructors
public NodeGeometry()
Default value-type constructor is used (compiler-generated). To initialize values explicitly, construct with an object initializer or assign fields after creating the struct. Example: new NodeGeometry { m_Bounds = ..., m_Position = 0f, m_Flatness = 1f, m_Offset = 0f }.
Methods
- None declared.
The struct does not define instance methods. Any behavior operating on NodeGeometry data is expected to be implemented by systems or utility functions elsewhere. It implements marker/serialization interfaces but does not provide custom serialization code in this declaration.
Usage Example
using Colossal.Mathematics;
using Unity.Entities;
using Unity.Mathematics;
using Game.Net;
// Create an Entity and add NodeGeometry as a component
var em = World.DefaultGameObjectInjectionWorld.EntityManager;
var entity = em.CreateEntity();
// Example bounds (min and max)
var min = new float3(-0.5f, 0f, -0.5f);
var max = new float3(0.5f, 1f, 0.5f);
var bounds = new Bounds3(min, max);
var nodeGeom = new NodeGeometry
{
m_Bounds = bounds,
m_Position = 0.0f,
m_Flatness = 1.0f,
m_Offset = 0.0f
};
em.AddComponentData(entity, nodeGeom);
Notes: - Because NodeGeometry is a plain data struct intended for ECS, prefer setting values directly and operating on them from systems (e.g., ComponentSystem or SystemBase). - The exact meaning of the float fields can depend on the surrounding network/renderer code; inspect systems that read NodeGeometry for precise semantics in context.