From: sapier Date: Tue, 7 Feb 2012 15:52:32 +0000 (+0100) Subject: move getCollisionBox from ActiveObject to interface class Collidableobject X-Git-Tag: sapier-20120207~2^2~2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=435ea846db833d4197b0f0c91856482bd6536b96;p=oweals%2Fminetest.git move getCollisionBox from ActiveObject to interface class Collidableobject --- diff --git a/src/collidableobject.h b/src/collidableobject.h new file mode 100644 index 000000000..d2d148118 --- /dev/null +++ b/src/collidableobject.h @@ -0,0 +1,36 @@ +/* +Minetest-c55 +Copyright (C) 2012 sapier + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +#ifndef __COLLIDABLEOBJECT_H__ +#define __COLLIDABLEOBJECT_H__ + +#include + +class CollidableObject { +public: + virtual aabb3f* getCollisionBox() = 0; + + inline float getFlexibility() { return m_Flexibility; } + inline int getWeight() { return m_Weight; } +protected: + int m_Weight; + float m_Flexibility; + aabb3f m_collisionbox; +}; + +#endif //__COLLIDABLEOBJECT_H__