Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
> Space/ctrl?
Yes.
For your speed problem, no idea, but why don’t you use operator overloading and SIMD? It was invented for that exact use case. -
@Lensflare I would say llvm will take care auto vectorizing that but it's actually pretty bad when it comes to 3 dimensional vectors. The more you know!
-
There’s nothing wrong with your movement code besides the fact that you can reasonably expect it to be 3x as slow. Either there’s more to the story, or every time that code runs, a high energy charged particle from space strikes your PC’s RAM and causes a bit flip, somehow ruining performance.
-
3dgoosee1533d@BordedDev float deltaTime = 0.0f;
uint32_t lastFrame = 0;
void updateDeltaTime(void) {
uint32_t frame = SDL_GetTicks(); // current frame
deltaTime = (frame - lastFrame) / 1000.0f; // seconds
lastFrame = frame;
}
i dont see any probs -
@3dgoosee Same to me, but check the actual value, floats can be funky, especially if you're running very quickly. That and check if it's not maybe called multiple times
Related Rants

Looking at well written code like damn👏👏👏
I built a spherical voronoi minesweep
Somehow in my engine when I do :
camPos.y += camUp.y * speed * deltaTime;
It goes faster than Trump seeing an underage girl,
and when I add up everything :
camPos.x += camUp.x * speed * deltaTime;
camPos.y += camUp.y * speed * deltaTime;
camPos.z += camUp.z * speed * deltaTime;
It goes as slow as my gf seeing me.
(jk arch users dont have gfs)
Also what keys could I map to go up and down ? WASD/ZQSD usually for right left back...
Space/ctrl?
rant
engine
physics
opengl