X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fvertexbuilder.h;h=49f0dcf5e38c89d69496bd6473b0027dee63ce8f;hp=7a1c943c9ed18b7f6f2330cdc67b0ebb76bc4197;hb=c895aa82dd405146f648e5ca3fcfaa326eab9b87;hpb=8e9d872c2ba8dc633d29a673ba93adf38d262a5c diff --git a/source/vertexbuilder.h b/source/vertexbuilder.h index 7a1c943c..49f0dcf5 100644 --- a/source/vertexbuilder.h +++ b/source/vertexbuilder.h @@ -33,6 +33,16 @@ public: virtual ~VertexBuilder() { } + void set_matrix(const Matrix &m) + { mtx = m; } + + void transform(const Matrix &m) + { mtx *= m; } + + const Matrix &get_matrix() const + { return mtx.top(); } + + // Deprecated MatrixStack &matrix() { return mtx; } @@ -45,6 +55,9 @@ public: void vertex(float x, float y, float z, float w) { vertex(Vector4(x, y, z, w)); } + void vertex(const Vector3 &v) + { vertex(Vector4(v.x, v.y, v.z, 1)); } + void vertex(const Vector4 &v) { vertex_(mtx.top()*v); }