Change all btVector/btTransform to const btVector/btTransform& for SIMD alignment.
This commit is contained in:
@@ -460,7 +460,7 @@ public:
|
|||||||
return getDistanceFitness(); // for now it is only distance
|
return getDistanceFitness(); // for now it is only distance
|
||||||
}
|
}
|
||||||
|
|
||||||
void resetAt(btVector3 position) {
|
void resetAt(const btVector3& position) {
|
||||||
btTransform resetPosition(btQuaternion::getIdentity(), position);
|
btTransform resetPosition(btQuaternion::getIdentity(), position);
|
||||||
for (int i = 0; i < BODYPART_COUNT; ++i)
|
for (int i = 0; i < BODYPART_COUNT; ++i)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,33 +21,33 @@ subject to the following restrictions:
|
|||||||
|
|
||||||
class b3ReferenceFrameHelper {
|
class b3ReferenceFrameHelper {
|
||||||
public:
|
public:
|
||||||
static btVector3 getPointWorldToLocal( btTransform localObjectCenterOfMassTransform, btVector3 point) {
|
static btVector3 getPointWorldToLocal(const btTransform& localObjectCenterOfMassTransform, const btVector3& point) {
|
||||||
return localObjectCenterOfMassTransform.inverse() * point; // transforms the point from the world frame into the local frame
|
return localObjectCenterOfMassTransform.inverse() * point; // transforms the point from the world frame into the local frame
|
||||||
}
|
}
|
||||||
|
|
||||||
static btVector3 getPointLocalToWorld( btTransform localObjectCenterOfMassTransform, btVector3 point) {
|
static btVector3 getPointLocalToWorld(const btTransform& localObjectCenterOfMassTransform,const btVector3& point) {
|
||||||
return localObjectCenterOfMassTransform * point; // transforms the point from the world frame into the local frame
|
return localObjectCenterOfMassTransform * point; // transforms the point from the world frame into the local frame
|
||||||
}
|
}
|
||||||
|
|
||||||
static btVector3 getAxisWorldToLocal(btTransform localObjectCenterOfMassTransform, btVector3 axis) {
|
static btVector3 getAxisWorldToLocal(const btTransform& localObjectCenterOfMassTransform, const btVector3& axis) {
|
||||||
btTransform local1 = localObjectCenterOfMassTransform.inverse(); // transforms the axis from the local frame into the world frame
|
btTransform local1 = localObjectCenterOfMassTransform.inverse(); // transforms the axis from the local frame into the world frame
|
||||||
btVector3 zero(0,0,0);
|
btVector3 zero(0,0,0);
|
||||||
local1.setOrigin(zero);
|
local1.setOrigin(zero);
|
||||||
return local1 * axis;
|
return local1 * axis;
|
||||||
}
|
}
|
||||||
|
|
||||||
static btVector3 getAxisLocalToWorld(btTransform localObjectCenterOfMassTransform, btVector3 axis) {
|
static btVector3 getAxisLocalToWorld(const btTransform& localObjectCenterOfMassTransform, const btVector3& axis) {
|
||||||
btTransform local1 = localObjectCenterOfMassTransform; // transforms the axis from the local frame into the world frame
|
btTransform local1 = localObjectCenterOfMassTransform; // transforms the axis from the local frame into the world frame
|
||||||
btVector3 zero(0,0,0);
|
btVector3 zero(0,0,0);
|
||||||
local1.setOrigin(zero);
|
local1.setOrigin(zero);
|
||||||
return local1 * axis;
|
return local1 * axis;
|
||||||
}
|
}
|
||||||
|
|
||||||
static btTransform getTransformWorldToLocal(btTransform localObjectCenterOfMassTransform, btTransform transform) {
|
static btTransform getTransformWorldToLocal(const btTransform& localObjectCenterOfMassTransform, const btTransform& transform) {
|
||||||
return localObjectCenterOfMassTransform.inverse() * transform; // transforms the axis from the local frame into the world frame
|
return localObjectCenterOfMassTransform.inverse() * transform; // transforms the axis from the local frame into the world frame
|
||||||
}
|
}
|
||||||
|
|
||||||
static btTransform getTransformLocalToWorld(btTransform localObjectCenterOfMassTransform, btTransform transform) {
|
static btTransform getTransformLocalToWorld(const btTransform& localObjectCenterOfMassTransform, const btTransform& transform) {
|
||||||
return localObjectCenterOfMassTransform * transform; // transforms the axis from the local frame into the world frame
|
return localObjectCenterOfMassTransform * transform; // transforms the axis from the local frame into the world frame
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user