mirror of
https://github.com/aap/librw.git
synced 2025-12-18 16:39:51 +00:00
wrote basic skeleton; clumpview
This commit is contained in:
20
src/base.cpp
20
src/base.cpp
@@ -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)
|
||||
{
|
||||
|
||||
@@ -128,6 +128,16 @@ Engine::start(EngineStartParams *p)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
Engine::term(void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Engine::close(void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Engine::stop(void)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user