6
__global int2 * g_linksVertexIndices,
7
__global float * g_linksMassLSC,
8
__global float4 * g_nodesPreviousPosition,
9
__global float * g_linksLengthRatio,
10
__global float4 * g_linksCurrentLength)
12
int linkID = get_global_id(0);
13
if( linkID < numLinks )
15
int2 nodeIndices = g_linksVertexIndices[linkID];
16
int node0 = nodeIndices.x;
17
int node1 = nodeIndices.y;
19
float4 nodePreviousPosition0 = g_nodesPreviousPosition[node0];
20
float4 nodePreviousPosition1 = g_nodesPreviousPosition[node1];
22
float massLSC = g_linksMassLSC[linkID];
24
float4 linkCurrentLength = nodePreviousPosition1 - nodePreviousPosition0;
26
float linkLengthRatio = dot(linkCurrentLength, linkCurrentLength)*massLSC;
27
linkLengthRatio = 1.0f/linkLengthRatio;
29
g_linksCurrentLength[linkID] = linkCurrentLength;
30
g_linksLengthRatio[linkID] = linkLengthRatio;
b'\\ No newline at end of file'