void UpdateCollumnVerticesPosition()
{
Profiler.BeginSample("Update Collumn Vertices");
Vector3 forwardVec = transform.forward;
float deltaT = Time.deltaTime;
Vector3 posIncrement = meshSpeed * forwardVec * deltaT;
Vector3 tempPos = Vector3.zero;
Vector3 anchorLocalPos = stitchAnchorOffset * audioDirector.averageAmplitude;
for(int h = 0; h < meshCollumnsArray.Length; h++)
{
for(int i = 0 ; i < collumnDepth ; i++)
{
// handle origin stitches/vertices
if (i < collumnStitchIndex)
{
// leap motion finger stitching
if (fingertipStitch.isValidData == true)
{
int reversedJointsOrderIndex = (jointsPerFinger - i) - 1;
collumnsArrayVerticesArray[h][i] = fingerJointsArrayStitchesPosArray[reversedJointsOrderIndex][h];
}
else
{
// default to common origin stitch point
// old/normal way, unified origin point
stitchPosObject.transform.localPosition = anchorLocalPos;
collumnsArrayVerticesArray[h][i] = stitchPosObject.transform.position; //stitchAnchorOffset + tempPosition;
}
}
else // oridinary vertices
{
//// not unified physics now, could cause trouble later`
// doing in line for perf as seen in --> https://www.youtube.com/watch?v=WE3PWHLGsX4
tempPos = collumnsArrayVerticesArray[h][i];
tempPos.x += posIncrement.x;
tempPos.y += posIncrement.y;
tempPos.z += posIncrement.z;
collumnsArrayVerticesArray[h][i] = tempPos;
}
}
meshCollumnsMeshComponentArray[h].vertices = collumnsArrayVerticesArray[h];
}
Profiler.EndSample();
}