Renamaed Files to make it "Less confusing"

This commit is contained in:
Afonso Clerigo Mendes de Sousa 2025-06-12 12:29:35 +01:00
parent b2c8aaaf09
commit 4703fa73c1
5 changed files with 10 additions and 24 deletions

View File

@ -0,0 +1 @@
#include "io_file_op.hpp"

View File

@ -0,0 +1,4 @@
#ifndef IO_FILE_OP_HPP
#define IO_FILE_OP_HPP
#endif // !IO_FILE_OP_HPP

View File

@ -1,4 +1,4 @@
#include "utils_vec.hpp" #include "vec_utils.hpp"
vec3 vec3::operator+(const vec3 &other) const vec3 vec3::operator+(const vec3 &other) const
{ {

View File

@ -1,5 +1,5 @@
#ifndef UTILS_VEC_HPP #ifndef VEC_UTILS_HPP
#define UTILS_VEC_HPP #define VEC_UTILS_HPP
#include <cstddef> #include <cstddef>
#include <cstdlib> #include <cstdlib>
@ -34,4 +34,4 @@ public:
vec3 normalize() const; vec3 normalize() const;
}; };
#endif // !UTILS_VEC_HPP #endif // !VEC_UTILS_HPP

View File

@ -1,29 +1,10 @@
#include <iostream> #include <iostream>
// Include the vector utilities header file // Include the vector utilities header file
#include "vector/utils_vec.hpp" #include "vector/vec_utils.hpp"
int main() int main()
{ {
vec3 *v1 = (vec3 *)malloc(sizeof(vec3) * 2);
if (v1 == nullptr)
{
fprintf(stderr, "Error: Memory allocation failed for vec3 array.\n");
return 1; // Exit with error code
}
for (int i = 0; i < 2; i++)
{
v1[i].setX(i + 1.0f);
v1[i].setY(i + 2.0f);
v1[i].setZ(i + 3.0f);
}
vec3 v2 = v1[0] + v1[1];
std::cout << "v2: (" << v2.getX() << ", " << v2.getY() << ", " << v2.getZ() << ")" << std::endl;
free(v1); // Free the allocated memory
return 0; return 0;
} }