本文整理汇总了C#中CryEngine.Vec3类的典型用法代码示例。如果您正苦于以下问题:C# Vec3类的具体用法?C# Vec3怎么用?C# Vec3使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Vec3类属于CryEngine命名空间,在下文中一共展示了Vec3类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Equals_EqualVec3Objects_True
public void Equals_EqualVec3Objects_True()
{
Vec3 v1 = new Vec3(1, 2, 3);
Vec3 v2 = new Vec3(1, 2, 3);
Assert.IsTrue(v1.Equals(v2));
}
示例2: OnFire
protected override void OnFire(Vec3 firePos)
{
var muzzleFlash = ParticleEffect.Get("weapon_fx.tank.tank125.muzzle_flash.muzzle_flash");
muzzleFlash.Spawn(firePos, Attachment.Rotation.Column1, 0.5f);
Owner.Physics.AddImpulse(-Attachment.Rotation.Column1 * impulseStrength);
}
示例3: Launch
public void Launch(Vec3 velocity)
{
ReceiveUpdates = true;
state = BoidState.Launched;
Physics.AddImpulse(velocity);
OnLaunched(velocity);
}
示例4: NetSpawn
public void NetSpawn(EntityId targetId, Vec3 pos)
{
var tank = Entity.Get<Tank>(targetId);
tank.Position = pos;
tank.OnRevive();
}
示例5: Vec3
public void Vec3()
{
Vec3 vec3 = UnusedMarker.Vec3;
Assert.True(UnusedMarker.IsUnused(vec3));
vec3 = new Vec3(0, 250, 3);
Assert.False(UnusedMarker.IsUnused(vec3));
}
示例6: OnRevive
public override void OnRevive(EntityId actorId, Vec3 pos, Vec3 rot, int teamId)
{
var player = Actor.Get<Player>(actorId);
if(player == null)
{
Debug.Log("[SinglePlayer.OnRevive] Failed to get the player. Check the log for errors.");
return;
}
}
示例7: OnCollision
protected override void OnCollision(EntityId targetEntityId, Vec3 hitPos, Vec3 dir, short materialId, Vec3 contactNormal)
{
if(Velocity.Length > VelocityToKill)
{
var particle = ParticleEffect.Get("explosions.barrel.explode");
particle.Spawn(hitPos);
Entity.Remove(Id);
}
}
示例8: OnCollision
protected override void OnCollision(EntityId targetEntityId, Vec3 hitPos, Vec3 dir, short materialId, Vec3 contactNormal)
{
// Hit something, reset last event time.
if(state == BoidState.Launched)
{
if(postFire == null)
postFire = new DelayedFunc(OnStoppedMoving, 4000);
else
postFire.Reset();
}
}
示例9: OnRevive
public override void OnRevive(EntityId actorId, Vec3 pos, Vec3 rot, int teamId)
{
var cameraProxy = Actor.Get(actorId) as PlayerCamera;
if(cameraProxy == null)
{
Debug.Log("[SinglePlayer.OnRevive] Failed to get the player proxy. Check the log for errors.");
return;
}
cameraProxy.Init();
}
示例10: OnCollision
protected override void OnCollision(EntityId targetEntityId, Vec3 hitPos, Vec3 dir, short materialId, Vec3 contactNormal)
{
if (!Destroyed && targetEntityId!=0)
{
var breakageParams = new BreakageParameters();
breakageParams.type = BreakageType.Destroy;
breakageParams.fParticleLifeTime = 7.0f;
breakageParams.bMaterialEffects = true;
breakageParams.nGenericCount = 0;
breakageParams.bForceEntity = false;
breakageParams.bOnlyHelperPieces = false;
breakageParams.fExplodeImpulse = 10.0f;
breakageParams.vHitImpulse = dir;
breakageParams.vHitPoint = hitPos;
Physics.Break(breakageParams);
SetSlotFlags(GetSlotFlags() | EntitySlotFlags.Render);
Destroyed = true;
}
}
示例11: SetRotationAA
public void SetRotationAA(float c, float s, Vec3 axis, Vec3 t = default(Vec3))
{
this = new Matrix34(Matrix33.CreateRotationAA(c, s, axis));
M03 = t.X; M13 = t.Y; M23 = t.Z;
}
示例12: OnCollision
/// <summary>
/// Sent on entity collision.
/// </summary>
protected virtual void OnCollision(ColliderInfo source, ColliderInfo target, Vec3 hitPos, Vec3 contactNormal, float penetration, float radius)
{
}
示例13: Scale
/// <summary>
/// apply scaling to matrix.
/// </summary>
/// <returns></returns>
void Scale(Vec3 s)
{
M00 *= s.X; M01 *= s.Y; M02 *= s.Z;
M10 *= s.X; M11 *= s.Y; M12 *= s.Z;
M20 *= s.X; M21 *= s.Y; M22 *= s.Z;
}
示例14: TransformVector
/// <summary>
/// transforms a vector. the translation is not beeing considered
/// </summary>
/// <param name="p"></param>
/// <returns></returns>
public Vec3 TransformVector(Vec3 p)
{
return new Vec3(M00 * p.X + M01 * p.Y + M02 * p.Z + M03, M10 * p.X + M11 * p.Y + M12 * p.Z + M13, M20 * p.X + M21 * p.Y + M22 * p.Z + M23);
}
示例15: QuatT
public QuatT(Vec3 t, Quat q)
{
Q = q;
T = t;
}