VeTaL Posted March 13, 2010 Share Posted March 13, 2010 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? Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
AndyGFX Posted March 13, 2010 Share Posted March 13, 2010 Use AppSpeed() for same speed on different PC. More here: AppSPeed() Quote [HW] C2D Q6600, 4GB RAM, NV8800GTX, Vista Ultimate x64 [sW] Blide Plus, BlitzMax, Delphi, C++, 3DWS 5.53, Leadwerks 2.xx Link to comment Share on other sites More sharing options...
VeTaL Posted March 13, 2010 Author Share Posted March 13, 2010 Thanks. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Recommended Posts
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.