Commits

CSBerger committed a1a867f

added trigger file

Comments (0)

Files changed (5)

nightspace.suo

Binary file modified.

nightspace.vcxproj

     <ClCompile Include="SingleLogger.cpp" />
     <ClCompile Include="SpeedBarHUD.cpp" />
     <ClCompile Include="textureLoader.cpp" />
+    <ClCompile Include="trigger.cpp" />
     <ClCompile Include="util.cpp" />
     <ClCompile Include="vec.cpp" />
     <ClCompile Include="dummyController.cpp" />
     <ClInclude Include="simulator.h" />
     <ClInclude Include="SingleLogger.h" />
     <ClInclude Include="SpeedBarHUD.h" />
+    <ClInclude Include="trigger.h" />
     <ClInclude Include="util.h" />
     <ClInclude Include="vec.h" />
     <ClInclude Include="wglew.h" />

nightspace.vcxproj.filters

     <ClCompile Include="Messages\gamestate.pb.cc">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="trigger.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="action.h">
     <ClInclude Include="Messages\gamestate.pb.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="trigger.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="nightspace.rc">
+#include "trigger.h"
+
+bool RoundVolume::isPointInVolume(const CVec3& point) const{
+    return pos.Distance(point) < radius;
+}
+
 class Volume {
 public:
     Volume(CVec3 & position) : pos(position) {};
+protected:
+    CVec3 pos;
 private:
 
-    CVec3 pos;
     virtual bool isPointInVolume(const CVec3&) const = 0;
 };
 
 
 class RoundVolume : Volume {
 public:
-    RoundVolume(CVec3 & position) : Volume(position) {};
+    RoundVolume(CVec3 & position, double r) : Volume(position), radius(r) {};
 private:
-
     virtual bool isPointInVolume(const CVec3&) const;
+    double radius;
 };
 
 class Trigger {
     Volume* trigger_volume;
 public:
     Trigger() {};
+    virtual ~Trigger();
+    virtual void simulate_trigger() = 0;
 };
 #endif