| 527 | } |
| 528 | |
| 529 | void HTextureComputeUVRoomFaceCenter(g3UVL *uvcenter, room *roomp, int facenum) { |
| 530 | int i; |
| 531 | face *facep = &roomp->faces[facenum]; |
| 532 | |
| 533 | uvcenter->u = 0; |
| 534 | uvcenter->v = 0; |
| 535 | |
| 536 | for (i = 0; i < facep->num_verts; i++) { |
| 537 | uvcenter->u += facep->face_uvls[i].u; |
| 538 | uvcenter->v += facep->face_uvls[i].v; |
| 539 | } |
| 540 | |
| 541 | uvcenter->u /= i; |
| 542 | uvcenter->v /= i; |
| 543 | } |
| 544 | |
| 545 | void HTextureRotUVPoint(g3UVL *uvrot, float *rotmat, roomUVL *uv, g3UVL *uvcenter) { |
| 546 | uvrot->u = ((uv->u - uvcenter->u) * rotmat[0]) + ((uv->v - uvcenter->v) * rotmat[1]) + uvcenter->u; |