| 953 | } |
| 954 | |
| 955 | void TSShapeInstance::animateGround() |
| 956 | { |
| 957 | mGroundTransform.identity(); |
| 958 | |
| 959 | // pick thread which controlls ground transform |
| 960 | // if we haven't already... |
| 961 | if (!mGroundThread && !initGround()) |
| 962 | return; |
| 963 | |
| 964 | S32 & loop = mGroundThread->path.loop; |
| 965 | F32 & start = mGroundThread->path.start; |
| 966 | F32 & end = mGroundThread->path.end; |
| 967 | |
| 968 | // accumulate path transform |
| 969 | if (loop>0) |
| 970 | { |
| 971 | addPath(mGroundThread,start,1.0f); |
| 972 | while (--loop) |
| 973 | addPath(mGroundThread,0.0f,1.0f); |
| 974 | addPath(mGroundThread,0.0f,end); |
| 975 | } |
| 976 | else if (loop<0) |
| 977 | { |
| 978 | addPath(mGroundThread,start,0.0f); |
| 979 | while (++loop) |
| 980 | addPath(mGroundThread,1.0f,0.0f); |
| 981 | addPath(mGroundThread,1.0f,end); |
| 982 | } |
| 983 | else |
| 984 | addPath(mGroundThread,start,end); |
| 985 | start = end; // in case user tries to animateGround twice |
| 986 | } |
| 987 | |
| 988 | void TSShapeInstance::deltaGround(TSThread * thread, F32 start, F32 end, MatrixF * mat) |
| 989 | { |