Пример #1
0
/* Stores away old viewangle info and sets up new distance and angles */
void	camAllignWithTarget(BASE_OBJECT *psTarget)
{
	/* Store away the target */
	trackingCamera.target = psTarget;

	/* Save away all the view angles */
	trackingCamera.oldView.r.x = trackingCamera.rotation.x = (float)player.r.x;
	trackingCamera.oldView.r.y = trackingCamera.rotation.y = (float)player.r.y;
	trackingCamera.oldView.r.z = trackingCamera.rotation.z = (float)player.r.z;

	/* Store away the old positions and set the start position too */
	trackingCamera.oldView.p.x = trackingCamera.position.x = (float)player.p.x;
	trackingCamera.oldView.p.y = trackingCamera.position.y = (float)player.p.y;
	trackingCamera.oldView.p.z = trackingCamera.position.z = (float)player.p.z;

   //	trackingCamera.rotation.x = player.r.x = DEG(-90);
	/* No initial velocity for moving */
	trackingCamera.velocity.x = trackingCamera.velocity.y = trackingCamera.velocity.z = 0.f;
	/* Nor for rotation */
	trackingCamera.rotVel.x = trackingCamera.rotVel.y = trackingCamera.rotVel.z = 0.f;
	/* No initial acceleration for moving */
	trackingCamera.acceleration.x = trackingCamera.acceleration.y = trackingCamera.acceleration.z = 0.f;
	/* Nor for rotation */
	trackingCamera.rotAccel.x = trackingCamera.rotAccel.y = trackingCamera.rotAccel.z = 0.f;

	/* Sote the old distance */
	trackingCamera.oldDistance = getViewDistance();	//distance;

	/* Store away when we started */
	trackingCamera.lastUpdate = realTime;
}
Пример #2
0
static SDWORD getDistanceAdjust( void )
{
	UDWORD	origDistance = MAXDISTANCE;
	SDWORD	dif = MAX(origDistance - getViewDistance(), 0);

	return dif / 100;
}
Пример #3
0
static SDWORD getDistanceAdjust(void)
{
	int dif = std::max<int>(MAXDISTANCE - getViewDistance(), 0);

	return dif / 100;
}