June 19, 2025
Did some more work on getting the demo working like clearing and loading presets.
I was working on making a camera controller and UI for a demo release.
Collision response seems to finally be working as I finally found my error which was literally two characters. I need to handle all collision states like polygon and points then test soft and rigid body collisions.
I think collision detection is now at least some what working in a way that also responds angularly as well.
I did some more research and work on collision detection I think I understand how to determine the collision point for polygon collision now.
I did some more work on the collision detection and trying to figure out a good solution to keeping code clean.
I didn't have much time today but I did some more research in angular collision response and need to edit my current impulse calculation as currently it's wrong.
I cleaned up some code and parts to do with collision detection however still have to work on it. I was working on resolving angular properties in collisions.
I added modular integrators so I can add more compilcated ones such as Runge-Kutta 4 and Verlet. I also did research on how to find the collision point and how to use it to also resolve angular properties so collisions will cause rotations too.
I redesigned how the world stores bodies and now have a single unified body struct which makes code much more readable and should be much more efficient than before that had like 6 hash maps.
I was working on optimising some parts of the engine such as moving from component storage with many hash maps to just a vector of bodies, body wont be an enum any more just a single body struct that can be built.
Almost finished SAT collision info generation that is used by the resolver to resolve the collision. At the moment the resolver doesn't use the collision point to affect the angular properties too.
I did some more work on SAT collision I think detection is working and just need to calculate collision info like penetration depth and normal etc.
I've moved back to collision and did some testing with circle-circle detection and response to check its working, I also started working on SAT collision detection.
I just did some soft body testing mostly and a few changes to soft body code. This example has a soft body pentagon and the top point is being accelerated to the left.
I've gotten some sort of basic soft body implementation, I should return to rigid body collision I took a break from.
I've randomly decided to rework soft bodies and make them an abstraction of points and springs instead of an actual body in the engine.
I did some reviews and work on soft bodies and I'm going to add the front-end graphics for soft body springs.
I've been working on soft bodies more and how they fit in with the design, I also did some testing with mass spring systems and implemented a drag effector like air resistance.
I took a break from SAT collision and started working on soft bodies which requires me to change a decent amount in both the engine and graphical side.
I started learning about SAT collision detection and begun an implementation for rectangles.
I setup the first collision response algorithm for circles, it uses impulse and projection response methods. I tested it out with a demo that approximates pi. Next I need to add detection and response for rectangles and polygons.
I setup the collision system and used traits so custom collision pipelines can be implemented, I started on the actual collision detection and response.
I have been working on implementing collision detection and in a way so that new collision algorithms can be easily added and used in the engine.
More engine design and supporting rotations and changed force generators to effectors that can also change angular properties and could potentially be used for constraints in the future. It's not very optimised at the moment.
I've been working on a ECS style system which I think makes sense for the project and to ensure it's modular and extensible.
I started on rigid body support and how they will fit into the design as well as future extensibility such as soft bodies. I also researched more into collision detection and resolution.
I implemented an id pool for objects and force generators to support adding and removing better, next I will try to expand my current objects into rigid bodies that have shape, rotation etc.
I have redesigned the engine again which should be the last time, it is now more modular which should make it easier to extend its functionality in the future. There are now force generators which produce a force on objects and can be customised and added in the future.
I updated the server to handle the Connection header, I also added a response body to 404 so that the browser will display a 404 message.
I updated the server so that when the root target (/) is requested it can host another file such as /index.html so you can go to just 0.0.0.0:8000 without having to add the /index.html.
I have updated the server so that you can change the directory to host the server from. I added a Dockerfile to allow cross-platform support.
I've been thinking on the implementation and design of the engine its self such as which integration method to use as I was using semi-explicit Euler but Runge-Kutte 4th might be better, I was also thinking about how to implement units so you could use anything from meters to light years if you want.
I've been working on some of the front-end graphical side adding support for polygon shapes using a triangulator library to convert the points into triangles that can generate a mesh. I'm also trying to add support for different units for like length and mass etc.
I have been working on the front-end bevy side by improving physics object spawning and started on polygon graphics.
I've started the project and decided on splitting it up into two separate crates one for the back-end physics engine and another for displaying the simulation using bevy. I setup a basic physics starting point and I'm now integrating it into bevy.
A 2D physics simulator made in Rust.
I again commented and cleaned up more code and implemented some more status codes. I think this might be the last update before I initially ship the project as core features have been implemented and the server can host a static website without back-end support currently. I have created a todo list in the project files for some more features that could be added, such as backend support potentially with lua implementation to allow backend configuration that the C code could interface with, this would also require me to implement more HTTP methods such as POST.
I did more refactoring and cleaning up of code, I also implemented the HEAD method. I need to still look into returning the correct status codes.
I reviewed and improved some more code such as making printing information better. The receiving code is now more robust for two requests received into the same buffer.
I just made some small edits and have been thinking on how I will fix the current client handling as it currently closes the connection after one request and response, also if one request and a second partial were received this isn't handled in the current code which could result in errors.
I've fixed glitches and errors in the response code and also fixed many memory leaks that were throughout the code. I've tested the server with my personal website which seems to be fully working. I need to also implement the status codes, error checking.
Got basic response generation and sending working which can serve a basic website with some glitches and errors, I tested with an old calculator website I made. I need to implement the correct status codes and fix some glitches.
Reworked response generation code to instead go from request string to request struct to response struct then finally the response string that can be sent back to the client. Whereas before I was going straight from request struct to the response string which makes the code more confusing and complicated.
I've done some more work on forming the HTTP response by figuring out the content type of the requested target using the file extension, this will be needed as a response field.
I split up my server file into multiple files as it was getting quite large. I worked on getting the value of the requested target that will be sent back to the client.
I started the response generation and resolving the requested target into a string value that will be returned in the response body back to the client.
I've finished reviewing the code and cleaning and improving it by adding comments and more error checks. Next I can form the servers response to the request and send it back to the client.
I've been improving the code making it cleaner and overall better, I've still got the server and main files to look at too. After that I will continue the server implementation as it currently receives and parses the request into a request data structure.
The HTTP request is now parsed into a struct that stores the HTTP method, the target resource, HTTP version and also all the fields as a name and value pair.
I've started to parse the HTTP request from the client that the server will use to send back a response. I had to do more research on some C string manipulation to convert the request string into a request struct that I will be able to use to then form a response later in development.
Restructured the project and split up large files into multiple. Fixed an issue where the server was binding to the loopback IP meaning other devices on my local network couldn't connect to the server. Learnt about event-driven socket programming that I may use later in development.
The server now properly closes sockets when they're not needed again. The server sends a test message to the client which the client receives and outputs.
The server now allows connecting to clients and supports multiple connections by creating child processes for each one. I've also created a simple client to test with that just connects to the server.
I've now started to create a server instead of a client so I need to use different socket functions to bind to a local address and then listen and accept for clients connecting. I'm also thinking about trying to run the code within a docker container too.
So far I have just been learning about how Linux uses sockets for networking and have been setting up a client to request data from websites before I actually create the server as that will be more complex. Currently receiving the response from the server isn't perfect so needs to be updated.
An HTTP server programmed from scratch in C with no external libraries. Native for Linux and cross-platform with Docker.
This was widely regarded as a great move by everyone.