本文整理汇总了C++中idBitMsgDelta::WriteBits方法的典型用法代码示例。如果您正苦于以下问题:C++ idBitMsgDelta::WriteBits方法的具体用法?C++ idBitMsgDelta::WriteBits怎么用?C++ idBitMsgDelta::WriteBits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idBitMsgDelta
的用法示例。
在下文中一共展示了idBitMsgDelta::WriteBits方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteToSnapshot
//--------------------------------
// 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);
}
示例2: WriteToSnapshot
/*
================
rvPhysics_Particle::WriteToSnapshot
================
*/
void rvPhysics_Particle::WriteToSnapshot( idBitMsgDelta &msg ) const {
msg.WriteLong( current.atRest );
msg.WriteBits ( current.onGround, 1 );
msg.WriteFloat( current.origin[0] );
msg.WriteFloat( current.origin[1] );
msg.WriteFloat( current.origin[2] );
// msg.WriteFloat( current.velocity[0], PRT_VELOCITY_EXPONENT_BITS, PRT_VELOCITY_MANTISSA_BITS );
// msg.WriteFloat( current.velocity[1], PRT_VELOCITY_EXPONENT_BITS, PRT_VELOCITY_MANTISSA_BITS );
// msg.WriteFloat( current.velocity[2], PRT_VELOCITY_EXPONENT_BITS, PRT_VELOCITY_MANTISSA_BITS );
msg.WriteDeltaFloat( 0.0f, current.velocity[0] );
msg.WriteDeltaFloat( 0.0f, current.velocity[1] );
msg.WriteDeltaFloat( 0.0f, current.velocity[2] );
// msg.WriteDeltaFloat( 0.0f, current.pushVelocity[0], PRT_VELOCITY_EXPONENT_BITS, PRT_VELOCITY_MANTISSA_BITS );
// msg.WriteDeltaFloat( 0.0f, current.pushVelocity[1], PRT_VELOCITY_EXPONENT_BITS, PRT_VELOCITY_MANTISSA_BITS );
// msg.WriteDeltaFloat( 0.0f, current.pushVelocity[2], PRT_VELOCITY_EXPONENT_BITS, PRT_VELOCITY_MANTISSA_BITS );
msg.WriteDeltaFloat( 0.0f, current.pushVelocity[0] );
msg.WriteDeltaFloat( 0.0f, current.pushVelocity[1] );
msg.WriteDeltaFloat( 0.0f, current.pushVelocity[2] );
// TODO: Check that this conditional write to delta message is OK
if ( hasMaster ) {
idCQuat localQuat;
localQuat = current.localAxis.ToCQuat();
msg.WriteBits ( 1, 1 );
msg.WriteFloat( localQuat.x );
msg.WriteFloat( localQuat.y );
msg.WriteFloat( localQuat.z );
msg.WriteDeltaFloat( current.origin[0], current.localOrigin[0] );
msg.WriteDeltaFloat( current.origin[1], current.localOrigin[1] );
msg.WriteDeltaFloat( current.origin[2], current.localOrigin[2] );
} else {
msg.WriteBits ( 0, 1 );
}
}
示例3: WriteToSnapshot
/*
=================
hhProjectileCrawlerGrenade::WriteToSnapshot
=================
*/
void hhProjectileCrawlerGrenade::WriteToSnapshot( idBitMsgDelta &msg ) const
{
msg.WriteBits(modelProxyCopyDone, 1);
msg.WriteBits(modelProxy.GetSpawnId(), 32);
hhProjectile::WriteToSnapshot(msg);
}
示例4: WriteToSnapshot
void hhShuttleForceField::WriteToSnapshot( idBitMsgDelta &msg ) const {
msg.WriteBits(GetPhysics()->GetContents(), 32);
msg.WriteBits(nextCollideFxTime, 32);
msg.WriteBits(fieldState, 8);
msg.WriteFloat(fade.GetStartTime());
msg.WriteFloat(fade.GetDuration());
msg.WriteFloat(fade.GetStartValue());
msg.WriteFloat(fade.GetEndValue());
msg.WriteFloat(renderEntity.shaderParms[SHADERPARM_TIMEOFFSET]);
msg.WriteFloat(renderEntity.shaderParms[SHADERPARM_MODE]);
}
示例5: WriteToSnapshot
/*
================
idPhysics_Parametric::WriteToSnapshot
================
*/
void idPhysics_Parametric::WriteToSnapshot( idBitMsgDelta &msg ) const {
msg.WriteLong( current.time );
msg.WriteLong( current.atRest );
msg.WriteFloat( current.origin[0] );
msg.WriteFloat( current.origin[1] );
msg.WriteFloat( current.origin[2] );
msg.WriteFloat( current.angles[0] );
msg.WriteFloat( current.angles[1] );
msg.WriteFloat( current.angles[2] );
msg.WriteDeltaFloat( current.origin[0], current.localOrigin[0] );
msg.WriteDeltaFloat( current.origin[1], current.localOrigin[1] );
msg.WriteDeltaFloat( current.origin[2], current.localOrigin[2] );
msg.WriteDeltaFloat( current.angles[0], current.localAngles[0] );
msg.WriteDeltaFloat( current.angles[1], current.localAngles[1] );
msg.WriteDeltaFloat( current.angles[2], current.localAngles[2] );
msg.WriteBits( current.linearExtrapolation.GetExtrapolationType(), 8 );
msg.WriteDeltaFloat( 0.0f, current.linearExtrapolation.GetStartTime() );
msg.WriteDeltaFloat( 0.0f, current.linearExtrapolation.GetDuration() );
msg.WriteDeltaFloat( 0.0f, current.linearExtrapolation.GetStartValue()[0] );
msg.WriteDeltaFloat( 0.0f, current.linearExtrapolation.GetStartValue()[1] );
msg.WriteDeltaFloat( 0.0f, current.linearExtrapolation.GetStartValue()[2] );
msg.WriteDeltaFloat( 0.0f, current.linearExtrapolation.GetSpeed()[0] );
msg.WriteDeltaFloat( 0.0f, current.linearExtrapolation.GetSpeed()[1] );
msg.WriteDeltaFloat( 0.0f, current.linearExtrapolation.GetSpeed()[2] );
msg.WriteDeltaFloat( 0.0f, current.linearExtrapolation.GetBaseSpeed()[0] );
msg.WriteDeltaFloat( 0.0f, current.linearExtrapolation.GetBaseSpeed()[1] );
msg.WriteDeltaFloat( 0.0f, current.linearExtrapolation.GetBaseSpeed()[2] );
msg.WriteBits( current.angularExtrapolation.GetExtrapolationType(), 8 );
msg.WriteDeltaFloat( 0.0f, current.angularExtrapolation.GetStartTime() );
msg.WriteDeltaFloat( 0.0f, current.angularExtrapolation.GetDuration() );
msg.WriteDeltaFloat( 0.0f, current.angularExtrapolation.GetStartValue()[0] );
msg.WriteDeltaFloat( 0.0f, current.angularExtrapolation.GetStartValue()[1] );
msg.WriteDeltaFloat( 0.0f, current.angularExtrapolation.GetStartValue()[2] );
msg.WriteDeltaFloat( 0.0f, current.angularExtrapolation.GetSpeed()[0] );
msg.WriteDeltaFloat( 0.0f, current.angularExtrapolation.GetSpeed()[1] );
msg.WriteDeltaFloat( 0.0f, current.angularExtrapolation.GetSpeed()[2] );
msg.WriteDeltaFloat( 0.0f, current.angularExtrapolation.GetBaseSpeed()[0] );
msg.WriteDeltaFloat( 0.0f, current.angularExtrapolation.GetBaseSpeed()[1] );
msg.WriteDeltaFloat( 0.0f, current.angularExtrapolation.GetBaseSpeed()[2] );
msg.WriteDeltaFloat( 0.0f, current.linearInterpolation.GetStartTime() );
msg.WriteDeltaFloat( 0.0f, current.linearInterpolation.GetAcceleration() );
msg.WriteDeltaFloat( 0.0f, current.linearInterpolation.GetDeceleration() );
msg.WriteDeltaFloat( 0.0f, current.linearInterpolation.GetDuration() );
msg.WriteDeltaFloat( 0.0f, current.linearInterpolation.GetStartValue()[0] );
msg.WriteDeltaFloat( 0.0f, current.linearInterpolation.GetStartValue()[1] );
msg.WriteDeltaFloat( 0.0f, current.linearInterpolation.GetStartValue()[2] );
msg.WriteDeltaFloat( 0.0f, current.linearInterpolation.GetEndValue()[0] );
msg.WriteDeltaFloat( 0.0f, current.linearInterpolation.GetEndValue()[1] );
msg.WriteDeltaFloat( 0.0f, current.linearInterpolation.GetEndValue()[2] );
msg.WriteDeltaFloat( 0.0f, current.angularInterpolation.GetStartTime() );
msg.WriteDeltaFloat( 0.0f, current.angularInterpolation.GetAcceleration() );
msg.WriteDeltaFloat( 0.0f, current.angularInterpolation.GetDeceleration() );
msg.WriteDeltaFloat( 0.0f, current.angularInterpolation.GetDuration() );
msg.WriteDeltaFloat( 0.0f, current.angularInterpolation.GetStartValue()[0] );
msg.WriteDeltaFloat( 0.0f, current.angularInterpolation.GetStartValue()[1] );
msg.WriteDeltaFloat( 0.0f, current.angularInterpolation.GetStartValue()[2] );
msg.WriteDeltaFloat( 0.0f, current.angularInterpolation.GetEndValue()[0] );
msg.WriteDeltaFloat( 0.0f, current.angularInterpolation.GetEndValue()[1] );
msg.WriteDeltaFloat( 0.0f, current.angularInterpolation.GetEndValue()[2] );
}
示例6: WriteToSnapshot
void hhGuiHand::WriteToSnapshot( idBitMsgDelta &msg ) const
{
hhHand::WriteToSnapshot(msg);
msg.WriteBits(actionAnimDoneTime, 32);
}
示例7: WriteToSnapshot
/*
=================
rvEffect::WriteToSnapshot
=================
*/
void rvEffect::WriteToSnapshot( idBitMsgDelta &msg ) const {
GetPhysics()->WriteToSnapshot( msg );
WriteBindToSnapshot( msg );
idGameLocal::WriteDecl( msg, effect );
msg.WriteBits( loop, 1 );
}
示例8: WriteToSnapshot
/*
================
idMoveable::WriteToSnapshot
================
*/
void idExplodingBarrel::WriteToSnapshot( idBitMsgDelta &msg ) const {
idMoveable::WriteToSnapshot( msg );
msg.WriteBits( IsHidden(), 1 );
}
示例9: WriteToSnapshot
/*
================
idItem::WriteFromSnapshot
================
*/
void idItem::WriteToSnapshot(idBitMsgDelta &msg) const
{
msg.WriteBits(IsHidden(), 1);
}
示例10: WriteToSnapshot
void hhWallWalkable::WriteToSnapshot( idBitMsgDelta &msg ) const {
msg.WriteBits(wallwalkOn, 1);
msg.WriteBits(IsActive(TH_THINK), 1);
}
示例11: WriteToSnapshot
void hhControlHand::WriteToSnapshot( idBitMsgDelta &msg ) const {
msg.WriteBits(bProcessControls, 1);
msg.WriteBits(oldStatus, 32);
hhHand::WriteToSnapshot(msg);
}