Jump to content

Home

Desentagration


zeek2304

Recommended Posts

if (traceEnt->client && preHealth > 0 && traceEnt->health <= 0 && fullCharge)
			{ //was killed by a fully charged sniper shot, so disintegrate
				VectorCopy(preAng, traceEnt->client->ps.viewangles);

				traceEnt->client->ps.eFlags |= EF_DISINTEGRATION;
				VectorCopy(tr.endpos, traceEnt->client->ps.lastHitLoc);

				traceEnt->client->ps.legsAnim = preLegs;
				traceEnt->client->ps.torsoAnim = preTorso;

				traceEnt->r.contents = 0;

				VectorClear(traceEnt->client->ps.velocity);
			}

 

(g_weapon.c, line 716)

 

 

This is the actual effect as rendered by the client:

if ((cent->currentState.eFlags & EF_DISINTEGRATION) && cent->currentState.eType == ET_BODY)
{
	vec3_t tempAng, hitLoc;
	float tempLength;

	if (!cent->dustTrailTime)
	{
		cent->dustTrailTime = cg.time;
	}

	VectorCopy(cent->currentState.origin2, hitLoc);

	VectorSubtract( hitLoc, ent.origin, ent.oldorigin );

	tempLength = VectorNormalize( ent.oldorigin );
	vectoangles( ent.oldorigin, tempAng );
	tempAng[YAW] -= cent->lerpAngles[YAW];
	AngleVectors( tempAng, ent.oldorigin, NULL, NULL );
	VectorScale( ent.oldorigin, tempLength, ent.oldorigin );

	ent.endTime = cent->dustTrailTime;

	/*
	ent.renderfx |= RF_DISINTEGRATE2;

	ent.customShader = cgs.media.disruptorShader;
	trap_R_AddRefEntityToScene( &ent );
	*/

	ent.renderfx &= ~(RF_DISINTEGRATE2);
	ent.renderfx |= (RF_DISINTEGRATE1);
	ent.customShader = 0;
	trap_R_AddRefEntityToScene( &ent );

	return;
}

(cg_ents.c, line 1101)

 

if (cent->currentState.eFlags & EF_DISINTEGRATION)
{
	vec3_t tempAng, hitLoc;
	float tempLength;

	if (!cent->dustTrailTime)
	{
		cent->dustTrailTime = cg.time;
		cent->miscTime = legs.frame;
	}

	if ((cg.time - cent->dustTrailTime) > 1500)
	{ //avoid rendering the entity after disintegration has finished anyway
		goto endOfCall;
	}

	trap_G2API_SetBoneAnim(legs.ghoul2, 0, "model_root", cent->miscTime, cent->miscTime, BONE_ANIM_OVERRIDE_FREEZE, 1.0f, cg.time, cent->miscTime, -1);
	trap_G2API_SetBoneAnim(legs.ghoul2, 0, "lower_lumbar", cent->miscTime, cent->miscTime, BONE_ANIM_OVERRIDE_FREEZE, 1.0f, cg.time, cent->miscTime, -1);
	trap_G2API_SetBoneAnim(legs.ghoul2, 0, "Motion", cent->miscTime, cent->miscTime, BONE_ANIM_OVERRIDE_FREEZE, 1.0f, cg.time, cent->miscTime, -1);

	VectorCopy(cent->currentState.origin2, hitLoc);

	VectorSubtract( hitLoc, legs.origin, legs.oldorigin );

	tempLength = VectorNormalize( legs.oldorigin );
	vectoangles( legs.oldorigin, tempAng );
	tempAng[YAW] -= cent->lerpAngles[YAW];
	AngleVectors( tempAng, legs.oldorigin, NULL, NULL );
	VectorScale( legs.oldorigin, tempLength, legs.oldorigin );
	legs.endTime = cent->dustTrailTime;

	//FIXME: Sorting is all wrong here, it can't decide if it should render this part or the outer body first
	/*
	legs.renderfx |= RF_DISINTEGRATE2;
	legs.customShader = cgs.media.disruptorShader;
	trap_R_AddRefEntityToScene( &legs );
	*/

	legs.renderfx &= ~(RF_DISINTEGRATE2);
	legs.renderfx |= (RF_DISINTEGRATE1);

	legs.customShader = 0;
	trap_R_AddRefEntityToScene( &legs );

	goto endOfCall;
}

(cg_players.c)

Link to comment
Share on other sites

I think I got just a HAIR in over my head!!! Sorry guys, unless somone (ASK) can just do this for us . . . I have no idea what I'm doing . . . Was expecting something WAYYYYYYYY different than that. But hey, at least someone has the code now!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...