can anyone point me in the direction of the functions and classes i'd want to use if I were trying to create a particle system at the position of a hud model facing the direction the player is facing?
I'll keep trying and poking around but math was never one of my strong points.
ok, I give, i have absolutely no idea what to do.
closest I can get is having the steam shoot off to the right of the hud model but I cant seem to get it rotated to the proper direction.
(05-25-2010, 10:42 AM)nckomodo Wrote: [ -> ]ok, I give, i have absolutely no idea what to do.
closest I can get is having the steam shoot off to the right of the hud model but I cant seem to get it rotated to the proper direction.
Code:
cCamera3D *pCam = mpInit->mpPlayer->GetCamera();
There you have a reference to the camera.
I still can't seem to wrap my head around the matrix math and I'm getting nowhere at an astonishing rate.
Quote:cWorld3D *pWorld = mpInit->mpGame->GetScene()->GetWorld3D();
cParticleSystem3D *pSystem = pWorld->GetParticleSystem("SteamGunEffect");
cCamera3D *pCam = mpInit->mpPlayer->GetCamera();
pSystem->SetMatrix(cMath::MatrixRotate(
cVector3f(pCam->GetPitch(),(pCam->GetYaw()+1.57079633f),pCam->GetRoll()),
eEulerRotationOrder_ZYX));
pSystem->SetPosition(mpEntity->GetWorldPosition());
I've finally got it pointing the right way, almost, if I turn around the pitch seems to invert itself so it points down when I look up.
Any ideas?
I see you.