diff --git a/src/base.cpp b/src/base.cpp index fbc4821..d92676a 100644 --- a/src/base.cpp +++ b/src/base.cpp @@ -117,6 +117,20 @@ cross(const V3d &a, const V3d &b) 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 */ Matrix Matrix::makeRotation(const Quat &q) diff --git a/src/rwbase.h b/src/rwbase.h index 555d775..42daa95 100644 --- a/src/rwbase.h +++ b/src/rwbase.h @@ -158,6 +158,8 @@ struct Matrix V3d pos; float32 posw; + static Matrix *create(void); + void destroy(void); static Matrix makeRotation(const Quat &q); void setIdentity(void); void pointInDirection(const V3d &d, const V3d &up);