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; }
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; }
public void isAttacked(Creature attaquant) { }
public void Attack(Creature cible) { }