Renamaed Files to make it "Less confusing"
This commit is contained in:
+1
-20
@@ -1,29 +1,10 @@
|
||||
#include <iostream>
|
||||
|
||||
// Include the vector utilities header file
|
||||
#include "vector/utils_vec.hpp"
|
||||
#include "vector/vec_utils.hpp"
|
||||
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user