Package com.l2client.component

Examples of com.l2client.component.PositioningComponent



  private void createNpc(NpcData e) {
   
    EntityManager em = Singleton.get().getEntityManager();
    PositioningComponent pos = new PositioningComponent();
    L2JComponent l2j = new L2JComponent();
    VisualComponent vis = new VisualComponent();
    EnvironmentComponent env = new EnvironmentComponent();
    //FIXME parallel create problems, synchronize creation and essential components or at least create/check of components
System.out.println("createNpc pre createEntity "+e.getObjectId());
View Full Code Here


  public void handlePacket() {
    log.fine("Read from Server "+this.getClass().getSimpleName());
    int objId = readD();
    int run = readD();
    readD();
    PositioningComponent com = (PositioningComponent) Singleton.get().getEntityManager().getComponent(objId, PositioningComponent.class);
    if(com != null){
      com.running = run>0?true:false;
      EnvironmentComponent env = (EnvironmentComponent) Singleton.get().getEntityManager().getComponent(objId, EnvironmentComponent.class);
      if(env != null){
        env.changed = true;
View Full Code Here

    TargetComponent tc = (TargetComponent) em.getComponent(pID, TargetComponent.class);
    if(tc != null){
      tc.setTarget(id);
      tc.color = toColorRGBA(color);
    }
    PositioningComponent pcpos = (PositioningComponent) em.getComponent(pID, PositioningComponent.class);
    PositioningComponent npcpos = (PositioningComponent) em.getComponent(id, PositioningComponent.class);
    if(pcpos != null && npcpos != null){
      pcpos.targetHeading = PositioningSystem.getHeading(pcpos.position, npcpos.position);
      //npcpos.targetHeading = PositioningSystem.getHeading(npcpos.position, pcpos.position);
System.out.println("MyTargetSelected: Set targetheading for "+pID+" to "+pcpos.targetHeading+" looking at "+id);     
    }
View Full Code Here

    log.fine("Read from Server "+this.getClass().getSimpleName());
    int whoAttacked = readD();
    log.finer("AUTOATTACK STARTED by+"+whoAttacked);
    //face at target
    EntityManager em = Singleton.get().getEntityManager();
    PositioningComponent pcpos = (PositioningComponent) em.getComponent(whoAttacked, PositioningComponent.class);
    TargetComponent tc = (TargetComponent) em.getComponent(whoAttacked, TargetComponent.class);
    PositioningComponent npcpos = null;
    if(tc!=null && tc.hasTarget()) {
      log.finer("AUTOATTACK STARTED by+"+whoAttacked+" target comp :"+tc.getCurrentTarget());
      npcpos = (PositioningComponent) em.getComponent(tc.getCurrentTarget(), PositioningComponent.class);

      if(pcpos != null && npcpos != null){
View Full Code Here

      EntityManager em = Singleton.get().getEntityManager();
      TargetComponent tc = (TargetComponent) em.getComponent(id, TargetComponent.class);
      if(tc != null){
        tc.setTarget(target);
      }
      PositioningComponent pcpos = (PositioningComponent) em.getComponent(target, PositioningComponent.class);
      PositioningComponent npcpos = (PositioningComponent) em.getComponent(id, PositioningComponent.class);
      if(pcpos != null && npcpos != null){
        //pcpos.targetHeading = PositioningSystem.getHeading(pcpos.position, npcpos.position);
        npcpos.targetHeading = PositioningSystem.getHeading(npcpos.position, pcpos.position);
System.out.println("TargetSelected: Set heading for "+id+" to "+npcpos.targetHeading+" looking at "+target);
      }
View Full Code Here

    int side = readD();
    //server always sends 0
    int speed = readD();
   
    log.fine("Received StartRotation for "+objId+" deg "+deg+" side "+side);
    PositioningComponent pos = (PositioningComponent) Singleton.get().getEntityManager().getComponent(objId, PositioningComponent.class);
    if(pos != null){
      pos.targetHeading = ServerValues.getClientHeading(deg);
System.out.println("StartRoatation: Set heading for "+objId+" to "+pos.targetHeading);     
    } else
      log.severe("No SimplePositioningComponent found for entity "+objId);
View Full Code Here

            } else {//FIXME click on anything, check nav, then send request
              // this is the one
              Vector3f location = res.getContactPoint();
              if(location != null){
                Path p = new Path();
                PositioningComponent pos = (PositioningComponent) sin.getEntityManager().getComponent(handler.getSelectedObjectId(), PositioningComponent.class);
                if(pos != null){
                  if(sin.getNavManager().buildNavigationPath(p, pos.position, location.clone())) {
                    log.fine("new loc:" + location
                        + " sent:"+ ServerValues.getServerCoordX(location.x)
                        + ","+ ServerValues.getServerCoordY(location.z)
View Full Code Here

    assertEquals(5, count);
   
    Singleton single = Singleton.get();
    single.init(null);
    PositioningSystem ps = Singleton.get().getPosSystem();
    PositioningComponent pos = new PositioningComponent();
    pos.position = new Vector3f(10,0,0);
    pos.startPos.set(pos.position);
    pos.goalPos = new Vector3f(0,0,0);
    pos.walkSpeed = 2f;
    pos.maxSpeed = pos.walkSpeed;
View Full Code Here

      log.info("No entities within "+IArea.TERRAIN_SIZE_HALF+" radius of "+m.getPosition().x+"/"+m.getPosition().z+", will position them on navmesh");

  }
 
  private void positionEntitiesOnMesh(ISpatialPointing[] ents, TiledNavMesh m) {
    PositioningComponent com = null;
    log.fine("Positioning Entities on Mesh after Load of NavMesh");
    for(int i=0;i <ents.length;i++){
      com = (PositioningComponent) ents[i];
      snapToGround(com);
    }
View Full Code Here

   */
  public void teleportToTestArea() {
    try{
      if(originalLocation == null){
        EntityData e = Singleton.get().getClientFacade().getCharHandler().getSelectedChar();
        PositioningComponent pos = (PositioningComponent) Singleton.get().getEntityManager().getComponent(e.getObjectId(), PositioningComponent.class);
        if(pos == null){
          System.out.println("Was looking for PositioningComponent but got none for Ent:"+e.getObjectId());
          Singleton.get().getEntityManager().dumpAllComponents();
        }
        originalLocation = pos.position.clone();
View Full Code Here

TOP

Related Classes of com.l2client.component.PositioningComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.