Jump to content

Timing question


VeTaL
 Share

Recommended Posts

void FCamera::CameraUpdate()
{
// rotation	
if (MouseDown(1) && MouseDown(2))
{
	pivotRot.Y -= mouseDX/5;
	RotateEntity(pivot, pivotRot);
}
else
{
	targetRot = EntityRotation(target);
	pivotRot = EntityRotation(pivot);

	dist = targetRot.Y - pivotRot.Y;
	if (dist > 180) { dist -= 360; }
	if (dist < -180) { dist += 360; }

	if (abs(dist) > 0.5) TurnEntity(pivot, Vec3(0, dist/7 , 0));
}
RotateEntity(camera, EntityRotation(pivot));

cameraTilt += mouseDY/5;
cameraTilt = Clamp(cameraTilt,-90,60);
TurnEntity(camera, Vec3(cameraTilt, 0, dist/2));

// position
PositionEntity(pivot, EntityPosition(target));
MoveEntity(pivot, Vec3(0, cameraPivotHeight, 0));
PositionEntity(camera, EntityPosition(pivot));
MoveEntity(camera, Vec3(0, 0, -distToPlayer) );
}

 

I have some camera delay after player's rotation. But when i send demo to another team member, he says that they are too little and asked to change delay in 2 times, so i changed it from

if (abs(dist) > 0.5) TurnEntity(pivot, Vec3(0, dist/7 , 0));

to

if (abs(dist) > 0.5) TurnEntity(pivot, Vec3(0, dist/14 , 0));

 

When i asked about FPS, he says that he got 300 fps, when i have only 140 fps...

 

So, looking like i need some solution, that would make gameplay independent from Fps. Any ideas?

Working on LeaFAQ :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...