本文整理汇总了C++中MoveSpline::FinalDestination方法的典型用法代码示例。如果您正苦于以下问题:C++ MoveSpline::FinalDestination方法的具体用法?C++ MoveSpline::FinalDestination怎么用?C++ MoveSpline::FinalDestination使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MoveSpline
的用法示例。
在下文中一共展示了MoveSpline::FinalDestination方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteCreate
void PacketBuilder::WriteCreate(const MoveSpline& move_spline, ByteBuffer& data)
{
// WriteClientStatus(mov,data);
// data.append<float>(&mov.m_float_values[SpeedWalk], SpeedMaxCount);
// if (mov.SplineEnabled())
{
MoveSplineFlag splineFlags = move_spline.splineflags;
data << splineFlags.raw();
if (splineFlags.final_angle)
{
data << move_spline.facing.angle;
}
else if (splineFlags.final_target)
{
data << move_spline.facing.target;
}
else if (splineFlags.final_point)
{
data << move_spline.facing.f.x << move_spline.facing.f.y << move_spline.facing.f.z;
}
data << move_spline.timePassed();
data << move_spline.Duration();
data << move_spline.GetId();
uint32 nodes = move_spline.getPath().size();
data << nodes;
data.append<Vector3>(&move_spline.getPath()[0], nodes);
data << (move_spline.isCyclic() ? Vector3::zero() : move_spline.FinalDestination());
}
}
示例2: WriteCreateData
void PacketBuilder::WriteCreateData(MoveSpline const& moveSpline, ByteBuffer& data)
{
if (!moveSpline.Finalized())
{
MoveSplineFlag splineFlags = moveSpline.splineflags;
if ((splineFlags & MoveSplineFlag::Parabolic) && moveSpline.effect_start_time < moveSpline.Duration())
data << moveSpline.vertical_acceleration; // added in 3.1
data << moveSpline.timePassed();
if (splineFlags.final_angle)
data << moveSpline.facing.angle;
else if (splineFlags.final_target)
{
ObjectGuid facingGuid = moveSpline.facing.target;
data.WriteByteSeq(facingGuid[5]);
data.WriteByteSeq(facingGuid[3]);
data.WriteByteSeq(facingGuid[7]);
data.WriteByteSeq(facingGuid[1]);
data.WriteByteSeq(facingGuid[6]);
data.WriteByteSeq(facingGuid[4]);
data.WriteByteSeq(facingGuid[2]);
data.WriteByteSeq(facingGuid[0]);
}
uint32 nodes = moveSpline.getPath().size();
for (uint32 i = 0; i < nodes; ++i)
{
data << float(moveSpline.getPath()[i].z);
data << float(moveSpline.getPath()[i].x);
data << float(moveSpline.getPath()[i].y);
}
if (splineFlags.final_point)
data << moveSpline.facing.f.x << moveSpline.facing.f.z << moveSpline.facing.f.y;
data << float(1.f); // splineInfo.duration_mod_next; added in 3.1
data << moveSpline.Duration();
if (splineFlags & (MoveSplineFlag::Parabolic | MoveSplineFlag::Animation))
data << moveSpline.effect_start_time; // added in 3.1
data << float(1.f); // splineInfo.duration_mod; added in 3.1
}
if (!moveSpline.isCyclic())
{
Vector3 dest = moveSpline.FinalDestination();
data << float(dest.z);
data << float(dest.x);
data << float(dest.y);
}
else
data << Vector3::zero();
data << moveSpline.GetId();
}
示例3: WriteData
void PacketBuilder::WriteData(const MoveSpline& move_spline, ByteBuffer& data)
{
MoveSplineFlag splineFlags = move_spline.splineflags;
uint32 nodes = move_spline.getPath().size();
data << move_spline.timePassed();
if (splineFlags.orientationFixed)
data << move_spline.facing.angle;
if (splineFlags.final_target)
{
uint64 Guid = move_spline.facing.target;
uint8 guidBytes[] = { 5, 3, 7, 1, 6, 4, 2, 0 };
data.WriteGuidBytes(Guid, guidBytes, 8, 0);
}
for (uint32 i = 0; i < nodes; i++)
{
data << move_spline.getPath()[0].z;
data << move_spline.getPath()[0].x;
data << move_spline.getPath()[0].y;
}
if(splineFlags.flying)
data << move_spline.facing.f.x << move_spline.facing.f.z << move_spline.facing.f.y;
data << float(1.f);
data << uint32(0);
data << move_spline.effect_start_time;
data << float(1.f);
data << move_spline.FinalDestination().z;
data << move_spline.FinalDestination().x;
data << move_spline.FinalDestination().y;
data << move_spline.GetId();
}
示例4: WriteCreateBytes
void PacketBuilder::WriteCreateBytes(const MoveSpline& move_spline, ByteBuffer& data)
{
if (!move_spline.Finalized())
{
MoveSplineFlag splineFlags = move_spline.splineflags;
uint32 nodes = move_spline.getPath().size();
bool hasSplineStartTime = move_spline.splineflags & (MoveSplineFlag::Trajectory | MoveSplineFlag::Animation);
bool hasSplineVerticalAcceleration = (move_spline.splineflags & MoveSplineFlag::Trajectory) && move_spline.effect_start_time < move_spline.Duration();
if (hasSplineVerticalAcceleration)
data << float(move_spline.vertical_acceleration); // added in 3.1
data << int32(move_spline.timePassed());
if (move_spline.splineflags & MoveSplineFlag::Final_Angle)
data << float(NormalizeOrientation(move_spline.facing.angle));
else if (move_spline.splineflags & MoveSplineFlag::Final_Target)
data.WriteGuidBytes<5, 3, 7, 1, 6, 4, 2, 0>(ObjectGuid(move_spline.facing.target));
for (uint32 i = 0; i < nodes; ++i)
{
data << float(move_spline.getPath()[i].z);
data << float(move_spline.getPath()[i].x);
data << float(move_spline.getPath()[i].y);
}
if (move_spline.splineflags & MoveSplineFlag::Final_Point)
data << float(move_spline.facing.f.x) << float(move_spline.facing.f.z) << float(move_spline.facing.f.y);
data << float(1.f);
data << int32(move_spline.Duration());
if (hasSplineStartTime)
data << int32(move_spline.effect_start_time); // added in 3.1
data << float(1.f);
}
if (!move_spline.isCyclic())
{
Vector3 dest = move_spline.FinalDestination();
data << float(dest.z);
data << float(dest.x);
data << float(dest.y);
}
else
data << Vector3::zero();
data << uint32(move_spline.GetId());
}
示例5: WriteCreateData
void PacketBuilder::WriteCreateData(MoveSpline const& moveSpline, ByteBuffer& data)
{
if (!moveSpline.Finalized())
{
MoveSplineFlag const& splineFlags = moveSpline.splineflags;
MonsterMoveType type = GetMonsterMoveType(moveSpline);
data << moveSpline.timePassed();
data << float(1.f); // splineInfo.duration_mod_next; added in 3.1
data << float(1.f); // splineInfo.duration_mod; added in 3.1
uint32 nodes = moveSpline.getPath().size();
for (uint32 i = 0; i < nodes; ++i)
{
data << float(moveSpline.getPath()[i].x);
data << float(moveSpline.getPath()[i].z);
data << float(moveSpline.getPath()[i].y);
}
if (splineFlags & (MoveSplineFlag::Parabolic | MoveSplineFlag::Animation))
data << moveSpline.effect_start_time; // added in 3.1
data << uint8(type);
if (type == MonsterMoveFacingAngle)
data << float(moveSpline.facing.angle);
if (type == MonsterMoveFacingPoint)
data << moveSpline.facing.f.x << moveSpline.facing.f.z << moveSpline.facing.f.y;
if ((splineFlags & MoveSplineFlag::Parabolic) && moveSpline.effect_start_time < moveSpline.Duration())
data << float(moveSpline.vertical_acceleration); // added in 3.1
// NYI block here
data << moveSpline.Duration();
}
Vector3 destination = moveSpline.isCyclic() ? Vector3::zero() : moveSpline.FinalDestination();
data << float(destination.x);
data << float(destination.z);
data << moveSpline.GetId();
data << float(destination.y);
}
示例6: WriteMonsterMove
void PacketBuilder::WriteMonsterMove(const MoveSpline& move_spline, WorldPacket& data, Unit* unit)
{
ObjectGuid guid = unit->GetGUID();
ObjectGuid transport = unit->GetTransGUID();
uint32 type;
data << float(0.f); // Most likely transport Y
data << uint32(getMSTime());
data << float(0.f); // Most likely transport Z
data << float(0.f); // Most likely transport X
if (!move_spline.isCyclic())
{
Vector3 dest = move_spline.FinalDestination();
data << float(dest.x);
data << float(dest.y);
data << float(dest.z);
}
else
data << Vector3::zero();
data.WriteBit(guid[3]);
data.WriteBit(!move_spline.splineflags.raw());
data.WriteBit(guid[6]);
data.WriteBit(1);
data.WriteBit(1);
switch (move_spline.splineflags & MoveSplineFlag::Mask_Final_Facing)
{
case MoveSplineFlag::Final_Target:
type = 3;
break;
case MoveSplineFlag::Final_Angle:
type = 4;
break;
case MoveSplineFlag::Final_Point:
type = 2;
break;
default:
type = 0;
break;
}
data.WriteBits(type, 3);
data.WriteBit(1);
data.WriteBit(guid[2]);
data.WriteBit(guid[7]);
data.WriteBit(guid[5]);
if (type == 3)
{
ObjectGuid targetGuid = move_spline.facing.target;
data.WriteBit(targetGuid[6]);
data.WriteBit(targetGuid[7]);
data.WriteBit(targetGuid[0]);
data.WriteBit(targetGuid[5]);
data.WriteBit(targetGuid[2]);
data.WriteBit(targetGuid[3]);
data.WriteBit(targetGuid[4]);
data.WriteBit(targetGuid[1]);
}
data.WriteBit(1);
data.WriteBit(guid[4]);
int32 splineWpCount = move_spline.splineflags & MoveSplineFlag::UncompressedPath ? 0 : move_spline.spline.getPointCount() - 3;
//int32 splineWpCount = move_spline.splineflags & MoveSplineFlag::UncompressedPath ? 1 : move_spline.spline.getPointCount() - 3;
data.WriteBits(splineWpCount, 22); // WP count
data.WriteBit(1);
data.WriteBit(0);
data.WriteBit(guid[0]);
data.WriteBit(transport[3]);
data.WriteBit(transport[6]);
data.WriteBit(transport[5]);
data.WriteBit(transport[0]);
data.WriteBit(transport[1]);
data.WriteBit(transport[2]);
data.WriteBit(transport[4]);
data.WriteBit(transport[7]);
data.WriteBit(1);
data.WriteBit(1); // Parabolic speed // esi+4Ch
data.WriteBit(1);
//data.WriteBits(!splineWpCount ? move_spline.spline.getPointCount() - 2 : 1, 20);
data.WriteBits(!splineWpCount ? move_spline.spline.getPointCount() - (move_spline.splineflags.cyclic ? 2 : 3) : 1, 20);
data.WriteBit(guid[1]);
data.WriteBit(0); // Send no block
data.WriteBit(0);
data.WriteBit(!move_spline.Duration());
data.FlushBits();
if (type == 3)
{
ObjectGuid targetGuid = move_spline.facing.target;
data.WriteByteSeq(targetGuid[5]);
//.........这里部分代码省略.........
示例7: WriteCreateData
void PacketBuilder::WriteCreateData(MoveSpline const& moveSpline, ByteBuffer& data, Unit* unit)
{
if (/*!moveSpline.Finalized()*/true)
{
MoveSplineFlag splineFlags = moveSpline.splineflags;
uint8 splineType = 0;
switch (splineFlags & MoveSplineFlag::Mask_Final_Facing)
{
case MoveSplineFlag::Final_Target:
splineType = MonsterMoveFacingTarget;
break;
case MoveSplineFlag::Final_Angle:
splineType = MonsterMoveFacingAngle;
break;
case MoveSplineFlag::Final_Point:
splineType = MonsterMoveFacingSpot;
break;
default:
splineType = MonsterMoveNormal;
break;
}
data << float(1.0f); // splineInfo.duration_mod_next; added in 3.1
uint32 nodes = moveSpline.getPath().size();
for (uint32 i = 0; i < nodes; ++i)
{
data << float(moveSpline.getPath()[i].z);
data << float(moveSpline.getPath()[i].y);
data << float(moveSpline.getPath()[i].x);
}
data << uint8(splineType);
data << float(1.0f); // splineInfo.duration_mod; added in 3.1
if (splineFlags.final_point)
data << moveSpline.facing.f.x << moveSpline.facing.f.y << moveSpline.facing.f.z;
if (splineFlags.parabolic)
data << moveSpline.vertical_acceleration; // added in 3.1
if (splineFlags.final_angle)
data << moveSpline.facing.angle;
data << moveSpline.Duration();
if (splineFlags.parabolic || splineFlags.animation)
data << moveSpline.effect_start_time; // added in 3.1
data << moveSpline.timePassed();
}
if (!moveSpline.isCyclic())
{
Vector3 dest = moveSpline.FinalDestination();
data << moveSpline.GetId();
data << float(dest.x);
data << float(dest.y);
data << float(dest.z);
}
else
{
data << moveSpline.GetId();
data << float(0.0f);
data << float(0.0f);
data << float(0.0f);
}
}