kurisusan
08-06-2010 14:31:11
Hi,
I would like to simulate a force being applied by clicking the mouse, so i can knock something over upon clicking on it (in this case a domino)
are there any threads or tutorials anyone can point me to for this? Or any advice would be much appreciated
Cheers
I would like to simulate a force being applied by clicking the mouse, so i can knock something over upon clicking on it (in this case a domino)
if( ms.buttonDown( OIS::MB_Left ) ){
Ogre::Entity *selEnt= NULL;
Ogre::Vector3 result = Ogre::Vector3::ZERO;
float distToColl;
if (mCollisionTools->raycastFromCamera(mWindow, mCamera, Ogre::Vector2(ms.X.abs, ms.Y.abs), result, selEnt, distToColl, MOVEABLE_MASK))
{
if(firstDomino->GetEntity() == selEnt){
Vector3 unitVector = result;
unitVector.normalise();
firstDomino->addForceAtPos(Vector3(10,10,10) * unitVector, result);
}
}
}
are there any threads or tutorials anyone can point me to for this? Or any advice would be much appreciated
Cheers