/*
================
idPhysics_StaticMulti::WriteToSnapshot
================
*/
void idPhysics_StaticMulti::WriteToSnapshot( idBitMsg& msg ) const
{
	int i;
	idCQuat quat, localQuat;
	
	msg.WriteByte( current.Num() );
	
	for( i = 0; i < current.Num(); i++ )
	{
		quat = current[i].axis.ToCQuat();
		localQuat = current[i].localAxis.ToCQuat();
		
		msg.WriteFloat( current[i].origin[0] );
		msg.WriteFloat( current[i].origin[1] );
		msg.WriteFloat( current[i].origin[2] );
		msg.WriteFloat( quat.x );
		msg.WriteFloat( quat.y );
		msg.WriteFloat( quat.z );
		msg.WriteDeltaFloat( current[i].origin[0], current[i].localOrigin[0] );
		msg.WriteDeltaFloat( current[i].origin[1], current[i].localOrigin[1] );
		msg.WriteDeltaFloat( current[i].origin[2], current[i].localOrigin[2] );
		msg.WriteDeltaFloat( quat.x, localQuat.x );
		msg.WriteDeltaFloat( quat.y, localQuat.y );
		msg.WriteDeltaFloat( quat.z, localQuat.z );
	}
}
예제 #2
0
/*
========================
idLobby::CreateUserUpdateMessage
========================
*/
void idLobby::CreateUserUpdateMessage( int userIndex, idBitMsg & msg ) {
	lobbyUser_t * user = GetLobbyUser( userIndex );

	if ( verify( user != NULL ) ) {
		msg.WriteByte( userIndex );
		user->WriteClientMutableData( msg );
	}
}
예제 #3
0
void rvPlayerStat::PackStats( idBitMsg& msg ) {
	for( int i = 0; i < MAX_WEAPONS; i++ ) {
		msg.WriteShort( weaponShots[ i ] );
	}

	for( int i = 0; i < MAX_WEAPONS; i++ ) {
		msg.WriteShort( weaponHits[ i ] );
	}


	for( int i = 0; i < IGA_NUM_AWARDS; i++ ) {
		msg.WriteByte( inGameAwards[ i ] );
	}

	msg.WriteByte( endGameAwards.Num() );
	for( int i = 0; i < endGameAwards.Num(); i++ ) {
		msg.WriteByte( endGameAwards[ i ] );
	}

	msg.WriteBits( idMath::ClampInt( 0, MP_PLAYER_MAXDEATHS, deaths ), ASYNC_PLAYER_DEATH_BITS );
	msg.WriteBits( idMath::ClampInt( 0, MP_PLAYER_MAXKILLS, kills ), ASYNC_PLAYER_KILL_BITS );
}