1
0
Fork 0

add const to argument

This commit is contained in:
Henning Stahlke 2018-01-17 21:20:55 +01:00
parent 317ad86b80
commit 2841599b12
2 changed files with 4 additions and 4 deletions

View file

@ -22,7 +22,7 @@ RigidBody::~RigidBody()
/// add new point mass to body /// add new point mass to body
/// isStatic: set to true for masses that do not change per iteration (everything but fuel?) /// isStatic: set to true for masses that do not change per iteration (everything but fuel?)
int RigidBody::addMass(float mass, float* pos, bool isStatic) int RigidBody::addMass(float mass, const float* pos, bool isStatic)
{ {
// If out of space, reallocate twice as much // If out of space, reallocate twice as much
if(_nMasses == _massesAlloced) { if(_nMasses == _massesAlloced) {
@ -211,7 +211,7 @@ void RigidBody::addForce(const float* pos, const float* force)
addTorque(t); addTorque(t);
} }
void RigidBody::getAccel(float* pos, float* accelOut) const void RigidBody::getAccel(const float* pos, float* accelOut) const
{ {
getAccel(accelOut); getAccel(accelOut);

View file

@ -30,7 +30,7 @@ public:
// Adds a point mass to the system. Returns a handle so the gyro // Adds a point mass to the system. Returns a handle so the gyro
// can be later modified via setMass(). // can be later modified via setMass().
int addMass(float mass, float* pos, bool isStatic = false); int addMass(float mass, const float* pos, bool isStatic = false);
// Modifies a previously-added point mass (fuel tank running dry, // Modifies a previously-added point mass (fuel tank running dry,
// gear going up, swing wing swinging, pilot bailing out, etc...) // gear going up, swing wing swinging, pilot bailing out, etc...)
@ -94,7 +94,7 @@ public:
// coordinates. If the body is rotating, this will be different // coordinates. If the body is rotating, this will be different
// from the c.g. acceleration due to the centripetal accelerations // from the c.g. acceleration due to the centripetal accelerations
// of points not on the rotation axis. // of points not on the rotation axis.
void getAccel(float* pos, float* accelOut) const; void getAccel(const float* pos, float* accelOut) const;
// Returns the instantaneous rate of change of the angular // Returns the instantaneous rate of change of the angular
// velocity, as a vector in local coordinates. // velocity, as a vector in local coordinates.