Remove btSoftBodySolver_CPU.*
Move btSoftBodySolverData.h to src/BulletMultiThreaded/GpuSoftBodySolvers/Shared/btSoftBodySolverData.h Attempt to re-enable MiniCL version of OpenCLClothDemo (cloth-capsule collision still broken) Add optional OpenCL acceleration to SerializeDemo (just for cloth)
This commit is contained in:
@@ -57,11 +57,118 @@ struct float8
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
float select( float arg0, float arg1, bool select)
|
||||
{
|
||||
if (select)
|
||||
return arg0;
|
||||
return arg1;
|
||||
}
|
||||
|
||||
#define __constant
|
||||
|
||||
|
||||
struct float3
|
||||
{
|
||||
float x,y,z;
|
||||
|
||||
float3& operator+=(const float3& other)
|
||||
{
|
||||
x += other.x;
|
||||
y += other.y;
|
||||
z += other.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
float3& operator-=(const float3& other)
|
||||
{
|
||||
x -= other.x;
|
||||
y -= other.y;
|
||||
z -= other.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
static float dot(const float3&a ,const float3& b)
|
||||
{
|
||||
float3 tmp;
|
||||
tmp.x = a.x*b.x;
|
||||
tmp.y = a.y*b.y;
|
||||
tmp.z = a.z*b.z;
|
||||
return tmp.x+tmp.y+tmp.z;
|
||||
}
|
||||
|
||||
static float3 operator-(const float3& a,const float3& b)
|
||||
{
|
||||
float3 tmp;
|
||||
tmp.x = a.x - b.x;
|
||||
tmp.y = a.y - b.y;
|
||||
tmp.z = a.z - b.z;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static float3 operator*(const float& scalar,const float3& b)
|
||||
{
|
||||
float3 tmp;
|
||||
tmp.x = scalar * b.x;
|
||||
tmp.y = scalar * b.y;
|
||||
tmp.z = scalar * b.z;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static float3 operator*(const float3& a,const float& scalar)
|
||||
{
|
||||
float3 tmp;
|
||||
tmp.x = a.x * scalar;
|
||||
tmp.y = a.y * scalar;
|
||||
tmp.z = a.z * scalar;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
static float3 operator*(const float3& a,const float3& b)
|
||||
{
|
||||
float3 tmp;
|
||||
tmp.x = a.x * b.x;
|
||||
tmp.y = a.y * b.y;
|
||||
tmp.z = a.z * b.z;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
//ATTRIBUTE_ALIGNED16(struct) float4
|
||||
struct float4
|
||||
{
|
||||
float x,y,z,w;
|
||||
union
|
||||
{
|
||||
struct {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
};
|
||||
float3 xyz;
|
||||
};
|
||||
float w;
|
||||
|
||||
float4() {}
|
||||
|
||||
float4(float v0, float v1, float v2, float v3)
|
||||
{
|
||||
x=v0;
|
||||
y=v1;
|
||||
z=v2;
|
||||
w=v3;
|
||||
|
||||
}
|
||||
float4(float3 xyz, float scalarW)
|
||||
{
|
||||
x = xyz.x;
|
||||
y = xyz.y;
|
||||
z = xyz.z;
|
||||
w = scalarW;
|
||||
}
|
||||
|
||||
float4(float v)
|
||||
{
|
||||
x = y = z = w = v;
|
||||
@@ -76,6 +183,8 @@ struct float4
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
float4 operator*(const float& other)
|
||||
{
|
||||
float4 tmp;
|
||||
@@ -203,6 +312,7 @@ static float4 operator/(const float4& b,float a)
|
||||
|
||||
|
||||
|
||||
|
||||
static float dot(const float4&a ,const float4& b)
|
||||
{
|
||||
float4 tmp;
|
||||
|
||||
Reference in New Issue
Block a user