|
NSUNI/NSLAR Library a250670
|
Classes | |
| struct | nnl::shadow_collision::Triangle |
| Struct defining a single triangle for projecting shadows onto it. More... | |
| struct | nnl::shadow_collision::CollisionTest |
| Struct representing a set of triangles to be tested for shadow projection. More... | |
| struct | nnl::shadow_collision::Collision |
| Struct that contains all necessary information for performing shadow projection. More... | |
Functions | |
| SModel | nnl::shadow_collision::Convert (const Collision &collision) |
| Converts collision data from the in-game format to a simplified model representation. | |
| Collision | nnl::shadow_collision::Convert (SModel &&smodel, bool auto_cull=true, u32 shift=1) |
| Converts a simplified representation of a model to the in-game shadow collision format that is used for shadow projection. | |
| bool | nnl::shadow_collision::IsOfType (BufferView buffer) |
| Tests if the provided file is a shadow collision. | |
| Collision | nnl::shadow_collision::Import (BufferView buffer) |
| Parses a binary file and converts it to a structured collision. | |
| Buffer | nnl::shadow_collision::Export (const Collision &collision) |
| Converts a shadow collision config to a binary file representation. | |
| struct nnl::shadow_collision::Triangle |
Struct defining a single triangle for projecting shadows onto it.
Public Attributes | |
| std::array< u16, 3 > | indices_vertices {0} |
| u16 | shadow_features = 0 |
| std::array<u16, 3> nnl::shadow_collision::Triangle::indices_vertices {0} |
Indices of the triangle's vertices.
| struct nnl::shadow_collision::CollisionTest |
Struct representing a set of triangles to be tested for shadow projection.
The CollisionTest struct holds the indices of the triangles that are relevant for shadow projection at the player's current position.
| struct nnl::shadow_collision::Collision |
Struct that contains all necessary information for performing shadow projection.
The Collision struct contains parameters and data structures necessary for projection of fake shadows.
Public Attributes | |
| u16 | shift_value = 1 |
| glm::vec3 | origin_point {0.0f} |
| std::vector< glm::vec3 > | vertices |
| std::vector< Triangle > | triangles |
| List of triangles in the collision environment. | |
| utl::Array3D< CollisionTest > | coordinate_map |
| utl::Array3D<CollisionTest> nnl::shadow_collision::Collision::coordinate_map |
A 3D array that maps coordinates that the player can end up in to the corresponding collision tests. ((current_pos - origin_point)>>(shift_value+5))
| glm::vec3 nnl::shadow_collision::Collision::origin_point {0.0f} |
Represents the origin point in 3D space. All coordinates in the coordinate_map are assumed to be positive offsets relative to it.
| u16 nnl::shadow_collision::Collision::shift_value = 1 |
The exponent of 2 that determines how the entire collision space is divided into smaller parts. E.g, the player's coordinates are shifted by this value to get a relevant entry in the coordinate_map.
| std::vector<Triangle> nnl::shadow_collision::Collision::triangles |
List of triangles in the collision environment.
| std::vector<glm::vec3> nnl::shadow_collision::Collision::vertices |
The vertices that are used to define the triangles involved in shadow projection.
Converts collision data from the in-game format to a simplified model representation.
| collision | The in-game shadow collision format to be converted. |
Converts a simplified representation of a model to the in-game shadow collision format that is used for shadow projection.
| smodel | The source model to be converted. |
| auto_cull | Automatically remove triangles that do not belong to the ground. |
| shift | The exponent of 2 that determines how the whole collision space is divided. Larger values can reduce the size of data but make collision testing slower. |
Converts a shadow collision config to a binary file representation.
This function takes a Collision object and converts it into a Buffer, which represents the binary format of the collision.
| collision | The Collision object to be converted into a binary format. |
| Collision nnl::shadow_collision::Import | ( | BufferView | buffer | ) |
Parses a binary file and converts it to a structured collision.
This function takes a binary representation of a shadow collision config, parses its contents, and converts them into a Collision struct for easier access and manipulation.
| buffer | The binary data to be processed. |
| bool nnl::shadow_collision::IsOfType | ( | BufferView | buffer | ) |
Tests if the provided file is a shadow collision.
This function takes a file buffer and checks whether it corresponds to the in-game shadow collision format.
| buffer | The data to be tested. |