本文整理汇总了C++中vec3f::ToAngles方法的典型用法代码示例。如果您正苦于以下问题:C++ vec3f::ToAngles方法的具体用法?C++ vec3f::ToAngles怎么用?C++ vec3f::ToAngles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vec3f
的用法示例。
在下文中一共展示了vec3f::ToAngles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Spawn
static void Spawn (CPlayerEntity *Player, vec3f Start, vec3f AimDir, int DamageMultiplier, int Speed)
{
vec3f dir = AimDir.ToAngles();
anglef angles = dir.ToVectors ();
CProx *Prox = QNewEntityOf CProx;
Prox->State.GetOrigin() = Start;
Prox->Velocity = (AimDir * Speed)
.MultiplyAngles (200 + crand() * 10.0f, angles.Up)
.MultiplyAngles (crand() * 10.0f, angles.Right);
Prox->State.GetAngles() = dir - vec3f(90, 0, 0);
Prox->PhysicsType = PHYSICS_BOUNCE;
Prox->GetSolid() = SOLID_BBOX;
Prox->State.GetEffects() |= FX_GRENADE;
Prox->GetClipmask() = CONTENTS_MASK_SHOT|CONTENTS_LAVA|CONTENTS_SLIME;
Prox->State.GetRenderEffects() |= RF_IR_VISIBLE;
Prox->GetMins().Set (-6, -6, -6);
Prox->GetMaxs().Set (6, 6, 6);
Prox->State.GetModelIndex() = ModelIndex ("models/weapons/g_prox/tris.md2");
Prox->SetOwner(Player);
Prox->Firer = Player;
Prox->Touchable = true;
Prox->ThinkType = PROXTHINK_EXPLODE;
Prox->Damage = PROX_DAMAGE * DamageMultiplier;
Prox->ClassName = "prox";
switch (DamageMultiplier)
{
case 1:
Prox->NextThink = Level.Frame + PROX_TIME_TO_LIVE;
break;
case 2:
Prox->NextThink = Level.Frame + 300;
break;
case 4:
Prox->NextThink = Level.Frame + 150;
break;
case 8:
Prox->NextThink = Level.Frame + 100;
break;
default:
Prox->NextThink = Level.Frame + PROX_TIME_TO_LIVE;
break;
}
Prox->Link ();
}