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

@@ -76,7 +76,7 @@ struct NewtonsRopeCradleExample : public CommonRigidBodyBase {
}
virtual void createRopePendulum(btSphereShape* colShape,
btVector3 position, btQuaternion pendulumOrientation, btScalar width, btScalar height, btScalar mass);
const btVector3& position, const btQuaternion& pendulumOrientation, btScalar width, btScalar height, btScalar mass);
virtual void changePendulaRestitution(btScalar restitution);
virtual void connectWithRope(btRigidBody* body1, btRigidBody* body2);
virtual bool keyboardCallback(int key, int state);
@@ -254,7 +254,7 @@ void NewtonsRopeCradleExample::stepSimulation(float deltaTime) {
}
void NewtonsRopeCradleExample::createRopePendulum(btSphereShape* colShape,
btVector3 position, btQuaternion pendulumOrientation, btScalar width, btScalar height, btScalar mass) {
const btVector3& position, const btQuaternion& pendulumOrientation, btScalar width, btScalar height, btScalar mass) {
// The pendulum looks like this (names when built):
// O O topSphere1 topSphere2