aboutsummaryrefslogtreecommitdiff
path: root/tests/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/UpdatePositionsFromVelocities.cl
blob: 97e708bc3436094e5e7c175f5228051b810900e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
MSTRINGIFY(




__kernel void 
UpdatePositionsFromVelocitiesKernel( 
	const int numNodes,
	const float solverSDT,
	__global float4 * g_vertexVelocities,
	__global float4 * g_vertexPreviousPositions,
	__global float4 * g_vertexCurrentPosition GUID_ARG)
{
	int vertexID = get_global_id(0);
	if( vertexID < numNodes )
	{	
		float4 previousPosition = g_vertexPreviousPositions[vertexID];
		float4 velocity         = g_vertexVelocities[vertexID];
		
		float4 newPosition      = previousPosition + velocity*solverSDT;
		
		g_vertexCurrentPosition[vertexID]   = newPosition;
		g_vertexPreviousPositions[vertexID] = newPosition;
	}
}

);