当前位置: 首页>>代码示例>>C#>>正文


C# Quaternion.GetBytes方法代码示例

本文整理汇总了C#中Quaternion.GetBytes方法的典型用法代码示例。如果您正苦于以下问题:C# Quaternion.GetBytes方法的具体用法?C# Quaternion.GetBytes怎么用?C# Quaternion.GetBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Quaternion的用法示例。


在下文中一共展示了Quaternion.GetBytes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BuildObjectData

 public static byte[] BuildObjectData(Vector3 position, Quaternion rotation, Vector3 velocity,
     Vector3 acceleration, Vector3 angularVelocity)
 {
     byte[] objectData = new byte[60];
     int pos = 0;
     position.GetBytes().CopyTo(objectData, pos);
     pos += 12;
     velocity.GetBytes().CopyTo(objectData, pos);
     pos += 12;
     acceleration.GetBytes().CopyTo(objectData, pos);
     pos += 12;
     rotation.GetBytes().CopyTo(objectData, pos);
     pos += 12;
     angularVelocity.GetBytes().CopyTo(objectData, pos);
     return objectData;
 }
开发者ID:3di,项目名称:3di-viewer-rei-libs,代码行数:16,代码来源:SimulationObject.cs

示例2: SetRotation

        /// <summary>
        /// Change the Rotation of an object that is either a child or a whole linkset
        /// </summary>
        /// <param name="simulator">A reference to the <seealso cref="OpenMetaverse.Simulator"/> object where the object resides</param>
        /// <param name="localID">The objects ID which is local to the simulator the object is in</param>
        /// <param name="quat">The new scale of the object</param>
        /// <param name="childOnly">If true, will change rotation of this prim only, not entire linkset</param>
        public void SetRotation(Simulator simulator, uint localID, Quaternion quat, bool childOnly)
        {
            UpdateType type = UpdateType.Rotation;

            if (!childOnly)
                type |= UpdateType.Linked;

            MultipleObjectUpdatePacket multiObjectUpdate = new MultipleObjectUpdatePacket();
            multiObjectUpdate.AgentData.AgentID = Client.Self.AgentID;
            multiObjectUpdate.AgentData.SessionID = Client.Self.SessionID;

            multiObjectUpdate.ObjectData = new MultipleObjectUpdatePacket.ObjectDataBlock[1];

            multiObjectUpdate.ObjectData[0] = new MultipleObjectUpdatePacket.ObjectDataBlock();
            multiObjectUpdate.ObjectData[0].Type = (byte)type;
            multiObjectUpdate.ObjectData[0].ObjectLocalID = localID;
            multiObjectUpdate.ObjectData[0].Data = quat.GetBytes();

            Client.Network.SendPacket(multiObjectUpdate, simulator);
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:27,代码来源:ObjectManager.cs


注:本文中的Quaternion.GetBytes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。