Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12263


Ignore:
Timestamp:
Mar 28, 2019, 5:00:24 PM (6 years ago)
Author:
tkuonen
Message:

Repair MouseAPI

Location:
code/branches/MouseAPI_FS19
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/MouseAPI_FS19/data/levels/MouseAPIExample.oxw

    r12258 r12263  
    1616?>
    1717
    18 <Level>
     18<Level >
    1919  <templates>
    2020    <Template link=lodtemplate_default />
     
    2525    skybox       = "Orxonox/Starbox"
    2626  >
     27  <camerapositions>
     28        <CameraPosition position="0,0,0" lookat="100,0,0" absolute=true drag=true mouselook=true/>
     29  </camerapositions>
    2730
    2831    <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"/>
     
    3134        <MouseAPIExample position="100,0,0" direction="0,-1,0" collisionType=static mass=100000 friction=0.01 >
    3235            <attached>
    33                 <Model position="0,0,0" mesh="cube.mesh" scale3D="10000,10000,1000" />
     36                <Model position="0,0,0" mesh="cube.mesh" scale3D="10,10,10" />
    3437            </attached>
    3538            <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       
    3842        </MouseAPIExample>
    3943   
  • code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapi.cc

    r12253 r12263  
    1212     if(InputManager::exists())
    1313     {
    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);
    1616        state->setMouseExclusive(false);//does this work
    1717        state->setMouseHandler(this);
     
    3838void MouseAPI::buttonPressed(MouseButtonCode::ByEnum button)
    3939{
     40    cam = CameraManager::getInstance().getActiveCamera()->getOgreCamera();
    4041    Ogre::Viewport *vp = GraphicsManager::getInstance().getViewport();
    4142    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.