summaryrefslogtreecommitdiff
path: root/graphics/asymptote/glrender.h
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/asymptote/glrender.h')
-rw-r--r--graphics/asymptote/glrender.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/graphics/asymptote/glrender.h b/graphics/asymptote/glrender.h
index 0fd2e6bdbd..44da4fe612 100644
--- a/graphics/asymptote/glrender.h
+++ b/graphics/asymptote/glrender.h
@@ -119,12 +119,12 @@ extern double Angle;
extern camp::pair Shift;
extern camp::pair Margin;
-extern camp::triple *Lights;
+extern camp::triple *Lights;
extern size_t nlights;
extern double *Diffuse;
extern double *Background;
-struct projection
+struct projection
{
public:
bool orthographic;
@@ -134,11 +134,11 @@ public:
double zoom;
double angle;
camp::pair viewportshift;
-
+
projection(bool orthographic=false, camp::triple camera=0.0,
camp::triple up=0.0, camp::triple target=0.0,
double zoom=0.0, double angle=0.0,
- camp::pair viewportshift=0.0) :
+ camp::pair viewportshift=0.0) :
orthographic(orthographic), camera(camera), up(up), target(target),
zoom(zoom), angle(angle), viewportshift(viewportshift) {}
};
@@ -168,18 +168,18 @@ namespace camp {
struct Billboard {
double cx,cy,cz;
-
+
void init(const triple& center) {
cx=center.getx();
cy=center.gety();
cz=center.getz();
}
-
+
triple transform(const triple& v) const {
double x=v.getx()-cx;
double y=v.gety()-cy;
double z=v.getz()-cz;
-
+
return triple(x*gl::BBT[0]+y*gl::BBT[3]+z*gl::BBT[6]+cx,
x*gl::BBT[1]+y*gl::BBT[4]+z*gl::BBT[7]+cy,
x*gl::BBT[2]+y*gl::BBT[5]+z*gl::BBT[8]+cz);
@@ -202,7 +202,7 @@ extern int MaterialIndex;
extern const size_t Nbuffer; // Initial size of 2D dynamic buffers
extern const size_t nbuffer; // Initial size of 0D & 1D dynamic buffers
-class vertexData
+class vertexData
{
public:
GLfloat position[3];
@@ -267,7 +267,7 @@ public:
};
class vertexBuffer {
-public:
+public:
GLenum type;
GLuint verticesBuffer;
@@ -295,7 +295,7 @@ public:
materialsBuffer(0),
rendered(false),
partial(false)
- {}
+ {}
void clear() {
vertices.clear();
@@ -310,22 +310,22 @@ public:
vertices0.reserve(nbuffer);
}
- void reserve() {
+ void reserve() {
vertices.reserve(Nbuffer);
indices.reserve(Nbuffer);
- }
+ }
- void Reserve() {
+ void Reserve() {
Vertices.reserve(Nbuffer);
indices.reserve(Nbuffer);
- }
-
+ }
+
// Store the vertex v and its normal vector n.
GLuint vertex(const triple &v, const triple& n) {
size_t nvertices=vertices.size();
vertices.push_back(vertexData(v,n));
return nvertices;
- }
+ }
// Store the vertex v and its normal vector n, without an explicit color.
GLuint tvertex(const triple &v, const triple& n) {
@@ -339,14 +339,14 @@ public:
size_t nvertices=Vertices.size();
Vertices.push_back(VertexData(v,n,c));
return nvertices;
- }
+ }
// Store the pixel v and its width.
GLuint vertex0(const triple &v, double width) {
size_t nvertices=vertices0.size();
vertices0.push_back(vertexData0(v,width));
return nvertices;
- }
+ }
// append array b onto array a with offset
void appendOffset(std::vector<GLuint>& a,