addCameraSceneNodeMaya

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.

addCameraSceneNodeMaya

Postby mikGuru » Fri Nov 12, 2010 1:53 pm

Hi,

Got Irrlicht integrated into my project in 2 days - its really good.

But the Maya camera node has a problem. When you try to zoom in, it stops zooming at a certain point, and flips back when you release the middle mouse.

Also the setPosition() doesnt work on the Maya camera - I looked inside and thats because the Maya keeps its own position value seperated from the scene node position, and there doesnt seem to be any interface to the Maya node position.
mikGuru
 
Posts: 2
Joined: Fri Nov 12, 2010 1:40 pm

Postby mikGuru » Fri Nov 12, 2010 2:59 pm

Ok I understand that the zooming is meant to stop - I get it.

I made a fix in CSceneNodeAnimatorCameraMaya::animateNode, to stop the zooming snapping back:

Code: Select all
   const f32 targetMinDistance = 0.1f;   //Moved this here
   if ( (isMouseKeyDown(0) && isMouseKeyDown(2)) || isMouseKeyDown(1) )
   {
      if (!Zooming)
      {
         ZoomStart = MousePos;
         Zooming = true;
         nZoom = CurrentZoom;
      }
      else
      {
         //const f32 targetMinDistance = 0.1f;
         nZoom += (ZoomStart.X - MousePos.X) * ZoomSpeed;

         if (nZoom < targetMinDistance) // jox: fixed bug: bounce back when zooming to close
            nZoom = targetMinDistance;
      }
   }
   else if (Zooming)
   {
      const f32 old = CurrentZoom;
      CurrentZoom = CurrentZoom + (ZoomStart.X - MousePos.X ) * ZoomSpeed;
      nZoom = CurrentZoom;

      //if (nZoom < 0)
      //   nZoom = CurrentZoom = old;
      if (nZoom < targetMinDistance)                  //Fix to stop zoom snapping back
         nZoom = CurrentZoom = targetMinDistance;
      Zooming = false;
   }
mikGuru
 
Posts: 2
Joined: Fri Nov 12, 2010 1:40 pm


Return to Bug reports

Who is online

Users browsing this forum: No registered users and 1 guest