Skip to content

Game.SubSnapPoint

Assembly:
Game (Game.dll)

Namespace: Game.Tools

Type:
struct

Base:
System.ValueType

Summary:
A small, blittable data container used by snapping/tools code to represent a subsnap point — a position in 3D space plus a 2D tangent vector. Designed for use with Unity.Mathematics types (float3/float2) so it can be stored in NativeArrays and passed into Jobs efficiently.


Fields

  • public Unity.Mathematics.float3 m_Position
    Holds the 3D position of the subsnap point (typically world coordinates). Uses Unity.Mathematics.float3 for efficient math and job compatibility.

  • public Unity.Mathematics.float2 m_Tangent
    Holds a 2D tangent/ direction vector associated with the point (for example, the local tangent along a curve or road). Uses Unity.Mathematics.float2.

Properties

  • This struct does not define any properties. Use the public fields directly.

Constructors

  • public SubSnapPoint()
    Structs in C# get an implicit parameterless constructor that zero-initializes fields. No explicit constructors are defined in the source.

Methods

  • This struct defines no methods. It is a plain data holder intended for storage and fast access (including use inside Unity Jobs / NativeArrays).

Usage Example

using Unity.Mathematics;
using Unity.Collections;

// create and initialize
var snap = new SubSnapPoint {
    m_Position = new float3(10f, 0f, 20f),
    m_Tangent  = new float2(1f, 0f)
};

// store in a NativeArray for use in a job
var snaps = new NativeArray<SubSnapPoint>(1, Allocator.TempJob);
snaps[0] = snap;

// example read
float3 pos = snaps[0].m_Position;
float2 tan = snaps[0].m_Tangent;

// remember to dispose when done
snaps.Dispose();

Additional notes: - Because SubSnapPoint uses Unity.Mathematics types and only public value-type fields, it is blittable and safe to use in Burst-compiled jobs and NativeContainers. - Coordinate conventions (e.g., whether y is height) follow the consuming tool's conventions — confirm with the calling code.