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

Function GetObjectPointInWorld

Descent3/object.cpp:3274–3312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3272}
3273
3274void GetObjectPointInWorld(vector *dest, object *obj, int subnum, int vertnum) {
3275 poly_model *pm = &Poly_models[obj->rtype.pobj_info.model_num];
3276 bsp_info *sm = &pm->submodel[subnum];
3277 float normalized_time[MAX_SUBOBJECTS];
3278 int i;
3279
3280 if (!pm->new_style)
3281 return;
3282
3283 for (i = 0; i < MAX_SUBOBJECTS; i++)
3284 normalized_time[i] = 0.0;
3285
3286 SetModelAnglesAndPos(pm, normalized_time);
3287
3288 vector pnt = sm->verts[vertnum];
3289 int mn = subnum;
3290 matrix m;
3291
3292 // Instance up the tree for this gun
3293 while (mn != -1) {
3294 vector tpnt;
3295
3296 vm_AnglesToMatrix(&m, pm->submodel[mn].angs.p, pm->submodel[mn].angs.h, pm->submodel[mn].angs.b);
3297 vm_TransposeMatrix(&m);
3298
3299 tpnt = pnt * m;
3300
3301 pnt = tpnt + pm->submodel[mn].offset + pm->submodel[mn].mod_pos;
3302
3303 mn = pm->submodel[mn].parent;
3304 }
3305
3306 // now instance for the entire object
3307 m = obj->orient;
3308 vm_TransposeMatrix(&m);
3309
3310 *dest = pnt * m;
3311 *dest += obj->pos;
3312}
3313
3314bool ObjGetAnimUpdate(uint16_t objnum, custom_anim *multi_anim_info) {
3315 object *obj = &Objects[objnum];

Callers 8

BuildObjectLightmapUVsFunction · 0.85
TestObjectLightAdjacencyFunction · 0.85
CombineObjectLightmapUVsFunction · 0.85
BSPGetMineChecksumFunction · 0.85
BuildBSPTreeFunction · 0.85
BuildSingleBSPTreeFunction · 0.85
BSPPointInPolygonFunction · 0.85

Calls 3

SetModelAnglesAndPosFunction · 0.85
vm_AnglesToMatrixFunction · 0.50
vm_TransposeMatrixFunction · 0.50

Tested by 1

TestObjectLightAdjacencyFunction · 0.68