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


C++ MoveSpline::_Spline方法代码示例

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


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

示例1: WriteCatmullRomPath

 void PacketBuilder::WriteCatmullRomPath(const MoveSpline& move_spline, ByteBuffer& data)
 {
     const Spline<int32> spline = move_spline._Spline();
     uint32 count = spline.getPointCount() - 3;
     data << count;
     for (uint32 i = 0; i < count; ++i)
         data << CalcTransportOffset(move_spline, spline.getPoint(2 + i));
 }
开发者ID:Calixa,项目名称:murlocs_434,代码行数:8,代码来源:packet_builder.cpp

示例2: WriteCatmullRomCyclicPath

 void PacketBuilder::WriteCatmullRomCyclicPath(const MoveSpline& move_spline, ByteBuffer& data)
 {
     const Spline<int32> spline = move_spline._Spline();
     uint32 count = spline.getPointCount() - 3;
     data << uint32(count + 1);
     data << spline.getPoint(1); // fake point, client will erase it from the spline after first cycle done
     for (uint32 i = 0; i < count; ++i)
         data << CalcTransportOffset(move_spline, spline.getPoint(1 + i));
 }
开发者ID:Calixa,项目名称:murlocs_434,代码行数:9,代码来源:packet_builder.cpp

示例3: WriteLinearPath

    void PacketBuilder::WriteLinearPath(const MoveSpline& move_spline, ByteBuffer& data)
    {
        const Spline<int32> spline = move_spline._Spline();
        uint32 last_idx = spline.getPointCount() - 3;
        const Vector3 * real_path = &spline.getPoint(1);

        data << last_idx;
        data << CalcTransportOffset(move_spline, real_path[last_idx]);   // destination
        if (last_idx > 1)
        {
            Vector3 middle = (CalcTransportOffset(move_spline, real_path[0]) + CalcTransportOffset(move_spline, real_path[last_idx])) / 2.f;
            Vector3 offset;
            // first and last points already appended
            for (uint32 i = 1; i < last_idx; ++i)
            {
                offset = CalcTransportOffset(move_spline, middle) - CalcTransportOffset(move_spline, real_path[i]);
                data.appendPackXYZ(offset.x, offset.y, offset.z);
            }
        }
    }
开发者ID:Calixa,项目名称:murlocs_434,代码行数:20,代码来源:packet_builder.cpp


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