Now you can change the velocity and lock it to a specific axis!! Also I upgraded to C++23 from C++20.
ㅤ
Yeah that feature was a real nightmare to implement, with loads of bugs. That stupid float vs double thing came back to bite me again!!!! I swear bro these things annoy me a lot.
How do I do this?
I also initially had like no idea how this feature should be implemented, I was sitting there thinking and trying code out for a long time. I eventually decided to change the way velocities are changed entirely, now instead of just clicking and dragging, you press V on the keyboard and click with the mouse to confirm.
ㅤ
Even after that I had a dilemma about how exactly this axis locking feature should be implemented. I was initially going to cast a ray from the mouse and figure out where it is closest to the axis, however it turns out that is math that goes outside of high school altogether, so I had to scrap that.
ㅤ
Then I decided to open up Blender and see how it does it’s axis locking when you drag 3D objects around. From Blender I got inspiration for how it works in my program.
ㅤ
So now once you are editing the velocity, you can press X,Y, or Z to change the velocity going in those respective axes if you want. I also figured a much simpler way than that first method I thought of because of the testing with Blender.
AI disclaimer
Obviously there had to be some bugs with my code. After having spent a bunch of time struggling through writing the code only to reach some weird bugs, I gave up and did turn to AI.
ㅤ
I carefully supervised it while it tried to fix my code (I do NOT believe in vibe-coding) and it was actually able to fix it alright. I made a suggestion to edit the code to be cleaner and it listened.
The ultimate plot twist
I then asked it to add that sky-blue line thing. Now here’s the ultimate plot twist, so you know that float vs double precision error that keeps coming back to me? Well in every previous devlog where it happened, it was Claude who pointed out the issue. Well guess what? This time it was me who found it! The issue was with that line and how it was drawn on screen.
ㅤ
So yeah. That took a very long time, but it was worth it.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.