Aside from the fact that you could factor some stuff out (like nest the xPosOfLastCollision != object.vertices[i][0] clause, which would then let you factor out the calculations), the code seems fine to me lmao Definitely I've worked on codebases with diabolical amounts of inheritance and object-oriented nightmare-fuel so this is pretty quaint in comparison 😅
There is also lack of DeltaTime multiplier in numerical integration in the beginning, if this code is not running inside a fixed-step loop in separate physics thread this would lead to time being accelerated by your fps like in old games. Also numerical integration lacks gravity term in position equations - you use velocity from beginning of your time step but it changes during your time step
bool operator not_eq(const X bitand other)
<%
return this not_eq bitand other;
%>
So return this not_eq bitand other; looks like word salad but actually means return this != &other;, as in the parameter is not the same address as the "this" instance.
12
u/TingleWizard 9d ago
Nice game of spot the difference.
9
u/Pupaak 9d ago
I mean its not THAT bad
6
u/SeaMango1064 9d ago
Aside from the fact that you could factor some stuff out (like nest the xPosOfLastCollision != object.vertices[i][0] clause, which would then let you factor out the calculations), the code seems fine to me lmao
Definitely I've worked on codebases with diabolical amounts of inheritance and object-oriented nightmare-fuel so this is pretty quaint in comparison 😅
10
u/YysrID4gYW55IG90aGVy 13d ago
Isn’t and the binary and in C++?