-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathplane.h
54 lines (45 loc) · 1.27 KB
/
plane.h
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
54
#pragma once
#include "shape.h"
class Plane : public Shape
{
public:
Plane(int divisionsX = 2, int divisionsY = 2);
glm::ivec2 Dimensions() { return glm::ivec2(this->divisionsX , this->divisionsY); }
protected:
bool PreGLInitialize();
void NonGLTakeDown();
void RecomputeNormals();
int divisionsX;
int divisionsY;
void SE(glm::vec3 * v, int row , int col , glm::vec3 & sum , float & divisor);
void SSW(glm::vec3 * v, int row , int col , glm::vec3 & sum , float & divisor);
void WSW(glm::vec3 * v, int row , int col , glm::vec3 & sum , float & divisor);
void NW(glm::vec3 * v, int row , int col , glm::vec3 & sum , float & divisor);
void NNE(glm::vec3 * v, int row , int col , glm::vec3 & sum , float & divisor);
void ENE(glm::vec3 * v, int row , int col , glm::vec3 & sum , float & divisor);
};
class Cylinder : public Plane
{
public:
Cylinder(int slices , int stacks , float span , float back_radius , float front_radius);
protected:
bool PreGLInitialize();
void NonGLTakeDown();
void RecomputeNormals();
int slices;
int stacks;
float span;
float fr;
float br;
bool is_partial_span;
};
class Cube : public Shape
{
public:
Cube() {}
virtual void Draw(bool draw_normals = false);
protected:
bool PreGLInitialize();
void NonGLTakeDown();
void RecomputeNormals();
};