fix issue in the recent SSE implementation of setInterpolate3
align class
This commit is contained in:
@@ -34,7 +34,7 @@ class btPairCachingGhostObject;
|
|||||||
///btKinematicCharacterController is an object that supports a sliding motion in a world.
|
///btKinematicCharacterController is an object that supports a sliding motion in a world.
|
||||||
///It uses a ghost object and convex sweep test to test for upcoming collisions. This is combined with discrete collision detection to recover from penetrations.
|
///It uses a ghost object and convex sweep test to test for upcoming collisions. This is combined with discrete collision detection to recover from penetrations.
|
||||||
///Interaction between btKinematicCharacterController and dynamic rigid bodies needs to be explicity implemented by the user.
|
///Interaction between btKinematicCharacterController and dynamic rigid bodies needs to be explicity implemented by the user.
|
||||||
class btKinematicCharacterController : public btCharacterControllerInterface
|
ATTRIBUTE_ALIGNED16(class) btKinematicCharacterController : public btCharacterControllerInterface
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@@ -92,6 +92,9 @@ protected:
|
|||||||
void stepForwardAndStrafe (btCollisionWorld* collisionWorld, const btVector3& walkMove);
|
void stepForwardAndStrafe (btCollisionWorld* collisionWorld, const btVector3& walkMove);
|
||||||
void stepDown (btCollisionWorld* collisionWorld, btScalar dt);
|
void stepDown (btCollisionWorld* collisionWorld, btScalar dt);
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
BT_DECLARE_ALIGNED_ALLOCATOR();
|
||||||
|
|
||||||
btKinematicCharacterController (btPairCachingGhostObject* ghostObject,btConvexShape* convexShape,btScalar stepHeight, int upAxis = 1);
|
btKinematicCharacterController (btPairCachingGhostObject* ghostObject,btConvexShape* convexShape,btScalar stepHeight, int upAxis = 1);
|
||||||
~btKinematicCharacterController ();
|
~btKinematicCharacterController ();
|
||||||
|
|
||||||
|
|||||||
@@ -472,15 +472,19 @@ public:
|
|||||||
return absolute().maxAxis();
|
return absolute().maxAxis();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SIMD_FORCE_INLINE void setInterpolate3(const btVector3& v0, const btVector3& v1, btScalar rt)
|
SIMD_FORCE_INLINE void setInterpolate3(const btVector3& v0, const btVector3& v1, btScalar rt)
|
||||||
{
|
{
|
||||||
#if defined(BT_USE_SSE_IN_API) && defined (BT_USE_SSE)
|
#if defined(BT_USE_SSE_IN_API) && defined (BT_USE_SSE)
|
||||||
__m128 vrt = _mm_load_ss(&rt); // (rt 0 0 0)
|
__m128 vrt = _mm_load_ss(&rt); // (rt 0 0 0)
|
||||||
|
btScalar s = btScalar(1.0) - rt;
|
||||||
|
__m128 vs = _mm_load_ss(&s); // (S 0 0 0)
|
||||||
|
vs = bt_pshufd_ps(vs, 0x80); // (S S S 0.0)
|
||||||
|
__m128 r0 = _mm_mul_ps(v0.mVec128, vs);
|
||||||
vrt = bt_pshufd_ps(vrt, 0x80); // (rt rt rt 0.0)
|
vrt = bt_pshufd_ps(vrt, 0x80); // (rt rt rt 0.0)
|
||||||
|
__m128 r1 = _mm_mul_ps(v1.mVec128, vrt);
|
||||||
mVec128 = _mm_sub_ps(v1.mVec128, v0.mVec128);
|
__m128 tmp3 = _mm_add_ps(r0,r1);
|
||||||
mVec128 = _mm_mul_ps(mVec128, vrt);
|
mVec128 = tmp3;
|
||||||
mVec128 = _mm_add_ps(mVec128, v0.mVec128);
|
|
||||||
#elif defined(BT_USE_NEON)
|
#elif defined(BT_USE_NEON)
|
||||||
mVec128 = vsubq_f32(v1.mVec128, v0.mVec128);
|
mVec128 = vsubq_f32(v1.mVec128, v0.mVec128);
|
||||||
mVec128 = vmulq_n_f32(mVec128, rt);
|
mVec128 = vmulq_n_f32(mVec128, rt);
|
||||||
|
|||||||
Reference in New Issue
Block a user