本文整理汇总了C#中wServer.realm.Entity.TryGetHistory方法的典型用法代码示例。如果您正苦于以下问题:C# Entity.TryGetHistory方法的具体用法?C# Entity.TryGetHistory怎么用?C# Entity.TryGetHistory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wServer.realm.Entity
的用法示例。
在下文中一共展示了Entity.TryGetHistory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Predict
private static double Predict(Entity host, Entity target, ProjectileDesc desc)
{
Position? history = target.TryGetHistory(100);
if (history == null)
return 0;
double originalAngle = Math.Atan2(history.Value.Y - host.Y, history.Value.X - host.X);
double newAngle = Math.Atan2(target.Y - host.Y, target.X - host.X);
float bulletSpeed = desc.Speed / 100;
double angularVelo = (newAngle - originalAngle) / (100 / 1000f);
return angularVelo * bulletSpeed;
}
示例2: Predict
private double Predict(Entity entity, ProjectileDesc desc)
{
var history = entity.TryGetHistory(100);
if (history == null)
return 0;
var originalAngle = Math.Atan2(history.Value.Y - Host.Self.Y, history.Value.X - Host.Self.X);
var newAngle = Math.Atan2(entity.Y - Host.Self.Y, entity.X - Host.Self.X);
var bulletSpeed = desc.Speed / 100f;
var dist = Dist(entity, Host.Self);
var angularVelo = (newAngle - originalAngle) / (100 / 1000f);
return angularVelo * bulletSpeed;
}
示例3: Predict
static double Predict(Entity host, Entity target, ProjectileDesc desc)
{
Position? history = target.TryGetHistory(100);
if (history == null)
return 0;
var originalAngle = Math.Atan2(history.Value.Y - host.Y, history.Value.X - host.X);
var newAngle = Math.Atan2(target.Y - host.Y, target.X - host.X);
var bulletSpeed = desc.Speed / 100f;
var dist = BehaviorUtils.Dist(target, host);
var angularVelo = (newAngle - originalAngle) / (100 / 1000f);
return angularVelo * bulletSpeed;
}