MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / HTextureComputeUVRoomFaceCenter

Function HTextureComputeUVRoomFaceCenter

editor/HTexture.cpp:529–543  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

527}
528
529void 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
545void 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;

Callers 1

HTextureRotateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected