00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _BASECOLLISIONSHAPE_
00019 #define _BASECOLLISIONSHAPE_
00020
00021 #include "util/Material.h"
00022 #include "util/AbstractStreamedObject.h"
00023
00024 enum COLLISIONSHAPETYPE
00025 {
00026 COLLISIONSHAPETYPE_POLYGON,
00027 COLLISIONSHAPETYPE_CIRCLE
00028 };
00029
00030 class BaseCollisionShape : public AbstractStreamedObject
00031 {
00032 protected:
00033 Material m_material;
00034 public:
00035 BaseCollisionShape() { }
00036 BaseCollisionShape(const Material & material)
00037 :m_material(material)
00038 {
00039 }
00040
00041 const Material & GetMaterial() const { return m_material; }
00042 void SetMaterial(const Material& material) { m_material = material; }
00043
00044 virtual void FromStream(std::istream& is);
00045 virtual void ToStream(std::ostream& os) const;
00046
00047 virtual COLLISIONSHAPETYPE GetType() const = 0;
00048 };
00049
00050 inline void BaseCollisionShape::FromStream(std::istream& is)
00051 {
00052 is >> m_material;
00053 }
00054
00055 inline void BaseCollisionShape::ToStream(std::ostream& os) const
00056 {
00057 os << m_material << " ";
00058 }
00059
00060 #endif