Activity

Luka Trojan

I created a new struct Arrow which holds a reference to a Mesh and a Vec3. It then rotates the mesh to point in the direction of the vector. In this video I made two Arrows with references to the mesh of an arrow and the velocity of the mesh of the arrow in turn making it point in the direction its mesh is moving. This took quite a bit of work since I had to fight with some linear algebra and also with the Rust lifetimes which after some research I decided would be best to ignore and use Unsafe since doing anything which made the compiler happy would either have been very ugly or very annoying to use. This does mean I have to be more careful with these arrows since they do contain raw pointers and will have to work around them in the future. I also did some refactoring to make things more organized and easier to navigate in the code base. I updated the physics update code to be compatible with the arrows and also likely quite a bit faster. I also updated my integrator for angular velocity to Rk4 which was introducing big errors due to using Euler’s method for integrating ω. I then also learned my energy calculation was wrong due to frame mismatch where my inertia tensor was in body space but ω was in world space as well as a slightly wrong interpretation of the formula for rotational energy. Outside of programming I did some linear algebra work to be able to better understand how future and currently implemented physics concepts work. I also added extra timing details for diagnostics so that I can actually ensure any optimizations I make are actually faster. Next I plan on improving the arrows some more, improving the rendering system, and soon starting work on Collision Detection and Resolution :)

0
Luka Trojan

I added a GUI as well as fixing a couple bugs and starting with some debug features. I added egui as a Gui then built a couple menus. One for energy to make sure that everything is being conserved as it should; a second for timing to see various information such as real runtime, sim runtime, fps, dt, and more; and a third menu for displaying the properties of each polyhedron on the screen. I also did some rendering work to allow for the creation of an object with a given color instead of just the base texture I have been using for everything. I will probably be switching to a system where each object has a color instead of a texture for the next devlog. I also made it so that you can have all the meshes in the sim at a time and simply instantiate whatever you want. And I added an arrow model which will be used for visualization of vectors for debugging in the future.

0
Luka Trojan

This was difficult! I finally managed to correctly calculate the Mass Properties of Polyhedrons. I struggled A LOT. I had problems with tobj parsing the .obj files and just wrote my own parser, I had problems with small math errors (using y instead of x), algorithmic problems (returning values in the wrong order), I had problems with Blender, I had problems with basically everything imaginable. But in the end I got it all to work! I followed the paper “Fast and Accurate calculation of Polyhedral Mass Properties” by Brian Mirtich for the method. I kinda with I chose something easier but overall it wasn’t horrible. If you want implementation details this video goes over it (youtu.be/GYc99lMdcFE?si=dgcRPm1IwhJFrHNV). Overall this makes me pretty happy since simulating this corkscrew has been exciting and now that the Inertia Tensor is computed I can move on to other stuff! I will likely go on to work on a GUI with debugging utilities since right now that is really annoying and then after that work on GJK + EPA for Collision Detection then work on Collision Resolution and Friction. I also want to work on the README.md and maybe a release for the future. I wish I could’ve given more devlogs but honestly I was just working on implementing this for the past 10hrs.

0
Luka Trojan

I ended up adding gravity and setting up a simple scene using the figure eight periodic 3 body problem solution. You can see how the 3 bodies orbit around each other in a figure eight. I also started work on calculation of the moment of inertia based on this paper (doi.org/10.1080/10867651.1996.10487458) to be able to actually accurately apply torque to objects. After I am done with that I will probably work on collision. I want to calculate the mass properties first since it is necessary for proper collision resolution which would come after doing collision detection.

0
Luka Trojan

Started with the code from the learn-wgpu tutorial. Then I refactored the code into multiple components to split the renderer, from the physics, from the app, etc. Then I decided to create some code to make it possible to choose between f32 and f64 for speed or precision. (speed for basic dynamics, precision for keplerian systems and such). Then I learned wtf a Quaternion for a few hours. Then finally added some simple physics code to move and rotate a mesh using a basic first order euler integrator and edited the material from the base material. I refactored some stuff. Added a more advanced integrator (dormand-prince) to upgrade the first order euler from before which I will use for the foreseeable future, removed the bump map from the mesh, added a struct for constructing rigidbodies, added some more functions for f32 and f64 switching. Added support for uses several different meshes at the same time, I added angular momentum. And finally wrote a README.md :). Overall just spent a bunch of time setting things up and making sure everything is working properly. A lot of the hours are not tracked since I setup Hackatime a bit late. Next I plan on calculating the inertia tensor and implementing proper integration of angular velocity.

0