本文整理汇总了C#中Vector2F.Rotation方法的典型用法代码示例。如果您正苦于以下问题:C# Vector2F.Rotation方法的具体用法?C# Vector2F.Rotation怎么用?C# Vector2F.Rotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector2F
的用法示例。
在下文中一共展示了Vector2F.Rotation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
/// <summary>
/// Periodically call this method to make sure conversation progresses
/// </summary>
public void Update(int tickCounter)
{
if (endTick > 0 && currentLineNode == null)
PlayNextLine(false);
else
{
// rotate the primary speaker to face the secondary speaker
if (currentLineNode.Speaker1 != Speaker.Player && currentLineNode.Speaker2 != Speaker.None)
{
Mooege.Core.GS.Actors.Actor speaker1 = GetSpeaker(currentLineNode.Speaker1);
Mooege.Core.GS.Actors.Actor speaker2 = GetSpeaker(currentLineNode.Speaker2);
Vector3D translation = speaker2.Position - speaker1.Position;
Vector2F flatTranslation = new Vector2F(translation.X, translation.Y);
float facingAngle = flatTranslation.Rotation();
speaker1.SetFacingRotation(facingAngle);
player.World.BroadcastIfRevealed(new ACDTranslateFacingMessage
{
ActorId = speaker1.DynamicID,
Angle = facingAngle,
TurnImmediately = false
}, speaker1);
}
// start the next line if the playback has finished
if (tickCounter > endTick)
PlayNextLine(false);
}
}