add camera example

This commit is contained in:
aap
2021-03-03 21:53:06 +01:00
parent 47487afc04
commit 70d222deeb
18 changed files with 1108 additions and 476 deletions

View File

@@ -278,7 +278,7 @@ struct Quat
this->w = w; this->x = x; this->y = y; this->z = z; }
V3d vec(void){ return makeV3d(x, y, z); }
Quat *rotate(const V3d *axis, float32 angle, CombineOp op);
Quat *rotate(const V3d *axis, float32 angle, CombineOp op = rw::COMBINEPOSTCONCAT);
};
inline Quat makeQuat(float32 w, float32 x, float32 y, float32 z) { Quat q = { x, y, z, w }; return q; }
@@ -347,11 +347,11 @@ struct Matrix
static Matrix *mult(Matrix *dst, const Matrix *src1, const Matrix *src2);
static Matrix *invert(Matrix *dst, const Matrix *src);
static Matrix *transpose(Matrix *dst, const Matrix *src);
Matrix *rotate(const V3d *axis, float32 angle, CombineOp op);
Matrix *rotate(const Quat &q, CombineOp op);
Matrix *translate(const V3d *translation, CombineOp op);
Matrix *scale(const V3d *scl, CombineOp op);
Matrix *transform(const Matrix *mat, CombineOp op);
Matrix *rotate(const V3d *axis, float32 angle, CombineOp op = rw::COMBINEPOSTCONCAT);
Matrix *rotate(const Quat &q, CombineOp op = rw::COMBINEPOSTCONCAT);
Matrix *translate(const V3d *translation, CombineOp op = rw::COMBINEPOSTCONCAT);
Matrix *scale(const V3d *scl, CombineOp op = rw::COMBINEPOSTCONCAT);
Matrix *transform(const Matrix *mat, CombineOp op = rw::COMBINEPOSTCONCAT);
Quat getRotation(void);
void lookAt(const V3d &dir, const V3d &up);

View File

@@ -70,10 +70,10 @@ struct Frame
bool32 dirty(void) const {
return !!(this->root->object.privateFlags & HIERARCHYSYNC); }
Matrix *getLTM(void);
void rotate(const V3d *axis, float32 angle, CombineOp op);
void translate(const V3d *trans, CombineOp op);
void scale(const V3d *scale, CombineOp op);
void transform(const Matrix *mat, CombineOp op);
void rotate(const V3d *axis, float32 angle, CombineOp op = rw::COMBINEPOSTCONCAT);
void translate(const V3d *trans, CombineOp op = rw::COMBINEPOSTCONCAT);
void scale(const V3d *scale, CombineOp op = rw::COMBINEPOSTCONCAT);
void transform(const Matrix *mat, CombineOp op = rw::COMBINEPOSTCONCAT);
void updateObjects(void);