Added reasons to assertions

This commit is contained in:
2023-07-23 10:15:37 -07:00
parent ef6b269141
commit 5b01eb904d
78 changed files with 357 additions and 289 deletions

View File

@ -16,7 +16,7 @@ void CapsuleMesh::calculateRing(
float_t dy,
std::vector<glm::vec3> *positions
) {
assertNotNull(positions);
assertNotNull(positions, "CapsuleMesh::calculateRing: positions cannot be null");
float_t segIncr = 1.0f / (float_t)(segments - 1);
for(int32_t s = 0; s < segments; s++ ) {
float_t x = cosf(MATH_PI * 2 * s * segIncr) * dr;
@ -30,7 +30,7 @@ void CapsuleMesh::create(
float_t radius,
float_t height
) {
assertNotNull(mesh);
assertNotNull(mesh, "CapsuleMesh::create: Mesh cannot be null");
std::vector<glm::vec3> positions;
std::vector<meshindice_t> indices;

View File

@ -12,7 +12,7 @@ void CubeMesh::buffer(
glm::vec3 pos, glm::vec3 size,
int32_t verticeStart, int32_t indiceStart
) {
assertNotNull(mesh);
assertNotNull(mesh, "CubeMesh::buffer: Mesh cannot be null");
glm::vec3 positions[CUBE_VERTICE_COUNT] = {
pos,

View File

@ -13,7 +13,7 @@ void QuadMesh::bufferQuadMeshWithZ(
glm::vec2 xy1, glm::vec2 uv1,
float_t z, int32_t verticeStart, int32_t indiceStart
) {
assertNotNull(mesh);
assertNotNull(mesh, "QuadMesh::bufferQuadMeshWithZ: Mesh cannot be null");
glm::vec3 positions[QUAD_VERTICE_COUNT] = {
glm::vec3(xy0, z),
@ -51,7 +51,7 @@ void QuadMesh::bufferCoordinates(
glm::vec2 uv0, glm::vec2 uv1,
int32_t verticeStart
) {
assertNotNull(mesh);
assertNotNull(mesh, "QuadMesh::bufferCoordinates: Mesh cannot be null");
glm::vec2 coordinates[QUAD_VERTICE_COUNT] = {
uv0, glm::vec2(uv1.x, uv0.y),
glm::vec2(uv0.x, uv1.y), uv1
@ -64,7 +64,7 @@ void QuadMesh::bufferPositions(
glm::vec2 xy0, glm::vec2 xy1,
int32_t verticeStart
) {
assertNotNull(mesh);
assertNotNull(mesh, "QuadMesh::bufferPositions: Mesh cannot be null");
glm::vec3 positions[QUAD_VERTICE_COUNT] = {
glm::vec3(xy0, 0),
glm::vec3(xy1.x, xy0.y, 0),
@ -80,7 +80,7 @@ void QuadMesh::initQuadMesh(
glm::vec2 xy1, glm::vec2 uv1,
float_t z
) {
assertNotNull(mesh);
assertNotNull(mesh, "QuadMesh::initQuadMesh: Mesh cannot be null");
mesh->createBuffers(QUAD_VERTICE_COUNT, QUAD_INDICE_COUNT);
QuadMesh::bufferQuadMeshWithZ(mesh, xy0, uv0, xy1, uv1, z, 0, 0);
}

View File

@ -8,7 +8,7 @@
using namespace Dawn;
void TriangleMesh::createTriangleMesh(Mesh *mesh) {
assertNotNull(mesh);
assertNotNull(mesh, "TriangleMesh::createTriangleMesh: Mesh cannot be null");
glm::vec3 positions[3] = {
glm::vec3(-0.5f, -0.5f, 0),