示例#1
0
 public DamageParticle(Interfaces.WorldPosition Position, string Text, Color Colour, float TTL)
 {
     this.Position    = Position;
     this.Text        = Text;
     this.Colour      = Colour;
     this.TTL         = TTL;
     this.DisplayName = " "; //lol
 }
示例#2
0
 public override void Update(float dT)
 {
     Interfaces.WorldPosition diff = Target.Position - Source.Position;
     // this.Offset =Source.Position;
     //this.l.Height = ((Vector3)diff).Length();
     this.l.Direction = diff * 2f;
     //this.Offset = diff * 0.5f;
     // this.TTL = 6;
     base.Update(dT);
     this.Position = Source.Position + diff * 0.5f;;
 }
示例#3
0
        private void DoSpawn()
        {
            MapEntity e = (MapEntity)Entity.Clone();
            float     X, Y, Z;

            X = (float)RNG.Next((int)(SpawningVolume.Min.X * 100), (int)(SpawningVolume.Max.X * 100)) / 100f;
            Y = (float)RNG.Next((int)(SpawningVolume.Min.Y * 100), (int)(SpawningVolume.Max.Y * 100)) / 100f;
            Z = (float)RNG.Next((int)(SpawningVolume.Min.Z * 100), (int)(SpawningVolume.Max.Z * 100)) / 100f;
            Interfaces.WorldPosition p = new Interfaces.WorldPosition();
            p           += new Vector3(X, Y, Z);
            e.Position   = p + this.Position;
            e.Heading    = RNG.Next(359);
            e.WorldSpawn = this.WorldSpawn;
            SpawnCallback?.Invoke(e);
            Count++;
        }
示例#4
0
文件: Homing.cs 项目: jesst3r/3DGame
        public virtual void StepToTarget(float dT)
        {
            Interfaces.WorldPosition diff = (this.Parent.Position + new Vector3(0, 1.2f, 0)) - this.Position;
            // diff.Y = 0;
            Vector3 v = diff;

            if (v.Length() < 0.5f)
            {
                this.Die();
                return;
            }
            v.Normalize();

            this.Heading   = (float)(Math.Atan2(v.X, v.Z) / MathHelper.Pi * -180f) + 90f;
            this.Position += v * this.Speed * dT;
        }
示例#5
0
        public override void StepToTarget(float dT)
        {
            Interfaces.WorldPosition diff = (this.Parent.Position + new Vector3(0, 1.2f, 0)) - this.Origin;
            // diff.Y = 0;
            Vector3 v = diff;

            if (v.Length() < 0.5f)
            {
                this.Die();
                return;
            }
            v.Normalize();
            Vector3 s = new Vector3(0f, 0, 0.5f);

            this.Heading = (float)(Math.Atan2(v.X, v.Z) / MathHelper.Pi * -180f) + 90f;
            Matrix spinm = Matrix.CreateRotationX((float)SpinTimer * 3f);
            Matrix head  = Matrix.CreateRotationY(MathHelper.ToRadians(-this.Heading + 0));

            s = Vector3.Transform(s, spinm * head);

            this.Origin  += v * this.Speed * dT;
            this.Position = this.Origin + s;
        }
示例#6
0
文件: Actor.cs 项目: jesst3r/3DGame
        public void StepToTarget(float dT)
        {
            Interfaces.WorldPosition diff = this.WalkTarget - this.Position;
            diff.Y = 0;
            Vector3 v = diff;

            if (v.Length() < 0.5f) //#0.5 is an epsilon here, #TODO change it
            {
                Walking = false;
                WalkCallback?.Invoke(this);
                WalkCallback = null;
                // Console.Write("Arrived at ^FFFF00 " + this.WalkTarget.ToString());
                return;
            }
            v.Normalize();

            this.Heading   = (float)(Math.Atan2(v.X, v.Z) / MathHelper.Pi * -180f) + 90f;
            this.Position += v * this.Speed * dT;
            if (!OnGround && Gravity)
            {
                this.Position.Y += this.VerticalSpeed * dT;
            }
        }
示例#7
0
文件: Actor.cs 项目: jesst3r/3DGame
 public void WalkTo(Interfaces.WorldPosition Target)
 {
     // Console.Write("^FFFFFF Walking to ^FFFF00 " + Target.ToString());
     this.WalkTarget = Target;
     this.Walking    = true;
 }