| 1048 | } |
| 1049 | |
| 1050 | void iSphereForModel(xSphere* o, const xModelInstance* m) |
| 1051 | { |
| 1052 | RpAtomic* imodel = m->Data; |
| 1053 | RpGeometry* geom = imodel->geometry; |
| 1054 | if (geom->triangles == NULL) |
| 1055 | { |
| 1056 | o->center.x = imodel->boundingSphere.center.x; |
| 1057 | o->center.y = imodel->boundingSphere.center.y; |
| 1058 | o->center.z = imodel->boundingSphere.center.z; |
| 1059 | o->r = imodel->boundingSphere.radius; |
| 1060 | return; |
| 1061 | } |
| 1062 | |
| 1063 | if (geom->numMorphTargets > 1 || geom->numMorphTargets >= 1) |
| 1064 | { |
| 1065 | RpMorphTarget* mtgt = geom->morphTarget; |
| 1066 | iSphereInitBoundVec(o, (xVec3*)mtgt->verts); |
| 1067 | |
| 1068 | for (U16 idx = 1; idx < geom->numVertices; idx++) |
| 1069 | { |
| 1070 | iSphereBoundVec(o, o, (xVec3*)&mtgt->verts[idx]); |
| 1071 | } |
| 1072 | } |
| 1073 | } |
| 1074 | |
| 1075 | void iBoxForModel(xBox* o, const xModelInstance* m) |
| 1076 | { |
no test coverage detected