mirror of https://github.com/aap/librw.git
added Matrix create and destroy
This commit is contained in:
parent
5c3240cce3
commit
a391f263cb
14
src/base.cpp
14
src/base.cpp
|
@ -117,6 +117,20 @@ cross(const V3d &a, const V3d &b)
|
||||||
a.x*b.y - a.y*b.x);
|
a.x*b.y - a.y*b.x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Matrix*
|
||||||
|
Matrix::create(void)
|
||||||
|
{
|
||||||
|
Matrix *m = (Matrix*)malloc(sizeof(Matrix));
|
||||||
|
m->setIdentity();
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Matrix::destroy(void)
|
||||||
|
{
|
||||||
|
free(this);
|
||||||
|
}
|
||||||
|
|
||||||
/* q must be normalized */
|
/* q must be normalized */
|
||||||
Matrix
|
Matrix
|
||||||
Matrix::makeRotation(const Quat &q)
|
Matrix::makeRotation(const Quat &q)
|
||||||
|
|
|
@ -158,6 +158,8 @@ struct Matrix
|
||||||
V3d pos;
|
V3d pos;
|
||||||
float32 posw;
|
float32 posw;
|
||||||
|
|
||||||
|
static Matrix *create(void);
|
||||||
|
void destroy(void);
|
||||||
static Matrix makeRotation(const Quat &q);
|
static Matrix makeRotation(const Quat &q);
|
||||||
void setIdentity(void);
|
void setIdentity(void);
|
||||||
void pointInDirection(const V3d &d, const V3d &up);
|
void pointInDirection(const V3d &d, const V3d &up);
|
||||||
|
|
Loading…
Reference in New Issue