-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathfunctions.cpp
More file actions
53 lines (45 loc) · 1.38 KB
/
functions.cpp
File metadata and controls
53 lines (45 loc) · 1.38 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <memory>
#include "functions.h"
std::shared_ptr<Box> createBox(BoxDimensions const &dimensions)
{
auto mesh = std::make_shared<Box>(dimensions);
return mesh;
}
std::shared_ptr<Sphere> createSphere(SphereDimensions const &dimensions, SphereParameters const ¶meters)
{
auto mesh = std::make_shared<Sphere>(dimensions, parameters);
return mesh;
}
std::shared_ptr<Pyramid> createPyramid(PyramidDimensions const &dimensions)
{
auto mesh = std::make_shared<Pyramid>(dimensions);
return mesh;
}
std::shared_ptr<Cylinder> createCylinder(CylinderDimensions const &dimensions, CylinderParameters const ¶meters)
{
auto mesh = std::make_shared<Cylinder>(dimensions, parameters);
return mesh;
}
std::shared_ptr<Torus> createTorus(TorusDimensions const &dimensions, TorusParameters const ¶meters)
{
auto mesh = std::make_shared<Torus>(dimensions, parameters);
return mesh;
}
std::shared_ptr<Mesh> rotate(std::shared_ptr<Mesh> const &mesh, glm::vec3 const &rotation)
{
mesh->rotate(rotation);
mesh->threeBSPDone = false;
return mesh;
}
std::shared_ptr<Mesh> translate(std::shared_ptr<Mesh> const &mesh, glm::vec3 const &translation)
{
mesh->translate(translation);
mesh->threeBSPDone = false;
return mesh;
}
std::shared_ptr<Mesh> scale(std::shared_ptr<Mesh> const &mesh, glm::vec3 const &scaleVec)
{
mesh->scale(scaleVec);
mesh->threeBSPDone = false;
return mesh;
}