added OpenCL cloth demo, contributed by AMD.

updated GpuSoftBodySolvers
updated DirectCompute cloth demo
This commit is contained in:
erwin.coumans
2010-08-14 00:56:17 +00:00
parent 40958f2b4a
commit 4f9b450200
72 changed files with 7524 additions and 843 deletions

View File

@@ -140,6 +140,8 @@ static float4 operator+(const float4& a,const float4& b)
return tmp;
}
static float4 operator-(const float4& a,const float4& b)
{
float4 tmp;
@@ -159,6 +161,17 @@ static float4 operator*(float a,const float4& b)
return tmp;
}
static float4 operator/(const float4& b,float a)
{
float4 tmp;
tmp.x = b.x/a;
tmp.y = b.y/a;
tmp.z = b.z/a;
tmp.w = b.w/a;
return tmp;
}
static float dot(const float4&a ,const float4& b)
{
@@ -170,6 +183,22 @@ static float dot(const float4&a ,const float4& b)
return tmp.x+tmp.y+tmp.z+tmp.w;
}
static float length(const float4&a)
{
float l = sqrtf(a.x*a.x+a.y*a.y+a.z*a.z);
return l;
}
static float4 normalize(const float4&a)
{
float4 tmp;
float l = length(a);
tmp = 1.f/l*a;
return tmp;
}
static float4 cross(const float4&a ,const float4& b)
{
float4 tmp;