entity_render_t *ent = &cl.entities[cl.brushmodel_entities[i]].render;
if (!BoxesOverlap(clipboxmins, clipboxmaxs, ent->mins, ent->maxs))
continue;
- Collision_ClipToGenericEntity(&trace, ent->model, ent->frame, vec3_origin, vec3_origin, 0, &ent->matrix, &ent->inversematrix, start, mins, maxs, end, hitsupercontentsmask);
+ Collision_ClipToGenericEntity(&trace, ent->model, ent->frame2, vec3_origin, vec3_origin, 0, &ent->matrix, &ent->inversematrix, start, mins, maxs, end, hitsupercontentsmask);
if (cliptrace.realfraction > trace.realfraction && hitnetworkentity)
*hitnetworkentity = cl.brushmodel_entities[i];
Collision_CombineTraces(&cliptrace, &trace, NULL, true);
modelname = ent->render.model->name;
else
modelname = "--no model--";
- Con_Printf("%3i: %-25s:%4i (%5i %5i %5i) [%3i %3i %3i] %4.2f %5.3f\n", i, modelname, ent->render.frame, (int) ent->state_current.origin[0], (int) ent->state_current.origin[1], (int) ent->state_current.origin[2], (int) ent->state_current.angles[0] % 360, (int) ent->state_current.angles[1] % 360, (int) ent->state_current.angles[2] % 360, ent->render.scale, ent->render.alpha);
+ Con_Printf("%3i: %-25s:%4i (%5i %5i %5i) [%3i %3i %3i] %4.2f %5.3f\n", i, modelname, ent->render.frame2, (int) ent->state_current.origin[0], (int) ent->state_current.origin[1], (int) ent->state_current.origin[2], (int) ent->state_current.angles[0] % 360, (int) ent->state_current.angles[1] % 360, (int) ent->state_current.angles[2] % 360, ent->render.scale, ent->render.alpha);
}
}
// begin a new frame lerp
e->render.frame1 = e->render.frame2;
e->render.frame1time = e->render.frame2time;
- e->render.frame = e->render.frame2 = e->state_current.frame;
+ e->render.frame2 = e->state_current.frame;
e->render.frame2time = cl.time;
e->render.framelerp = 0;
}
// reset animation interpolation on weaponmodel if model changed
if (ent->state_previous.modelindex != ent->state_current.modelindex)
{
- ent->render.frame = ent->render.frame1 = ent->render.frame2 = ent->state_current.frame;
+ ent->render.frame1 = ent->render.frame2 = ent->state_current.frame;
ent->render.frame1time = ent->render.frame2time = cl.time;
ent->render.framelerp = 1;
}
ent->render.model = cl.model_precache[e->modelindex];
else
ent->render.model = cl.csqc_model_precache[-(e->modelindex+1)];
- ent->render.frame = ent->render.frame2;
ent->render.colormap = -1; // no special coloring
ent->render.alpha = 1;
VectorSet(ent->render.colormod, 1, 1, 1);
VectorCopy(ent->state_current.origin, ent->persistent.neworigin);
VectorCopy(ent->state_current.angles, ent->persistent.newangles);
// reset animation interpolation as well
- ent->render.frame = ent->render.frame1 = ent->render.frame2 = ent->state_current.frame;
+ ent->render.frame1 = ent->render.frame2 = ent->state_current.frame;
ent->render.frame1time = ent->render.frame2time = cl.time;
ent->render.framelerp = 1;
// reset various persistent stuff
// copy it to the current state
ent->render.model = cl.model_precache[ent->state_baseline.modelindex];
- ent->render.frame = ent->render.frame1 = ent->render.frame2 = ent->state_baseline.frame;
+ ent->render.frame1 = ent->render.frame2 = ent->state_baseline.frame;
ent->render.framelerp = 0;
// make torchs play out of sync
ent->render.frame1time = ent->render.frame2time = lhrandom(-10, -1);
// NULL = no model
model_t *model;
- // current uninterpolated animation frame (for things which do not use interpolation)
- int frame;
// number of the entity represents, or 0 for non-network entities
int entitynumber;
// entity shirt and pants colors (-1 if not colormapped)
// copy it to the current state
staticent->render.model = CL_GetModelByIndex((int)ent->fields.client->modelindex);
- staticent->render.frame = staticent->render.frame1 = staticent->render.frame2 = (int)ent->fields.client->frame;
+ staticent->render.frame1 = staticent->render.frame2 = (int)ent->fields.client->frame;
staticent->render.framelerp = 0;
// make torchs play out of sync
staticent->render.frame1time = staticent->render.frame2time = lhrandom(-10, -1);
e->render.model = model;
e->render.colormap = (int)ed->fields.client->colormap;
- e->render.frame = (int)ed->fields.client->frame;
e->render.skinnum = (int)ed->fields.client->skin;
e->render.effects |= e->render.model->effects;
scale = 1;
// self.frame1time is the animation base time for the interpolation target
// self.frame2 is the interpolation start (previous frame)
// self.frame2time is the animation base time for the interpolation start
- e->render.frame1 = e->render.frame = ed->fields.client->frame;
- if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.frame2))) e->render.frame = val->_float;
+ e->render.frame1 = e->render.frame2 = ed->fields.client->frame;
+ if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.frame2))) e->render.frame2 = val->_float;
if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.frame1time))) e->render.frame2time = val->_float;
if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.frame2time))) e->render.frame1time = val->_float;
if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.lerpfrac))) e->render.framelerp = val->_float;
{
// use an alternate animation if the entity's frame is not 0,
// and only if the texture has an alternate animation
- if (ent->frame != 0 && t->anim_total[1])
+ if (ent->frame2 != 0 && t->anim_total[1])
t = t->anim_frames[1][(t->anim_total[1] >= 2) ? ((int)(r_refdef.time * 5.0f) % t->anim_total[1]) : 0];
else
t = t->anim_frames[0][(t->anim_total[0] >= 2) ? ((int)(r_refdef.time * 5.0f) % t->anim_total[0]) : 0];