Beispiel #1
0
 public bool onRay(Creature creat, int porte)
 {
     Ray ray = new Ray(creat.gameobject.position, creat.lookat);
     if (Vector3.Distance(creat.gameobject.position, position) < porte)
     {
         foreach (BoundingSphere bs in objModel.hitspheres)
         {
             if (Convert.ToBoolean(bs.Intersects(ray))) { return true; };
         }
     }
     return false;
 }
Beispiel #2
0
        public bool OnView(Creature creat, int porte)
        {
            Plane view = new Plane(position, new Vector3(Convert.ToInt32(position.X + 90 * Math.Cos(MathHelper.ToRadians(-45))), Convert.ToInt32(position.Y), Convert.ToInt32(position.Z + 90 * Math.Cos(MathHelper.ToRadians(-45)))), new Vector3(Convert.ToInt32(position.X + 90 * Math.Cos(MathHelper.ToRadians(45))), Convert.ToInt32(position.Y), Convert.ToInt32(position.Z + 90 * Math.Cos(MathHelper.ToRadians(45)))));

            if (Vector3.Distance(creat.gameobject.position, position) < porte)
            {

                foreach (BoundingSphere bs in objModel.hitspheres)
                {
                    if (Convert.ToBoolean(bs.Intersects(view))) { return true; };
                }

            }
            return false;
        }
Beispiel #3
0
 public void isAttacked(Creature attaquant)
 {
 }
Beispiel #4
0
 public void Attack(Creature cible)
 {
 }