NSUNI/NSLAR Library a250670
Loading...
Searching...
No Matches

Classes

struct  nnl::posd::Position
 Represents a spawn position in the world. More...

Typedefs

using nnl::posd::PositionData = std::vector<Position>
 A vector of Position structs.

Functions

std::vector< SPositionnnl::posd::Convert (const PositionData &posd)
 Converts a spawn position config into a format that is more suitable for further exporting into other formats.
PositionData nnl::posd::Convert (const std::vector< SPosition > &positions)
 Converts a vector of spawn positions to a spawn position config.
bool nnl::posd::IsOfType (BufferView buffer)
 Tests if the provided file is a spawn position config.
PositionData nnl::posd::Import (BufferView buffer)
 Parses a binary file and converts it to PositionData.
Buffer nnl::posd::Export (const PositionData &posd)
 Converts a spawn position config to a binary file representation.

Detailed Description


Class Documentation

◆ nnl::posd::Position

struct nnl::posd::Position

Represents a spawn position in the world.

This struct is used to set spawn positions of objects, NPC's, and mission circles.

See also
nnl::posd::PositionData

Public Attributes

u32 id = 0
glm::vec3 position {0.0f}
 The 3D coordinates (x, y, z) of the position.
f32 radius = 80.0f
 May affect the size of a mission circle.
f32 rotation = 0.0f
 Rotation angle around the Y axis in degrees [-180.0, 180.0f].

Member Data Documentation

◆ id

u32 nnl::posd::Position::id = 0

Unique identifier for the position. The game may look for this id when spawning an entity.

◆ position

glm::vec3 nnl::posd::Position::position {0.0f}

The 3D coordinates (x, y, z) of the position.

◆ radius

f32 nnl::posd::Position::radius = 80.0f

May affect the size of a mission circle.

◆ rotation

f32 nnl::posd::Position::rotation = 0.0f

Rotation angle around the Y axis in degrees [-180.0, 180.0f].

Typedef Documentation

◆ PositionData

using nnl::posd::PositionData = std::vector<Position>

A vector of Position structs.

This alias represents a collection of Position objects that set spawn positions of various objects in a scene.

See also
nnl::posd::Import

Function Documentation

◆ Convert() [1/2]

std::vector< SPosition > nnl::posd::Convert ( const PositionData & posd)

Converts a spawn position config into a format that is more suitable for further exporting into other formats.

Parameters
posdThe spawn position config to be converted.
Returns
A vector of spawn positions.

◆ Convert() [2/2]

PositionData nnl::posd::Convert ( const std::vector< SPosition > & positions)

Converts a vector of spawn positions to a spawn position config.

Parameters
positionsA vector of spawn positions to be converted.
Returns
A spawn position config.

◆ Export()

Buffer nnl::posd::Export ( const PositionData & posd)
nodiscard

Converts a spawn position config to a binary file representation.

This function takes a PositionData object and converts it into a Buffer, which represents the binary format of the spawn position config.

Parameters
posdThe PositionData object to be converted into a binary format.
Returns
A Buffer containing the binary representation of the config.

◆ Import()

PositionData nnl::posd::Import ( BufferView buffer)

Parses a binary file and converts it to PositionData.

This function takes a binary representation of a spawn position config, parses its contents, and converts them into a PositionData object for easier access and manipulation.

Parameters
bufferThe binary data to be processed.
Returns
A PositionData object representing the converted data.
See also
nnl::posd::IsOfType
nnl::posd::Export

◆ IsOfType()

bool nnl::posd::IsOfType ( BufferView buffer)

Tests if the provided file is a spawn position config.

This function takes data representing a file and checks whether it corresponds to the in-game spawn position config.

Parameters
bufferThe data to be tested.
Returns
Returns true if the file is identified as a spawn position config.
See also
nnl::posd::Import