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

Classes

struct  nnl::colbox::CollisionBox14
 Represents a collision box. More...
struct  nnl::colbox::CollisionBox18
 Represents a collision box. More...
struct  nnl::colbox::CollisionBox20
 Represents a collision box in a hitbox config. More...
struct  nnl::colbox::HitboxConfig
 Represents a hitbox config. More...
struct  nnl::colbox::ColBoxConfig
 Represents the configuration for various collision boxes of a character. More...

Functions

bool nnl::colbox::IsOfType (BufferView buffer)
 Tests if the provided file is a collision box config.
ColBoxConfig nnl::colbox::Import (BufferView buffer)
 Parses a binary file and converts it to a structured CollisionBoxConfig.
Buffer nnl::colbox::Export (const ColBoxConfig &colbox_config)
 Converts a CollisionBoxConfig to a binary file representation.

Detailed Description


Class Documentation

◆ nnl::colbox::CollisionBox14

struct nnl::colbox::CollisionBox14

Represents a collision box.

This struct allows you to configure collision boxes that can be used in interactions with the environment, other entities, and damage handling.

See also
nnl::colbox::ColBoxConfig

Public Attributes

model::BoneTarget bone_target = 0
u16 unknown2 = 0
 unknown: equals to 1 in NSLAR (in damage, attack boxes)
glm::vec3 translation {0.0f}
f32 size = 4.0f
 Specifies the size of the box.

Member Data Documentation

◆ bone_target

model::BoneTarget nnl::colbox::CollisionBox14::bone_target = 0

Specifies the bone to which this box will be attached.

See also
nnl::model::HumanoidRigTarget

◆ size

f32 nnl::colbox::CollisionBox14::size = 4.0f

Specifies the size of the box.

◆ translation

glm::vec3 nnl::colbox::CollisionBox14::translation {0.0f}

Specifies the position of the box relative to the bone.

◆ unknown2

u16 nnl::colbox::CollisionBox14::unknown2 = 0

unknown: equals to 1 in NSLAR (in damage, attack boxes)

◆ nnl::colbox::CollisionBox18

struct nnl::colbox::CollisionBox18

Represents a collision box.

This struct allows you to configure collision boxes that can be used to detect collisions with other entities.

Note
Used only in NSLAR!
See also
nnl::colbox::ColBoxConfig

Public Attributes

model::BoneTarget bone_target = 0
u16 unknown2 = 0
 unknown
glm::vec3 translation {0.0f}
f32 size = 4.0f
 Specifies the size of the box.
f32 unknown14 = 0.0f
 Unknown.

Member Data Documentation

◆ bone_target

model::BoneTarget nnl::colbox::CollisionBox18::bone_target = 0

Specifies the bone to which this box will be attached.

See also
nnl::model::HumanoidRigTarget

◆ size

f32 nnl::colbox::CollisionBox18::size = 4.0f

Specifies the size of the box.

◆ translation

glm::vec3 nnl::colbox::CollisionBox18::translation {0.0f}

Specifies the position of the box relative to the bone.

◆ unknown14

f32 nnl::colbox::CollisionBox18::unknown14 = 0.0f

Unknown.

◆ unknown2

u16 nnl::colbox::CollisionBox18::unknown2 = 0

unknown

◆ nnl::colbox::CollisionBox20

struct nnl::colbox::CollisionBox20

Represents a collision box in a hitbox config.

See also
nnl::colbox::ColBoxConfig
nnl::colbox::HitboxConfig

Public Attributes

model::BoneTarget bone_target = 0
u16 distance_attack = 0
glm::vec3 translation {0.0f}
glm::vec3 translation_2 {0.0f}
f32 size = 0
 Specifies the size of the box.

Member Data Documentation

◆ bone_target

model::BoneTarget nnl::colbox::CollisionBox20::bone_target = 0

Specifies the bone to which this box will be attached.

See also
nnl::model::HumanoidRigTarget

◆ distance_attack

u16 nnl::colbox::CollisionBox20::distance_attack = 0

Sets some flags (e.g., if a secondary box is created). Equals 5 or 1 in NSUNI.

◆ size

f32 nnl::colbox::CollisionBox20::size = 0

Specifies the size of the box.

◆ translation

glm::vec3 nnl::colbox::CollisionBox20::translation {0.0f}

Specifies the position of the box relative to the bone.

◆ translation_2

glm::vec3 nnl::colbox::CollisionBox20::translation_2 {0.0f}

Specifies the position of the second box (if distance attack is set)

◆ nnl::colbox::HitboxConfig

struct nnl::colbox::HitboxConfig

Represents a hitbox config.

See also
nnl::colbox::ColBoxConfig
nnl::action::ActionConfig

Public Attributes

u16 dmg_start_frame = 0
 The frame at which damage starts (relative to the action).
u16 dmg_end_frame = 0
 The frame at which damage ends.
u16 effect_id = 0
u8 unknownC = 1
u8 unknownD = 0
u16 unknownE = 0
 Unknown.
std::vector< CollisionBox20colboxes
 Configures parts that can deal damage.

Member Data Documentation

◆ colboxes

std::vector<CollisionBox20> nnl::colbox::HitboxConfig::colboxes

Configures parts that can deal damage.

◆ dmg_end_frame

u16 nnl::colbox::HitboxConfig::dmg_end_frame = 0

The frame at which damage ends.

◆ dmg_start_frame

u16 nnl::colbox::HitboxConfig::dmg_start_frame = 0

The frame at which damage starts (relative to the action).

◆ effect_id

u16 nnl::colbox::HitboxConfig::effect_id = 0

The ID of the effect played when the attack hits another entity. This may affect the damage it receives.

◆ unknownC

u8 nnl::colbox::HitboxConfig::unknownC = 1

Unknown, maybe an ID: affects health dmg, in most cases it goes incrementally

◆ unknownD

u8 nnl::colbox::HitboxConfig::unknownD = 0

Unknown: not used, usually equals to 0 (not in the monkey boss from NSLAR)

◆ unknownE

u16 nnl::colbox::HitboxConfig::unknownE = 0

Unknown.

◆ nnl::colbox::ColBoxConfig

struct nnl::colbox::ColBoxConfig

Represents the configuration for various collision boxes of a character.

This struct contains various configurations for collisions with the environment, other entities, and configurations for both receiving and dealing damage.

In NSUNI only attack and damage collisions (hitboxes/hurtboxes) can be changed with this configuration. Other types of collision boxes seem to be unaffected by it. However, everything works correctly in NSLAR.

Note
This struct stores only a portion of the data that may be required by a 3D asset to function properly. Its binary representation must be used as part of a larger container that must also include meshes, animations, an action config and other data.
See also
nnl::asset::Asset
nnl::asset::Asset3D
nnl::model::Model
nnl::action::ActionConfig

Public Attributes

std::vector< CollisionBox14col_enviroment
std::vector< CollisionBox14col_unknown
 Unknown collision configuration.
std::vector< CollisionBox18col_entities
std::vector< CollisionBox14col_damage
 Configures parts that can receive damage (hurtboxes).
tsl::ordered_map< action::Id, std::vector< HitboxConfig > > col_attack
 Configures parts that can deal damage (hitboxes).

Member Data Documentation

◆ col_attack

tsl::ordered_map<action::Id, std::vector<HitboxConfig> > nnl::colbox::ColBoxConfig::col_attack

Configures parts that can deal damage (hitboxes).

◆ col_damage

std::vector<CollisionBox14> nnl::colbox::ColBoxConfig::col_damage

Configures parts that can receive damage (hurtboxes).

◆ col_entities

std::vector<CollisionBox18> nnl::colbox::ColBoxConfig::col_entities

Configures collisions with other entities

Note
Functions only in NSLAR!

◆ col_enviroment

std::vector<CollisionBox14> nnl::colbox::ColBoxConfig::col_enviroment

Configures collisions with the static environment.

See also
nnl::collision::Collision
Note
Functions only in NSLAR!

◆ col_unknown

std::vector<CollisionBox14> nnl::colbox::ColBoxConfig::col_unknown

Unknown collision configuration.

Function Documentation

◆ Export()

Buffer nnl::colbox::Export ( const ColBoxConfig & colbox_config)
nodiscard

Converts a CollisionBoxConfig to a binary file representation.

Parameters
colbox_configThe config to be converted into a binary format.
Returns
A Buffer containing the binary representation of the model.

◆ Import()

ColBoxConfig nnl::colbox::Import ( BufferView buffer)

Parses a binary file and converts it to a structured CollisionBoxConfig.

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

◆ IsOfType()

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

Tests if the provided file is a collision box config.

Parameters
bufferThe file to be tested.
Returns
Returns true if the file is identified as a collision box config;
See also
nnl::colbox::Import