-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProjector4.cpp
More file actions
30 lines (25 loc) · 847 Bytes
/
Projector4.cpp
File metadata and controls
30 lines (25 loc) · 847 Bytes
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
#include "Projector4.h"
namespace Forth
{
void Projector4::Project(const Buffer4 &from, const Transform4 &transform, Buffer3 &to)
{
SimplexMode mode = this->SimplexModeForVisualizing(from.simplex);
Visualizer4 *viz = ((Visualizer4 *)defaultVisualizers[mode]);
viz->Initialize(to);
this->Project(from, transform, viz);
viz->End();
}
Projector4::Projector4()
{
defaultVisualizers[SM_Point] = new ParticleVisualizer();
defaultVisualizers[SM_Line] = new WireVisualizer();
defaultVisualizers[SM_Triangle] = new SolidVisualizer();
view = viewmodel = Transform4(Vector4(), Matrix4(1));
}
Projector4::~Projector4()
{
delete (ParticleVisualizer *)(defaultVisualizers[SM_Point]);
delete (WireVisualizer *)(defaultVisualizers[SM_Line]);
delete (SolidVisualizer *)(defaultVisualizers[SM_Triangle]);
}
} // namespace Forth