summaryrefslogtreecommitdiff
path: root/cWiremesh.h
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-02-10 00:53:58 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-02-10 00:53:58 +0100
commit5bfaf048e81900ffdc0bb2815f8465235c4462d5 (patch)
tree5264bf22976d9dd666fceb8dc7d337e9b71fa787 /cWiremesh.h
parent4e59b62be595d9c0e1e95f51c6c4c25f37bdb783 (diff)
parentc459b4901f3f453f83a93a38228e3241dd8190c2 (diff)
downloadtermgl-5bfaf048e81900ffdc0bb2815f8465235c4462d5.tar.gz
Merge branch 'master' of https://gitlab.lrz.de/ge49jic/engine
Diffstat (limited to 'cWiremesh.h')
-rw-r--r--cWiremesh.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/cWiremesh.h b/cWiremesh.h
index 320a141..82d3bd6 100644
--- a/cWiremesh.h
+++ b/cWiremesh.h
@@ -42,6 +42,9 @@ struct sVector
WORD color;
};
+/**
+* cWiremesh stores 3D objects as multiple vectors. it can write itself on a cRender framebuffer.
+*/
class cWiremesh
{
public:
@@ -50,10 +53,22 @@ public:
virtual ~cWiremesh();
+ /**
+ * Add a line from _origin to (_origin + _vector) in 3D space.
+ */
void addVector(sCoord3d _origin, sCoord3d _vector, char _char, WORD _color);
+ /**
+ * Rotates by (x,y,z) degrees around the corresponding axis.
+ * Rotation is stored seperatately from original vectors while they stay untouched to prevent growing rounding errors by repeated rotation.
+ *
+ * Rotation is applied relative to the origin of this wiremsh.
+ */
void rotate(sCoord3d _val);
+ /**
+ * Scales by _scalar. The scalar is directly applied to all vectors. Be wary of growing rounding errors!
+ */
void scale(float _scalar);
sCoord3d getPosition();
@@ -62,8 +77,15 @@ public:
void setPosition(sCoord3d _pos);
+ /**
+ * clear this wiremesh
+ */
void reset();
+ /**
+ * Translates wiremesh into 2D space after applying rotation to each vector.
+ * The vanishing point is set to the center of _render with depth _DEPTH. Alter _DEPTH to achieve optimal resultst.
+ */
void write(cRender *_render);
protected: