I am writing a custom physics engine for the game I am doing, my class of physics objects has a lot of variables (distance, speed, acceleration, mass, gravity, force, pulse duration, etc.). Will creating a setter and getter function for each of these variables affect performance? (At the moment there will be at least 100 instances of this class)
Also need to create setters and getters? I heard that public variables are really bad practice, but there are many variables, could this be an exception?
source
share