www.pudn.com > ATimeToKill.rar > player.cpp


#include "player.h" 
 
void CPlayer::FireWeapon() 
{ 
	// use camera->lookAt vector and multiply 
	// this lookAt vector by the ammo's speed 
	// to get the ammo velocity vector. 
	// create the new ammo and attach it to 
	// the world. fire the ammo 
 
	CRocket *newRocket = new CRocket; 
 
	newRocket->pitch = camera->pitch; 
	newRocket->direction = direction; 
	newRocket->position = position; 
	newRocket->forward = camera->lookAt.UnitVector(); 
 
	newRocket->SetAudioSystem(audioSys); 
	newRocket->LoadAudio(audioSys, "explode.wav", false); 
	newRocket->AttachTo(terrain); 
}