Code: Select all
if (mouseDownL == true)
{
cursor.X = (f32)event.MouseInput.X;
cursor.Y = (f32)event.MouseInput.Y;
cursorDelta.X = (f32)((cursor.X - cursorOld.X) * 1.0);
cursorDelta.Y = (f32)((cursor.Y - cursorOld.Y) * 1.0);
selectedNode = smgr->getSceneCollisionManager()->getSceneNodeFromScreenCoordinatesBB(core::position2d<s32>(cursor.X ,cursor.Y ));
pos = selectedNode->getPosition();
selectedNode->setPosition(core::vector3df(pos.X + cursorDelta.X ,0,pos.Z - cursorDelta.Y ));
}