Changeset 12285
- Timestamp:
- Apr 4, 2019, 5:46:25 PM (6 years ago)
- Location:
- code/branches/MouseAPI_FS19
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/MouseAPI_FS19/data/levels/MouseAPIExample.oxw
r12276 r12285 35 35 </collisionShapes> 36 36 </MouseAPIExample> 37 38 <MouseAPIExample position="100,0,100" direction="0,0,0">39 <attached>40 <Model position="0,0,0" mesh="cube.mesh" scale3D="10,10,10" />41 </attached>42 <collisionShapes>43 <BoxCollisionShape position="0,0,0" halfExtents="10,10,10" />44 </collisionShapes>45 </MouseAPIExample>46 47 <MouseAPIExample position="100,0,-100" direction="0,0,0">48 <attached>49 <Model position="0,0,0" mesh="cube.mesh" scale3D="10,10,10" />50 </attached>51 <collisionShapes>52 <BoxCollisionShape position="0,0,0" halfExtents="10,10,10" />53 </collisionShapes>54 </MouseAPIExample>55 37 56 38 </Scene> -
code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapiexample.cc
r12271 r12285 9 9 { 10 10 RegisterObject(MouseAPIExample); 11 //mouseapi = MouseAPI::getInstance();12 11 13 12 } … … 19 18 } 20 19 21 void MouseAPIExample::tick(float dt)22 {23 ControllableEntity::tick(dt);24 25 }26 27 20 void MouseAPIExample::testfunction(MouseButtonCode::ByEnum mouse) 28 21 { 29 orxout() << "MouseAPIExample: Object Clicked\n"; 22 float randomnumber = (rand()%100 + 1)/100.0; 23 this->setScale(randomnumber); 24 orxout() << "Blah\n"; 25 30 26 } 31 27 … … 35 31 MouseAPI::getInstance().activate(); 36 32 MouseAPI::getInstance().addClickableObject(this->getWorldPosition(),10,std::list<MouseButtonCode::ByEnum>{MouseButtonCode::Left},[this](MouseButtonCode::ByEnum mouse){this->testfunction(mouse);}); 37 38 33 } 39 34 } -
code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapiexample.h
r12271 r12285 9 9 #include "worldentities/ControllableEntity.h" 10 10 #include "core/CoreIncludes.h" 11 #include <list> 12 #include <stdlib.h> 11 13 12 14 namespace orxonox … … 19 21 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 20 22 void testfunction(MouseButtonCode::ByEnum mouse); 21 virtual void tick(float dt) override;23 static std::list<MouseAPIExample> blocks; 22 24 }; 23 25 }
Note: See TracChangeset
for help on using the changeset viewer.