|
NSUNI/NSLAR Library a250670
|
Classes | |
| struct | nnl::collision::Triangle |
| Struct defining a single triangle used in collision detection. More... | |
| struct | nnl::collision::Edge |
| Struct defining a wall edge used in collision detection. More... | |
| struct | nnl::collision::CollisionTest |
| Struct representing a set of geometric shapes for collision testing. More... | |
| struct | nnl::collision::Collision |
| Struct that contains all necessary information for collision detection. More... | |
| struct | nnl::collision::ConvertParam |
| Parameters for converting a simplified mesh to the in-game collision format. More... | |
Functions | |
| SModel | nnl::collision::Convert (const Collision &collision) |
| Converts collision data from the in-game format to a simplified model representation. | |
| Collision | nnl::collision::Convert (SModel &&smodel, const std::vector< ConvertParam > &mesh_params, bool auto_wall=true, u32 shift=5) |
| Converts a simplified representation of a model to the in-game collision format. | |
| bool | nnl::collision::IsOfType (BufferView buffer) |
| Tests if the provided file is a collision config. | |
| Collision | nnl::collision::Import (BufferView buffer) |
| Parses a binary file and converts it to a structured collision. | |
| Buffer | nnl::collision::Export (const Collision &collision) |
| Converts a collision config to a binary file representation. | |
| struct nnl::collision::Triangle |
Struct defining a single triangle used in collision detection.
Public Attributes | |
| std::array< u16, 3 > | indices_vertices {0} |
| Indices of the triangle's vertices. | |
| u16 | index_normal = 0 |
| Index of the triangle's normal. | |
| u16 | index_vertex_min = 0 |
| u16 | index_vertex_max = 0 |
| PushFeatures | push_features {} |
| Push behavior flags. | |
| SurfaceFeatures | surface_features {} |
| Surface behavior flags. | |
| u16 nnl::collision::Triangle::index_normal = 0 |
Index of the triangle's normal.
| u16 nnl::collision::Triangle::index_vertex_max = 0 |
Index of the triangle's bounding maximum coordinate (max x, max y, max z)
| u16 nnl::collision::Triangle::index_vertex_min = 0 |
Index of the triangle's bounding minimum coordinate (min x, min y, min z)
| std::array<u16, 3> nnl::collision::Triangle::indices_vertices {0} |
Indices of the triangle's vertices.
| PushFeatures nnl::collision::Triangle::push_features {} |
Push behavior flags.
| SurfaceFeatures nnl::collision::Triangle::surface_features {} |
Surface behavior flags.
| struct nnl::collision::Edge |
Struct defining a wall edge used in collision detection.
This structure seems to be optional and likely serves as an optimization for collision detection with "wall" triangles.
Public Attributes | |
| std::array< u16, 2 > | indices_vertices {0} |
| Indices of the edge's vertices. | |
| u16 | index_vertex_min = 0 |
| u16 | index_vertex_max = 0 |
| u16 | index_normal = 0 |
| Index of the flipped triangle's normal. | |
| u16 nnl::collision::Edge::index_normal = 0 |
Index of the flipped triangle's normal.
| u16 nnl::collision::Edge::index_vertex_max = 0 |
Index of the edge's bounding maximum coordinate (max x, max y, max z)
| u16 nnl::collision::Edge::index_vertex_min = 0 |
Index of the edge's bounding minimum coordinate (min x, min y, min z)
| std::array<u16, 2> nnl::collision::Edge::indices_vertices {0} |
Indices of the edge's vertices.
| struct nnl::collision::CollisionTest |
Struct representing a set of geometric shapes for collision testing.
The CollisionTest struct holds the indices of geometric shapes that are relevant for collision testing at the player's current position.
Public Attributes | |
| std::vector< u16 > | triangle_indices |
| std::vector< u16 > | triangle_wall_indices |
| std::vector< u16 > | edge_wall_indices |
| std::vector<u16> nnl::collision::CollisionTest::edge_wall_indices |
Holds the indices of "wall" edges to be tested. These seem to be an optional optimization.
| std::vector<u16> nnl::collision::CollisionTest::triangle_indices |
Holds the indices of triangles to be tested.
| std::vector<u16> nnl::collision::CollisionTest::triangle_wall_indices |
Holds the indices of "wall" triangles to be tested.
| struct nnl::collision::Collision |
Struct that contains all necessary information for collision detection.
The Collision struct contains parameters and data structures necessary for performing collision detection.
Public Attributes | |
| u16 | shift_value = 5 |
| glm::vec3 | origin_point {0.0f} |
| std::vector< glm::vec3 > | vertices |
| std::vector< glm::vec3 > | normals |
| Normal vectors associated with the geometric shapes. | |
| std::vector< Triangle > | triangles |
| List of triangles. | |
| std::vector< Edge > | edges |
| List of wall edges. | |
| utl::Array3D< CollisionTest > | coordinate_map |
| utl::Array3D<CollisionTest> nnl::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)
| std::vector<Edge> nnl::collision::Collision::edges |
List of wall edges.
| std::vector<glm::vec3> nnl::collision::Collision::normals |
Normal vectors associated with the geometric shapes.
| glm::vec3 nnl::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::collision::Collision::shift_value = 5 |
The exponent of 2 that determines how the entire collision space is divided into smaller parts. The player's coordinates are shifted by this value to get a relevant entry in the coordinate_map.
| std::vector<Triangle> nnl::collision::Collision::triangles |
List of triangles.
| std::vector<glm::vec3> nnl::collision::Collision::vertices |
The vertices that are used to define the geometric shapes involved in collision detection.
| struct nnl::collision::ConvertParam |
Parameters for converting a simplified mesh to the in-game collision format.
This struct contains settings that configure collision meshes.
|
strong |
Enum representing different push behaviors for entities.
This enum defines various settings that determine how entities interact with collision surfaces when they get too close to them.
|
strong |
Enum representing different settings for surfaces.
The surface features determine how an entity collides with a surface and what sounds and effects are used when it does.
Converts collision data from the in-game format to a simplified model representation.
| collision | The in-game collision format to be converted. |
| Collision nnl::collision::Convert | ( | SModel && | smodel, |
| const std::vector< ConvertParam > & | mesh_params, | ||
| bool | auto_wall = true, | ||
| u32 | shift = 5 ) |
Converts a simplified representation of a model to the in-game collision format.
| smodel | The source model to be converted. |
| mesh_params | The parameters that dictate how the conversion should be performed for each mesh. |
| auto_wall | Automatically set appropriate PushFlags. |
| 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 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::collision::Import | ( | BufferView | buffer | ) |
Parses a binary file and converts it to a structured collision.
This function takes a binary representation of a 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::collision::IsOfType | ( | BufferView | buffer | ) |
Tests if the provided file is a collision config.
This function takes data representing a file and checks whether it corresponds to the in-game collision format.
| buffer | The data to be tested. |