Changeset 12263
- Timestamp:
- Mar 28, 2019, 5:00:24 PM (6 years ago)
- Location:
- code/branches/MouseAPI_FS19
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/MouseAPI_FS19/data/levels/MouseAPIExample.oxw
r12258 r12263 16 16 ?> 17 17 18 <Level >18 <Level > 19 19 <templates> 20 20 <Template link=lodtemplate_default /> … … 25 25 skybox = "Orxonox/Starbox" 26 26 > 27 <camerapositions> 28 <CameraPosition position="0,0,0" lookat="100,0,0" absolute=true drag=true mouselook=true/> 29 </camerapositions> 27 30 28 31 <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> … … 31 34 <MouseAPIExample position="100,0,0" direction="0,-1,0" collisionType=static mass=100000 friction=0.01 > 32 35 <attached> 33 <Model position="0,0,0" mesh="cube.mesh" scale3D="10 000,10000,1000" />36 <Model position="0,0,0" mesh="cube.mesh" scale3D="10,10,10" /> 34 37 </attached> 35 38 <collisionShapes> 36 <BoxCollisionShape position="0,0,0" halfExtents="10000,10000,1000" /> 37 </collisionShapes> 39 <BoxCollisionShape position="0,0,0" halfExtents="10,10,10" /> 40 </collisionShapes> 41 38 42 </MouseAPIExample> 39 43 -
code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapi.cc
r12253 r12263 12 12 if(InputManager::exists()) 13 13 { 14 cam = CameraManager::getInstance().getActiveCamera()->getOgreCamera();15 state = InputManager::getInstance().createInputState("MouseAPI" );14 //cam = CameraManager::getInstance().getActiveCamera()->getOgreCamera(); 15 state = InputManager::getInstance().createInputState("MouseAPI",true,true,99); 16 16 state->setMouseExclusive(false);//does this work 17 17 state->setMouseHandler(this); … … 38 38 void MouseAPI::buttonPressed(MouseButtonCode::ByEnum button) 39 39 { 40 cam = CameraManager::getInstance().getActiveCamera()->getOgreCamera(); 40 41 Ogre::Viewport *vp = GraphicsManager::getInstance().getViewport(); 41 42 Ogre::Ray ray = cam->getCameraToViewportRay(mousePos.x/((float)vp->getActualWidth()),mousePos.y/((float)vp->getActualHeight()));
Note: See TracChangeset
for help on using the changeset viewer.