~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to tests/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC/UpdatePositionsFromVelocities.cl

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-02 13:11:51 UTC
  • Revision ID: package-import@ubuntu.com-20130502131151-q8dvteqr1ef2x7xz
Tags: upstream-1.4.1~20130504~adb56cb
ImportĀ upstreamĀ versionĀ 1.4.1~20130504~adb56cb

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
MSTRINGIFY(
 
2
 
 
3
//#define float3 float4
 
4
 
 
5
__kernel void 
 
6
UpdatePositionsFromVelocitiesKernel( 
 
7
        const int numNodes,
 
8
        const float solverSDT,
 
9
        __global float4 * g_vertexVelocities,
 
10
        __global float4 * g_vertexPreviousPositions,
 
11
        __global float4 * g_vertexCurrentPosition)
 
12
{
 
13
        int vertexID = get_global_id(0);
 
14
        if( vertexID < numNodes )
 
15
        {       
 
16
                float3 previousPosition = g_vertexPreviousPositions[vertexID].xyz;
 
17
                float3 velocity         = g_vertexVelocities[vertexID].xyz;
 
18
                
 
19
                float3 newPosition      = previousPosition + velocity*solverSDT;
 
20
                
 
21
                g_vertexCurrentPosition[vertexID]   = (float4)(newPosition, 0.f);
 
22
                g_vertexPreviousPositions[vertexID] = (float4)(newPosition, 0.f);
 
23
        }
 
24
}
 
25
 
 
26
);
 
 
b'\\ No newline at end of file'