// update the inverse matrix for the renderer
Matrix4x4_Invert_Simple(&ent->inversematrix, &ent->matrix);
// update the animation blend state
- VM_FrameBlendFromFrameGroupBlend(ent->frameblend, ent->framegroupblend, ent->model);
+ VM_FrameBlendFromFrameGroupBlend(ent->frameblend, ent->framegroupblend, ent->model, cl.time);
// we need the matrix origin to center the box
Matrix4x4_OriginFromMatrix(&ent->matrix, org);
// update entity->render.scale because the renderer needs it
const matrix4x4_t *matrix;
matrix4x4_t blendmatrix, tempmatrix, matrix2;
int frame;
- float origin[3], angles[3], lerp;
+ vec_t origin[3], angles[3], lerp;
entity_t *t;
entity_render_t *r;
//entity_persistent_t *p = &e->persistent;
e->render.flags |= RENDER_ADDITIVE;
if (e->render.effects & EF_DOUBLESIDED)
e->render.flags |= RENDER_DOUBLESIDED;
+ if (e->render.effects & EF_DYNAMICMODELLIGHT)
+ e->render.flags |= RENDER_DYNAMICMODELLIGHT;
// make the other useful stuff
e->render.allowdecals = true;
if (len > 0)
len = 1.0f / len;
VectorScale(vel, len, vel);
- CL_ParticleTrail(trailtype, 1, e->persistent.trail_origin, origin, vel, vel, e, e->state_current.glowcolor, false, true, NULL, NULL);
+ // pass time as count so that trails that are time based (such as an emitter) will emit properly as long as they don't use trailspacing
+ CL_ParticleTrail(trailtype, bound(0, cl.time - cl.oldtime, 0.1), e->persistent.trail_origin, origin, vel, vel, e, e->state_current.glowcolor, false, true, NULL, NULL);
}
// now that the entity has survived one trail update it is allowed to
// leave a real trail on later frames
if ((e->state_current.lightpflags & PFLAGS_FULLDYNAMIC) && r_refdef.scene.numlights < MAX_DLIGHTS)
{
matrix4x4_t dlightmatrix;
- float light[4];
+ vec4_t light;
VectorScale(e->state_current.light, (1.0f / 256.0f), light);
light[3] = e->state_current.light[3];
if (light[0] == 0 && light[1] == 0 && light[2] == 0)
e->render.flags |= RENDER_SHADOW;
VectorSet(e->render.colormod, 1, 1, 1);
VectorSet(e->render.glowmod, 1, 1, 1);
- VM_FrameBlendFromFrameGroupBlend(e->render.frameblend, e->render.framegroupblend, e->render.model);
+ VM_FrameBlendFromFrameGroupBlend(e->render.frameblend, e->render.framegroupblend, e->render.model, cl.time);
e->render.allowdecals = true;
CL_UpdateRenderEntity(&e->render);
r_refdef.scene.entities[r_refdef.scene.numentities++] = &e->render;
CL_Video_Init();
}
-
-
-