| 1080 | } |
| 1081 | |
| 1082 | void iBoxForModelLocal(xBox* o, const xModelInstance* m) |
| 1083 | { |
| 1084 | RpAtomic* imodel = m->Data; |
| 1085 | RpGeometry* geom = imodel->geometry; |
| 1086 | if (geom->triangles == NULL) |
| 1087 | { |
| 1088 | o->lower.x = imodel->boundingSphere.center.x - imodel->boundingSphere.radius; |
| 1089 | o->lower.y = imodel->boundingSphere.center.y - imodel->boundingSphere.radius; |
| 1090 | o->lower.z = imodel->boundingSphere.center.z - imodel->boundingSphere.radius; |
| 1091 | o->upper.x = imodel->boundingSphere.center.x + imodel->boundingSphere.radius; |
| 1092 | o->upper.y = imodel->boundingSphere.center.y + imodel->boundingSphere.radius; |
| 1093 | o->upper.z = imodel->boundingSphere.center.z + imodel->boundingSphere.radius; |
| 1094 | return; |
| 1095 | } |
| 1096 | |
| 1097 | if (geom->numMorphTargets > 1 || geom->numMorphTargets >= 1) |
| 1098 | { |
| 1099 | RpMorphTarget* mtgt = geom->morphTarget; |
| 1100 | iBoxInitBoundVec(o, (xVec3*)mtgt->verts); |
| 1101 | |
| 1102 | for (U16 idx = 1; idx < geom->numVertices; idx++) |
| 1103 | { |
| 1104 | iBoxBoundVec(o, o, (xVec3*)&mtgt->verts[idx]); |
| 1105 | } |
| 1106 | } |
| 1107 | } |
no test coverage detected