46
Graphics / Re: Shaking the Camera
« on: January 31, 2020, 07:34:17 pm »
GDC is really good source:
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
OpenDoor Renders really dark and unseeable almost just faintly but OpenDoorRotated renders as would be expected
applyLogicAndPhysics(deltaTime * 0.5);
Another way is to use a clock in which the speed of time can be changed. I'll mention Kairos' Timestep
..
You could change only the speed of the clock, which means that the same delta time takes longer so might update more jerkily at slower speeds but updates logically identically, or change the speed of the clock and scale the delta time used to match, which means that the updates takes the same amount of actual time and can be more smooth at slower speeds but updates are logically different since the timestep has now changed.
Some pseudo code for an implementation of fixed timestep:deltaTime = 0.1 seconds
while (windowIsOpen)
{
currentTime = clock.currentTime
timeToProcess = timeToProcess + currentTime - previousTime
previousTime = currentTime
while (timeToProcess >= deltaTime)
{
applyLogicAndPhysics()
timeToProcess = timeToProcess - deltaTime
}
prepareDisplay()
drawDisplay()
}