本文整理汇总了C++中MoveSpline::Finalized方法的典型用法代码示例。如果您正苦于以下问题:C++ MoveSpline::Finalized方法的具体用法?C++ MoveSpline::Finalized怎么用?C++ MoveSpline::Finalized使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MoveSpline
的用法示例。
在下文中一共展示了MoveSpline::Finalized方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
示例2: WriteFacingTargetPart
void PacketBuilder::WriteFacingTargetPart(MoveSpline const& moveSpline, ByteBuffer& data)
{
if (GetMonsterMoveType(moveSpline) == MonsterMoveFacingTarget && !moveSpline.Finalized())
{
ObjectGuid facingGuid = moveSpline.facing.target;
data.WriteGuidMask(facingGuid, 4, 7, 0, 5, 1, 2, 3, 6);
data.WriteGuidBytes(facingGuid, 4, 2, 0, 5, 6, 3, 1, 7);
}
}
示例3: WriteCreateBits
void PacketBuilder::WriteCreateBits(MoveSpline const& moveSpline, ByteBuffer& data)
{
if (!data.WriteBit(!moveSpline.Finalized()))
return;
data.WriteBit(moveSpline.splineflags & (MoveSplineFlag::Parabolic | MoveSplineFlag::Animation)); // hasSplineStartTime = packet.ReadBit();
data.WriteBit((moveSpline.splineflags & MoveSplineFlag::Parabolic) && moveSpline.effect_start_time < moveSpline.Duration());
data.WriteBit(0); // unk
data.WriteBits(moveSpline.getPath().size(), 25); // splineCount = packet.ReadBits("Spline Waypoints", 22, index);
data.WriteBits(uint8(moveSpline.spline.mode()), 2); // packet.ReadEnum<SplineMode>("Spline Mode", 2, index);
data.WriteBits(moveSpline.splineflags.raw(), 20); // packet.ReadEnum<SplineFlag434>("Spline flags", 20, index);
}
示例4: WriteCreateBits
void PacketBuilder::WriteCreateBits(MoveSpline const& moveSpline, ByteBuffer& data)
{
if (!data.WriteBit(!moveSpline.Finalized()))
return;
data.WriteBit(moveSpline.splineflags & (MoveSplineFlag::Parabolic | MoveSplineFlag::Animation));
data.WriteBit((moveSpline.splineflags & MoveSplineFlag::Parabolic) && moveSpline.effect_start_time < moveSpline.Duration());
data.WriteBit(0); // NYI Block
data.WriteBits(moveSpline.getPath().size(), 20);
data.WriteBits(moveSpline.spline.mode(), 2);
data.WriteBits(moveSpline.splineflags.raw(), 25);
}
示例5: WriteCreateGuid
void PacketBuilder::WriteCreateGuid(MoveSpline const& moveSpline, ByteBuffer& data)
{
if (!moveSpline.Finalized() && (moveSpline.splineflags & MoveSplineFlag::Mask_Final_Facing == MoveSplineFlag::Final_Target))
{
ObjectGuid facingGuid = moveSpline.facing.target;
uint8 bitOrder[8] = { 4, 7, 0, 5, 1, 2, 3, 6 };
data.WriteBitInOrder(facingGuid, bitOrder);
uint8 byteOrder[8] = { 4, 2, 0, 5, 6, 3, 1, 7 };
data.WriteBytesSeq(facingGuid, byteOrder);
}
}
示例6: 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());
}
示例7: WriteCreateData
void PacketBuilder::WriteCreateData(MoveSpline const& moveSpline, ByteBuffer& data, Unit* unit)
{
if (!moveSpline.Finalized())
{
MoveSplineFlag splineFlags = moveSpline.splineflags;
uint8 splineType = 0;
if (splineFlags.final_point)
splineType = 2;
else if (splineFlags.final_angle)
splineType = 4;
else if ((splineFlags & MoveSplineFlag::Mask_Final_Facing) == MoveSplineFlag::Final_Target)
splineType = MonsterMoveFacingTarget;
data << uint8(splineType);
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].z);
data << float(moveSpline.getPath()[i].x);
data << float(moveSpline.getPath()[i].y);
}
data << float(1.f); // splineInfo.duration_mod_next; added in 3.1
if (splineFlags.final_point)
data << moveSpline.facing.f.z << moveSpline.facing.f.y << moveSpline.facing.f.x;
if (splineFlags.final_angle)
data << moveSpline.facing.angle;
if ((splineFlags & MoveSplineFlag::Parabolic) && moveSpline.effect_start_time < moveSpline.Duration())
data << moveSpline.vertical_acceleration; // added in 3.1
if (splineFlags & (MoveSplineFlag::Parabolic | MoveSplineFlag::Animation))
data << moveSpline.effect_start_time; // added in 3.1
data << moveSpline.timePassed();
data << moveSpline.Duration();
}
data << uint32(moveSpline.GetId());
data << float(unit->GetPositionZ());
data << float(unit->GetPositionX());
data << float(unit->GetPositionY());
}
示例8: 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);
}
示例9: WriteCreateBits
void PacketBuilder::WriteCreateBits(MoveSpline const& moveSpline, ByteBuffer& data)
{
ASSERT(!moveSpline.Finalized());
MoveSplineFlag flags = moveSpline.splineflags;
data.WriteBit(true);
data.WriteBit(flags.parabolic || flags.animation);
data.WriteBits(uint8(moveSpline.spline.mode()), 2);
data.WriteBits(moveSpline.getPath().size(), 20);
data.WriteBits(flags.raw(), 25);
data.WriteBit(flags.parabolic);
data.WriteBit(false);
if (false)
{
data.WriteBits(0, 2);
data.WriteBits(0, 21);
}
}
示例10: WriteCreateBits
void PacketBuilder::WriteCreateBits(MoveSpline const& moveSpline, ByteBuffer& data)
{
if (!data.WriteBit(!moveSpline.Finalized()))
return;
data.WriteBit(moveSpline.splineflags & (MoveSplineFlag::Parabolic | MoveSplineFlag::Animation)); // hasSplineStartTime = packet.ReadBit();
data.WriteBits(uint8(moveSpline.spline.mode()), 2); // packet.ReadEnum<SplineMode>("Spline Mode", 2, index);
data.WriteBits(moveSpline.splineflags.raw(), 20); // packet.ReadEnum<SplineFlag434>("Spline flags", 20, index);
data.WriteBit(0); // unk
data.WriteBits(moveSpline.getPath().size(), 25); // splineCount = packet.ReadBits("Spline Waypoints", 22, index);
data.WriteBit((moveSpline.splineflags & MoveSplineFlag::Parabolic) && moveSpline.effect_start_time < moveSpline.Duration());
/*switch (moveSpline.splineflags & MoveSplineFlag::Mask_Final_Facing)
{
case MoveSplineFlag::Final_Target:
{
ObjectGuid targetGuid = moveSpline.facing.target;
data.WriteBits(0, 2);
data.WriteBit(targetGuid[4]);
data.WriteBit(targetGuid[5]);
data.WriteBit(targetGuid[0]);
data.WriteBit(targetGuid[7]);
data.WriteBit(targetGuid[1]);
data.WriteBit(targetGuid[3]);
data.WriteBit(targetGuid[2]);
data.WriteBit(targetGuid[6]);
break;
}
case MoveSplineFlag::Final_Angle:
data.WriteBits(3, 2);
break;
case MoveSplineFlag::Final_Point:
data.WriteBits(1, 2);
break;
default:
data.WriteBits(2, 2);
break;
}*/
}
示例11: WriteCreateBits
void PacketBuilder::WriteCreateBits(MoveSpline const& moveSpline, ByteBuffer& data)
{
if (!data.WriteBit(!moveSpline.Finalized()))
return;
data.WriteBits(uint8(moveSpline.spline.mode()), 2);
data.WriteBit(moveSpline.splineflags & (MoveSplineFlag::Parabolic | MoveSplineFlag::Animation));
data.WriteBits(moveSpline.getPath().size(), 22);
switch (moveSpline.splineflags & MoveSplineFlag::Mask_Final_Facing)
{
case MoveSplineFlag::Final_Target:
{
ObjectGuid targetGuid = moveSpline.facing.target;
data.WriteBits(2, 2);
data.WriteBit(targetGuid[4]);
data.WriteBit(targetGuid[3]);
data.WriteBit(targetGuid[7]);
data.WriteBit(targetGuid[2]);
data.WriteBit(targetGuid[6]);
data.WriteBit(targetGuid[1]);
data.WriteBit(targetGuid[0]);
data.WriteBit(targetGuid[5]);
break;
}
case MoveSplineFlag::Final_Angle:
data.WriteBits(0, 2);
break;
case MoveSplineFlag::Final_Point:
data.WriteBits(1, 2);
break;
default:
data.WriteBits(3, 2);
break;
}
data.WriteBit((moveSpline.splineflags & MoveSplineFlag::Parabolic) && moveSpline.effect_start_time < moveSpline.Duration());
data.WriteBits(moveSpline.splineflags.raw(), 25);
}
示例12: WriteCreateBits
void PacketBuilder::WriteCreateBits(const MoveSpline& move_spline, ByteBuffer& data)
{
if (!data.WriteBit(!move_spline.Finalized()))
return;
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();
data.WriteBits(uint8(move_spline.spline.mode()), 2);
data.WriteBit(hasSplineStartTime);
data.WriteBits(nodes, 22);
switch (move_spline.splineflags & MoveSplineFlag::Mask_Final_Facing)
{
case MoveSplineFlag::Final_Target:
{
data.WriteBits(2, 2);
data.WriteGuidMask<4, 3, 7, 2, 6, 1, 0, 5>(ObjectGuid(move_spline.facing.target));
break;
}
case MoveSplineFlag::Final_Angle:
data.WriteBits(0, 2);
break;
case MoveSplineFlag::Final_Point:
data.WriteBits(1, 2);
break;
default:
data.WriteBits(3, 2);
break;
}
data.WriteBit(hasSplineVerticalAcceleration);
data.WriteBits(move_spline.splineflags.raw(), 25);
}
示例13: WriteFacingTargetPart
void PacketBuilder::WriteFacingTargetPart(MoveSpline const& moveSpline, ByteBuffer& data)
{
if (GetMonsterMoveType(moveSpline) == MonsterMoveFacingTarget && !moveSpline.Finalized())
{
ObjectGuid facingGuid = moveSpline.facing.target;
data.WriteBit(facingGuid[4]);
data.WriteBit(facingGuid[7]);
data.WriteBit(facingGuid[0]);
data.WriteBit(facingGuid[5]);
data.WriteBit(facingGuid[1]);
data.WriteBit(facingGuid[2]);
data.WriteBit(facingGuid[3]);
data.WriteBit(facingGuid[6]);
data.WriteByteSeq(facingGuid[4]);
data.WriteByteSeq(facingGuid[2]);
data.WriteByteSeq(facingGuid[0]);
data.WriteByteSeq(facingGuid[5]);
data.WriteByteSeq(facingGuid[6]);
data.WriteByteSeq(facingGuid[3]);
data.WriteByteSeq(facingGuid[1]);
data.WriteByteSeq(facingGuid[7]);
}
}