domenica 13 settembre 2015

Day 70: Improvements to Shell and Log

Today I finished to fix a few bugs I had in the Log class.
Then I added a lot of commands to the shell, and they also helped me to add a few features to the engine.
For example I decided to make a slow motion command. So I added to the TimeManager a delta_time and a slow_motion_factor.
By tweaking the second value it is possible to make the game slower or faster, and I used the delta time to make movements fps-independent (which I had forgotten till today).
I also added a pause command to freeze everything except the shell, I added commands to handle music and sound effects and a few other stuff.

I also found a bad bug in  light directions:
I was using a lookat view matrix with vec3(0,1,0) as the up vector. For most situation this was fine, but I noticed that when lights were pointing upwards or downwards, the shadows were disappearing.
This is because having a forward and up vector in the same direction was generating some bad math error. So I replaced it with one of the vectors perpendicular to the forward one, and everything was solved.
The shell proved to be extremely useful to debug this problem, I was able to remove other lights, check immediatly if the shadows were properly activated and so on.


Nessun commento:

Posta un commento