|
![]() |
#3 |
Местный
|
![]()
/* WayPoint - Decompiled by JODE
* Visit http://jode.sourceforge.net/ */ package com.maddox.il2.ai; import com.maddox.JGP.Point3d; import com.maddox.JGP.Point3f; import com.maddox.JGP.Vector3f; import com.maddox.il2.engine.Actor; import com.maddox.il2.objects.bridges.Bridge; public class WayPoint { public static final int NORMFLY = 0; public static final int TAKEOFF = 1; public static final int LANDING = 2; public static final int GATTACK = 3; private Point3d p; public float Speed; public int Action; public int timeout; private boolean bHadTarget; protected String sTarget; protected Actor target; protected boolean bTargetFinished; protected boolean bRadioSilence; private static Vector3f V1 = new Vector3f(); public WayPoint() { p = new Point3d(); bHadTarget = false; bTargetFinished = false; bRadioSilence = false; } public WayPoint(Point3f point3f) { this(point3f.x, point3f.y, point3f.z); } public WayPoint(Point3d point3d) { this((float) point3d.x, (float) point3d.y, (float) point3d.z); } public WayPoint(float f, float f_0_, float f_1_) { p = new Point3d(); bHadTarget = false; bTargetFinished = false; bRadioSilence = false; set(f, f_0_, f_1_, 83.0F); } public WayPoint(float f, float f_2_, float f_3_, float f_4_) { p = new Point3d(); bHadTarget = false; bTargetFinished = false; bRadioSilence = false; set(f, f_2_, f_3_, f_4_); } public float x() { return (float) p.x; } public float y() { return (float) p.y; } public float z() { return (float) p.z; } public void setTarget(String string) { if (string == null) bHadTarget = false; else bHadTarget = true; sTarget = string; target = null; } public boolean isTargetFinished() { getTarget(); return bTargetFinished; } public String getTargetName() { return sTarget; } public Actor getTarget() { if (sTarget != null) { Actor actor = Actor.getByName(sTarget); if (actor != null) { target = actor; sTarget = null; } } if (target == null || target != null && !target.isAlive()) { bTargetFinished = true; target = null; } if (!bHadTarget) bTargetFinished = false; return target; } public Actor getTargetActorRandom() { Actor actor = getTarget(); if (!Actor.isValid(actor) || !actor.isAlive()) return null; if (actor instanceof Chief || actor instanceof Bridge) { int i = actor.getOwnerAttachedCount(); if (i < 1) return null; for (int i_5_ = 0; i_5_ < i; i_5_++) { Actor actor_6_ = ((Actor) actor.getOwnerAttached(World.Rnd().nextInt(0, i - 1))); if (Actor.isValid(actor_6_) && actor_6_.isAlive()) return actor_6_; } for (int i_7_ = 0; i_7_ < i; i_7_++) { Actor actor_8_ = (Actor) actor.getOwnerAttached(i_7_); if (Actor.isValid(actor_8_) && actor_8_.isAlive()) return actor_8_; } return null; } return actor; } public void set(float f, float f_9_, float f_10_) { p.set((double) f, (double) f_9_, (double) f_10_); } public void set(Point3f point3f) { p.set(point3f); } public void set(Point3d point3d) { p.set(point3d); } public void set(float f, float f_11_, float f_12_, float f_13_) { p.set((double) f, (double) f_11_, (double) f_12_); Speed = f_13_; } public void set(float f) { Speed = f; } public void setTimeout(int i) { timeout = i; } public void set(WayPoint waypoint_14_) { set(waypoint_14_.getP()); set(waypoint_14_.getV()); sTarget = waypoint_14_.sTarget; target = waypoint_14_.target; Action = waypoint_14_.Action; timeout = waypoint_14_.timeout; bTargetFinished = waypoint_14_.bTargetFinished; bHadTarget = waypoint_14_.bHadTarget; bRadioSilence = waypoint_14_.bRadioSilence; } public Point3d getP() { return p; } public void getP(Point3f point3f) { point3f.set(p); } public void getP(Point3d point3d) { point3d.set(p); } public float getV() { return Speed; } public static Vector3f vector(WayPoint waypoint, WayPoint waypoint_15_) { V1.x = (float) (waypoint_15_.p.x - waypoint.p.x); V1.y = (float) (waypoint_15_.p.y - waypoint.p.y); V1.z = (float) (waypoint_15_.p.z - waypoint.p.z); return V1; } public boolean isRadioSilence() { return bRadioSilence; } } вот весь код поажите как? |
![]() |
![]() |
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1) | |
|
|