[Sigma Tau] Dev Log 03 - Movement
I got some video this time… see the bottom.
I have been working on physics. As I stated in a separate post I am developing custom physics with Sigma Tau. The logic and reasoning for why, is in that other post.
(Skip this paragraph if you do not care about the physics implementation.) I have been developing the broadphase. The broadphase has some distinct differences to the common patterns of other physics engines. The algorithm I have developed uses a sort of souped up sweep & prune. The broadphase is actually continuous (in the future, if it is faster, I might add a more coarse step first before the continuous test). Before you freak out about it being continuous, it does not check intervals like standard continuous implementations, it uses circles and calculates the time of impact, with an equation. It uses a brilliant little equation that calculates based on the movement vector, it is not a basic line overlap, it takes into account the movement. I have yet to optimize the implementation or do actual speed tests on it, but it is actually a quite short function. (It is called `collisionTime` here, if you are curious.) There are a number of implications of this test, which effect other parts of the engine.
I currently do not have a finephase collisions test, and the collision response is to just 0 the velocities.
Alright enough about physics...
After I got movement working, I got flying your own ship to work. I updated the development rendering to show the collision circle around the ships, and another collision circle for what the ships position will be at the end of the next tick.
I gave the ship 3 thruster inputs, forward/back, rotate, and strafe. I made graphical sliders that can be dragged, and also keyboard input. The user interface is coded in a highly configurable way. There are classes to create elements, which can be added to the HTML DOM and positioned like any other HTML page.
In the video I also spawn some other ships with debug controls. I mostly use keyboard input, but you can see the sliders reacting to my press. (note. I am failing at flying, I seem to be better at 3D Newtonian physics... Simpler input methods will come later...)