package com.tiedup.remake.client.renderer.obj;

/**
 * Immutable record representing a single vertex in an OBJ model.
 * Contains position (x, y, z), texture coordinates (u, v), and normal (nx, ny, nz).
 */
public record ObjVertex(
    float x,
    float y,
    float z,
    float u,
    float v,
    float nx,
    float ny,
    float nz
) {
    /**
     * Create a vertex with only position data.
     * UV and normal will be set to defaults.
     */
    public static ObjVertex ofPosition(float x, float y, float z) {
        return new ObjVertex(x, y, z, 0f, 0f, 0f, 1f, 0f);
    }

    /**
     * Create a vertex with position and UV.
     * Normal will be set to default (pointing up).
     */
    public static ObjVertex ofPositionUV(
        float x,
        float y,
        float z,
        float u,
        float v
    ) {
        return new ObjVertex(x, y, z, u, v, 0f, 1f, 0f);
    }
}
