Baffling issues with object variables going to NaN

Hello,

So I am trying to develop a sort of 2d spacesim engine for creating games in C++. The project uses SFML for graphics, and I am currently trying to compile it on Linux using g++.

The main issue that I am wrestling with is that of simulation objects having their position, velocity, and rotation variables constantly getting set to NaN for reasons that are beyond me. The behaviour is not consistent, and occasionally will occur or not occur without any discernible pattern.

The github repo for the code is here:

https://github.com/BruceJohnJennerLawso/Ignition_Engine

I understand that NaN values can spread easily by operations on one another, but I cant seem to figure out where the initial issue is occurring here.

I apologize for asking for help like this, but I am completely stumped at this point. Any help in getting this running would be greatly appreciated.
Can you narrow it down a bit? Which file(s) are the errors occuring in?
Thats part of the problem. The vessel objects are polymorphic, with an inheritance pattern like this:

Simulation_Object
->Keplerian_Objects->Planets
->Newtonian_Objects->Vessel_I->Armstrong_class

where Armstrong class is the one that gets defined at the end. The position and rotation information is inherited from Simulation_Object, with a few other things like velocity being inherited from the Newtonian_Object class.

So, basically, I have no idea where the error is, although Newtonian_object or Vessel_I would be good bets.

More generally, I need to get a rough idea of where the first variable is going to NaN. What sort of operations could be responsible?
Last edited on
Topic archived. No new replies allowed.