Code: Select all
if(TPlayer->bJumping || TPlayer->bRunning)//if we run & jump, show a motion trail
{
for(u16 b = 1; b < 5; b++)//5 is the number of trailers created
{
SceneMgr->getMeshManipulator()->setVertexColorAlpha
(PlayerMesh->getMesh(TPlayer->MeshNode->getFrameNr()),(s32)255/(b*5));
TPlayer->MeshNode->render();
}
}
else //set the Alpha back to full if you're not running or jumping
SceneMgr->getMeshManipulator()->setVertexColorAlpha
(PlayerMesh->getMesh(TPlayer->MeshNode->getFrameNr()),255);
Honestly, I personally have little to no use for it, but I think it is pretty cool. Plus, I figured someone out there might get some use out of it. The code may require some tweaking, but the basics are here for a decent motion trail. However, don't expect anything like Gaussian Blur.
Anyways, have fun with it, y'all, and feel free to ask if you have any questions.