Skip to main content

History: Talk:OgreOde Walking Character

Source of version: 1 (current)

Copy to clipboard
            ~pp~ torsoGeom->setPosition(Ogre::Vector3(0,size.y-((size.y-4*radius)/2+2*radius),0)); //can't find a good way to explain this~/pp~
If, for conveniance, we write 
~pp~  r = radius
  h = size.y~/pp~
We get :
~pp~ size.y-((size.y-4*radius)/2+2*radius) = h - [ (h-4r)/2 + 2r ] = h - [ (h-4r+4r)/2 ] = h - h/2 = h/2~/pp~
Which is a lot simpler.

And, instead of writing :
~pp~ modelNode->translate(Vector3(0,-radius/ninjaNode->getScale().y,0));~/pp~
Why not put :
~pp~ modelNode->translate( Ogre::Vector3( 0, -min.y / mNode->getScale().y, 0 ) );    // The bounding box must have its bottom at the height 0~/pp~
(i tried, seems to work, and it's much more understandable)