wrote basic skeleton; clumpview

This commit is contained in:
aap
2017-08-10 00:42:33 +02:00
parent 70739e354e
commit 497796e550
16 changed files with 977 additions and 4 deletions

View File

@@ -301,6 +301,26 @@ Matrix::scale(V3d *scale, CombineOp op)
return this;
}
Matrix*
Matrix::transform(Matrix *mat, CombineOp op)
{
Matrix tmp;
switch(op){
case COMBINEREPLACE:
*this = *mat;
break;
case COMBINEPRECONCAT:
mult(&tmp, mat, this);
*this = tmp;
break;
case COMBINEPOSTCONCAT:
mult(&tmp, this, mat);
*this = tmp;
break;
}
return this;
}
void
Matrix::lookAt(const V3d &dir, const V3d &up)
{

View File

@@ -128,6 +128,16 @@ Engine::start(EngineStartParams *p)
return 1;
}
void
Engine::term(void)
{
}
void
Engine::close(void)
{
}
void
Engine::stop(void)
{

View File

@@ -269,6 +269,13 @@ Frame::scale(V3d *scl, CombineOp op)
updateObjects();
}
void
Frame::transform(Matrix *mat, CombineOp op)
{
this->matrix.transform(mat, op);
updateObjects();
}
void
Frame::updateObjects(void)
{

View File

@@ -231,6 +231,7 @@ struct Matrix
Matrix *rotate(const Quat &q, CombineOp op);
Matrix *translate(V3d *translation, CombineOp op);
Matrix *scale(V3d *scl, CombineOp op);
Matrix *transform(Matrix *mat, CombineOp op);
void lookAt(const V3d &dir, const V3d &up);
// helper functions. consider private

View File

@@ -123,6 +123,8 @@ struct Engine
static bool32 init(void);
static bool32 open(void);
static bool32 start(EngineStartParams*);
static void term(void);
static void close(void);
static void stop(void);
};

View File

@@ -125,7 +125,8 @@ struct Frame : PluginBase<Frame>
Matrix *getLTM(void);
void rotate(V3d *axis, float32 angle, CombineOp op);
void translate(V3d *trans, CombineOp op);
void scale(V3d *trans, CombineOp op);
void scale(V3d *scale, CombineOp op);
void transform(Matrix *mat, CombineOp op);
void updateObjects(void);