예제 #1
0
void PosController::MultiMove(float xPercent, float yPercent, float zPercent)
{
	m_xPercent = xPercent;
	m_yPercent = yPercent;
	m_zPercent = zPercent;
	
	if (!EqualToZero(zPercent))
	{
		ZMove();
		return;
	}

	if (!EqualToZero(xPercent) && !EqualToZero(yPercent))
	{
		XYMove();
		return;
	}
	if(!EqualToZero(xPercent))
	{
		XMove();
		return;
	}
	
	if (!EqualToZero(yPercent))
	{
		YMove();
	}
}
예제 #2
0
void CCamera::Update (float timestep) {
	if (fore)		ZMove (-2 * timestep);
	if (back)		ZMove (2 * timestep);
	if (left)		XMove (-1 * timestep);
	if (right)		XMove (1 * timestep);
	if (up)			YMove (1 * timestep);
	if (down)		YMove (-1 * timestep);
	if (headleft)	RotateHead (5 * timestep);
	if (headright)	RotateHead (-5 * timestep);
	if (pitchup)	RotatePitch (-2 * timestep);
	if (pitchdown)	RotatePitch (2 * timestep);

	glLoadIdentity ();
	glRotatef (-vpitch, 1.0, 0.0 , 0.0);
	glRotatef (-vhead, 0.0, 1.0 , 0.0);
	glTranslatef (-xview, -yview, -zview);
}