Change btVector3/btQuaternion to const btVector3&/btQuaternion&.

------------------------------------------------------------------
Parameters such as btVector3/btQuaternion need to be passed as const reference, not by value (it causes SIMD alignnment errors on Windows).
This commit is contained in:
Benjamin Ellenberger
2016-07-11 23:22:17 +02:00
parent ed13cc6c26
commit 5f03b039a5
3 changed files with 11 additions and 18 deletions

View File

@@ -50,7 +50,7 @@ struct NewtonsCradleExample: public CommonRigidBodyBase {
}
virtual void initPhysics();
virtual void renderScene();
virtual void createPendulum(btSphereShape* colShape, btVector3 position, btScalar length, btScalar mass);
virtual void createPendulum(btSphereShape* colShape, const btVector3& position, btScalar length, btScalar mass);
virtual void changePendulaLength(btScalar length);
virtual void changePendulaRestitution(btScalar restitution);
virtual void stepSimulation(float deltaTime);
@@ -184,7 +184,7 @@ void NewtonsCradleExample::stepSimulation(float deltaTime) {
}
}
void NewtonsCradleExample::createPendulum(btSphereShape* colShape,btVector3 position, btScalar length, btScalar mass) {
void NewtonsCradleExample::createPendulum(btSphereShape* colShape, const btVector3& position, btScalar length, btScalar mass) {
// The pendulum looks like this (names when built):
// O topSphere