share more data structures and code between OpenCL kernels and C/C++ code on CPU (non-OpenCL)

integrateSingleTransform
fix bug in registerRigidBody (could lead to random crashes, especially when performing picking/adding rigid bodies afterwards)
This commit is contained in:
erwin coumans
2013-11-07 15:49:57 -08:00
parent e20cb22832
commit e85bae5fe3
19 changed files with 270 additions and 111 deletions

View File

@@ -12,6 +12,9 @@ struct MyTest
#else
#define b3AtomicInc atomic_inc
#define b3Fabs fabs
#define b3Sqrt native_sqrt
#define b3Sin native_sin
#define b3Cos native_cos
#endif
#endif

View File

@@ -31,7 +31,7 @@ inline float4 b3FastNormalize4(float4 v)
}
inline b3Quat b3QuatMul(b3Quat a, b3Quat b);
inline b3Quat b3QuatNormalize(b3QuatConstArg in);
inline b3Quat b3QuatNormalized(b3QuatConstArg in);
inline b3Quat b3QuatRotate(b3QuatConstArg q, b3QuatConstArg vec);
inline b3Quat b3QuatInvert(b3QuatConstArg q);
inline b3Quat b3QuatMul(b3QuatConstArg a, b3QuatConstArg b)
@@ -44,8 +44,10 @@ inline b3Quat b3QuatMul(b3QuatConstArg a, b3QuatConstArg b)
return ans;
}
inline b3Quat b3QuatNormalize(b3QuatConstArg in)
inline b3Quat b3QuatNormalized(b3QuatConstArg in)
{
b3Quat q;
q=in;
//return b3FastNormalize4(in);
float len = native_sqrt(dot(q, q));
if(len > 0.f)