//-------------------------------- // hhProxDoorRotator::WriteToSnapshot //-------------------------------- void hhProxDoorRotator::WriteToSnapshot( idBitMsgDelta &msg ) const { // hhProxDoorSection::WriteToSnapshot(msg); #ifdef _SYNC_PROXDOORS WriteBindToSnapshot(msg); if (GetPhysics()->IsType(idPhysics_Static::Type)) { idPhysics_Static *phys = static_cast<idPhysics_Static *>(GetPhysics()); staticPState_t *state = phys->GetPState(); msg.WriteFloat(state->origin.x); msg.WriteFloat(state->origin.y); msg.WriteFloat(state->origin.z); msg.WriteFloat(state->localOrigin.x); msg.WriteFloat(state->localOrigin.y); msg.WriteFloat(state->localOrigin.z); idCQuat q = state->localAxis.ToCQuat(); msg.WriteFloat(q.x); msg.WriteFloat(q.y); msg.WriteFloat(q.z); } #else msg.WriteBits(proxyParent.GetSpawnId(), 32); WriteBindToSnapshot(msg); msg.WriteBits(bindParent.GetSpawnId(), 32); #endif //not needed without prediction //msg.WriteBits(bindParent.GetSpawnId(), 32); }
/* ================ idLight::WriteToSnapshot ================ */ void idLight::WriteToSnapshot( idBitMsgDelta &msg ) const { GetPhysics()->WriteToSnapshot( msg ); WriteBindToSnapshot( msg ); msg.WriteByte( currentLevel ); msg.WriteLong( PackColor( baseColor ) ); // msg.WriteBits( lightParent.GetEntityNum(), GENTITYNUM_BITS ); /* // only helps prediction msg.WriteLong( PackColor( fadeFrom ) ); msg.WriteLong( PackColor( fadeTo ) ); msg.WriteLong( fadeStart ); msg.WriteLong( fadeEnd ); */ // FIXME: send renderLight.shader msg.WriteFloat( renderLight.lightRadius[0], 5, 10 ); msg.WriteFloat( renderLight.lightRadius[1], 5, 10 ); msg.WriteFloat( renderLight.lightRadius[2], 5, 10 ); msg.WriteLong( PackColor( idVec4( renderLight.shaderParms[SHADERPARM_RED], renderLight.shaderParms[SHADERPARM_GREEN], renderLight.shaderParms[SHADERPARM_BLUE], renderLight.shaderParms[SHADERPARM_ALPHA] ) ) ); msg.WriteFloat( renderLight.shaderParms[SHADERPARM_TIMESCALE], 5, 10 ); msg.WriteLong( renderLight.shaderParms[SHADERPARM_TIMEOFFSET] ); //msg.WriteByte( renderLight.shaderParms[SHADERPARM_DIVERSITY] ); msg.WriteShort( renderLight.shaderParms[SHADERPARM_MODE] ); WriteColorToSnapshot( msg ); }
/* ================= idEntityFx::WriteToSnapshot ================= */ void idEntityFx::WriteToSnapshot( idBitMsgDelta &msg ) const { GetPhysics()->WriteToSnapshot( msg ); WriteBindToSnapshot( msg ); msg.WriteLong( ( fxEffect != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_FX, fxEffect->Index() ) : -1 ); msg.WriteLong( started ); }
//-------------------------------- // hhProxDoorTranslator::WriteToSnapshot //-------------------------------- void hhProxDoorTranslator::WriteToSnapshot( idBitMsgDelta &msg ) const { //hhProxDoorSection::WriteToSnapshot(msg); #ifdef _SYNC_PROXDOORS msg.WriteFloat(baseOrigin.x); msg.WriteFloat(baseOrigin.y); msg.WriteFloat(baseOrigin.z); msg.WriteFloat(targetOrigin.x); msg.WriteFloat(targetOrigin.y); msg.WriteFloat(targetOrigin.z); if (GetPhysics()->IsType(idPhysics_Static::Type)) { idPhysics_Static *phys = static_cast<idPhysics_Static *>(GetPhysics()); staticPState_t *state = phys->GetPState(); idCQuat q = state->axis.ToCQuat(); msg.WriteFloat(q.x); msg.WriteFloat(q.y); msg.WriteFloat(q.z); } msg.WriteFloat(proximity); #else WriteBindToSnapshot(msg); msg.WriteBits(proxyParent.GetSpawnId(), 32); #endif }
void hhProxDoor::WriteToSnapshot( idBitMsgDelta &msg ) const { WriteBindToSnapshot(msg); GetPhysics()->WriteToSnapshot(msg); msg.WriteBits(doorPieces.Num(), 8); for (int i = 0; i < doorPieces.Num(); i++) { msg.WriteBits(doorPieces[i].GetSpawnId(), 32); } msg.WriteBits(proxState, 8); msg.WriteFloat(lastAmount); msg.WriteBits(aas_area_closed, 1); //don't need this, predicting door movement. //msg.WriteBits(doorSndState, 8); }
/* ================= rvEffect::WriteToSnapshot ================= */ void rvEffect::WriteToSnapshot( idBitMsgDelta &msg ) const { GetPhysics()->WriteToSnapshot( msg ); WriteBindToSnapshot( msg ); idGameLocal::WriteDecl( msg, effect ); msg.WriteBits( loop, 1 ); }
void hhProxDoorSection::WriteToSnapshot( idBitMsgDelta &msg ) const { WriteBindToSnapshot(msg); GetPhysics()->WriteToSnapshot(msg); }