00001 #ifndef _COLLECTABLECOIN_H_ 00002 #define _COLLECTABLECOIN_H_ 00003 00004 #include <vrs/rotation.h> 00005 #include <vrs/sharedobj.h> 00006 #include <vrs/translation.h> 00007 #include <vrs/vector.h> 00008 00009 #include "vrsode/CollisionBody.h" 00010 00011 #include <random_utils/ThreadSafeObject.h> 00012 00013 00014 namespace random_racer 00015 { 00016 00017 class ItemDistributor; 00018 00023 class CollectableCoin : public vrsode::CollisionBody, 00024 private random_utils::ThreadSafeObject 00025 { 00026 VRS::SO<VRS::Rotation> m_rotation; 00027 unsigned int m_points; 00028 00029 VRS::SO<VRS::SceneThing> m_thing; 00030 00031 VRS::SO<ItemDistributor> m_itemDistributor; 00032 00033 bool m_collisionCookie, m_gotTheCookie; 00034 00035 public: 00042 CollectableCoin(VRS::SO<VRS::SceneThing> thing, 00043 VRS::Vector position, unsigned int points, 00044 VRS::SO<ItemDistributor> itemDistributor); 00045 00049 virtual ~CollectableCoin(); 00050 00054 unsigned int points(); 00055 00059 void rotateOn(double); 00060 00064 VRS::SO<VRS::SceneThing> sceneThing(); 00065 00069 virtual void handleCollision(VRS::SO<CollisionBody>); 00070 00075 bool didRecentlyCollide(); 00076 }; 00077 00078 } 00079 00080 #endif /* _COLLECTABLECOIN_H_ */
1.5.1