-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
36 lines (31 loc) · 1.43 KB
/
test.cpp
File metadata and controls
36 lines (31 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "PhysicsConfig.hpp"
#include "vector3.hpp"
#include "cuboidcollider.hpp"
#include "spherecollider.hpp"
#include <vector>
#include <iostream>
int main() {
CuboidCollider cuboid;
SphereCollider sphere;
std::cout << "Cuboid: " << &cuboid << std::endl;
std::cout << "Sphere: " << &sphere << std::endl;
std::cout << "Cuboid: " << cuboid << std::endl;
std::cout << "Sphere: " << sphere << std::endl;
std::cout << "Intersects: " << cuboid.intersects(sphere) << std::endl;
std::cout << "Sphere contains Cuboid: " << sphere.contains(cuboid) << std::endl;
std::cout << "Cuboid contains Sphere: " << cuboid.contains(sphere) << std::endl;
std::cout << "Sphere contains Sphere: " << sphere.contains(sphere) << std::endl;
std::cout << "Cuboid contains Cuboid: " << cuboid.contains(cuboid) << std::endl;
// std::vector<Vector3> cuboidpoints = cuboid.points(5);
std::vector<Vector3> spherepoints = sphere.points(5);
// std::cout << "Cuboid Points: " << cuboidpoints.size() << std::endl;
// for (std::vector<Vector3>::iterator iter = cuboidpoints.begin();
// iter != cuboidpoints.end(); iter++) {
// std::cout << *iter << std::endl;
// }
std::cout << "Sphere Points: " << spherepoints.size() << std::endl;
for (std::vector<Vector3>::iterator iter = spherepoints.begin();
iter != spherepoints.end(); iter++) {
std::cout << *iter << std::endl;
}
}