39 lines
1.2 KiB
C++
39 lines
1.2 KiB
C++
#include <iostream>
|
|
#include "LinAlg/vector3.h"
|
|
#include "Volumes/BlockFactory.h"
|
|
|
|
int main(int argc, char **argv) {
|
|
//std::cout << "Hello, world!" << std::endl;
|
|
LinAlg::Vector3 vec(1, 2, 3);
|
|
LinAlg::Vector3 vec2(2, 1, 3);
|
|
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;
|
|
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;
|
|
}
|
|
return 0;
|
|
}
|