139 f32 posX, posY, posZ;
141 if (N(VineRenderState) == -1) {
145 if (N(VineRenderState) == 0) {
174 for (j = 0; j < boneCount; j++) {
175 if (j == (boneCount - 1)) {
179 nextAngle = vine->
boneRot[j + 1];
180 if (nextAngle - curAngle1 > 180.0f) {
182 }
else if (nextAngle - curAngle1 < -180.0f) {
186 vine->
boneRot[j] = ((curAngle1 + nextAngle) / 2.0) + 90.0;
193 N(VineRenderState) = 1;
197 gSPDisplayList(
gMainGfxPos++, N(lava_piranha_vine_gfx));
216 for (j = 0; j < numPoints; j++) {
221 alphaCoord = ((f32) j * boneCount) / numPoints;
222 nearest = (s32) alphaCoord;
223 alphaFrac = alphaCoord - (f32)nearest;
225 if (nearest + 1 >= boneCount) {
226 angle = vine->
boneRot[boneCount - 1];
228 curAngle2 = vine->
boneRot[nearest];
229 nextAngle = vine->
boneRot[nearest + 1];
230 if (nextAngle - curAngle2 > 180.0f) {
233 if (nextAngle - curAngle2 < -180.0f) {
236 angle = ((nextAngle - curAngle2) * alphaFrac) + curAngle2;
239 deltaX =
sin_deg(angle) * boneLength;
240 deltaY = -
cos_deg(angle) * boneLength;
242 vtx->ob[0] = posX + deltaX;
243 vtx->ob[1] = posY + deltaY;
245 vtx->tc[0] = j * 0x140;
248 vtx->cn[1] = j * 120;
252 vtx->ob[0] = posX - deltaX;
253 vtx->ob[1] = posY - deltaY;
255 vtx->tc[0] = j * 0x140;
258 vtx->cn[1] = j * 120;
263 for (j = 0; j < numPoints - 1; j++) {
265 gSP2Triangles(
gMainGfxPos++, 1, 0, 2, 0, 1, 2, 3, 0);