本文整理汇总了C#中VRage.ReadQuaternion方法的典型用法代码示例。如果您正苦于以下问题:C# VRage.ReadQuaternion方法的具体用法?C# VRage.ReadQuaternion怎么用?C# VRage.ReadQuaternion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VRage
的用法示例。
在下文中一共展示了VRage.ReadQuaternion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ClientRead
void ClientRead(VRage.Library.Collections.BitStream stream)
{
uint timeStamp = stream.ReadUInt32();
m_lastRecievedTimeStamp = timeStamp;
Vector3 serverLinearVelocity = stream.ReadVector3();
Vector3 serverAngularVelocity = stream.ReadVector3();
MyTimeStampValues? clientData = m_timestamp.GetTransform(timeStamp);
if (clientData.HasValue)
{
Vector3D linearDelta = serverLinearVelocity / MyEntityPhysicsStateGroup.EffectiveSimulationRatio - clientData.Value.LinearVelocity;
Entity.Physics.LinearVelocity += Vector3D.Round(linearDelta,2);
Vector3D angularDelta = serverAngularVelocity / MyEntityPhysicsStateGroup.EffectiveSimulationRatio - clientData.Value.AngularVelocity;
Entity.Physics.AngularVelocity += Vector3D.Round(angularDelta, 2);
m_timestamp.UpdateDeltaVelocities(timeStamp, ref linearDelta, ref angularDelta);
}
bool isUpdate = stream.ReadBool();
if (isUpdate)
{
MyTransformD serverTransform = new MyTransformD();
serverTransform.Position = stream.ReadVector3D();
serverTransform.Rotation = stream.ReadQuaternion();
serverTransform.Rotation = Quaternion.Identity;
CustomClientRead(timeStamp, ref serverTransform, stream);
}
}