Volumes/apps/main.cpp

39 lines
1.2 KiB
C++
Raw Permalink Normal View History

2024-07-07 17:32:34 +02:00
#include <iostream>
2024-08-18 21:57:24 +02:00
#include "LinAlg/vector3.h"
#include "Volumes/BlockFactory.h"
2024-07-07 17:32:34 +02:00
int main(int argc, char **argv) {
2024-08-18 21:57:24 +02:00
//std::cout << "Hello, world!" << std::endl;
LinAlg::Vector3 vec(1, 2, 3);
LinAlg::Vector3 vec2(2, 1, 3);
2024-07-07 20:44:56 +02:00
std::cout<<vec<<std::endl;
std::cout<<vec.len()<<std::endl;
vec*=2;
std::cout<<vec<<std::endl;
std::cout<<vec.len()<<std::endl;
vec/=2;
std::cout<<vec<<std::endl;
std::cout<<vec.len()<<std::endl;
std::cout<<vec.dot(vec)<<std::endl;
std::cout<<vec.cross(vec2)<<std::endl;
vec.norm();
std::cout<<vec<<std::endl;
std::cout<<vec.len()<<std::endl;
vec-=vec;
std::cout<<vec<<std::endl;
std::cout<<vec.len()<<std::endl;
2024-08-18 21:57:24 +02:00
auto cuboid=Volumes::BlockFactory::createCuboid(vec,1,2,3);
auto cube=Volumes::BlockFactory::createCube(vec,1);
std::cout<<cube<<std::endl;
std::cout<<cube.getVolume()<<std::endl;
std::cout<<cuboid<<std::endl;
std::cout<<cuboid.getVolume()<<std::endl;
auto normals=cuboid.getNormals();
std::cout<<normals.size()<<std::endl;
for (auto normal: normals) {
auto value=normal(0,0,0);
std::cout<<value<<std::endl;
2024-07-21 19:12:47 +02:00
}
2024-07-07 17:32:34 +02:00
return 0;
}