Package soc.qase.state

Examples of soc.qase.state.Angles


    if((bitmask & 0x0040) != 0) {
      x = Utils.shortValue(data, offset);
      y = Utils.shortValue(data, offset + 2);
      z = Utils.shortValue(data, offset + 4);
      offset = offset + 6;
      player.setDeltaAngles(new Angles((float)(180.0 / 32768.0 * x), (float)(180.0 / 32768.0 * y), (float)(180.0 / 32768.0 * z)));
    }
    if((bitmask & 0x0080) != 0) {
      x = (int)data[offset];
      y = (int)data[offset + 1];
      z = (int)data[offset + 2];
      if(x < 0) x = x + 256;
      if(y < 0) y = y + 256;
      if(z < 0) z = z + 256;
      offset = offset + 3;
      player.setViewOffset(new Origin(x, y, z));
    }
    if((bitmask & 0x0100) != 0) {
      x = Utils.shortValue(data, offset);
      y = Utils.shortValue(data, offset + 2);
      z = Utils.shortValue(data, offset + 4);
      offset = offset + 6;
      player.setViewAngles(new Angles((float)(180.0 / 32768.0 * x), (float)(180.0 / 32768.0 * y), (float)(180.0 / 32768.0 * z)));
    }
    if((bitmask & 0x0200) != 0) {
      x = (int)data[offset];
      y = (int)data[offset + 1];
      z = (int)data[offset + 2];
      if(x < 0) x = x + 256;
      if(y < 0) y = y + 256;
      if(z < 0) z = z + 256;
      offset = offset + 3;
      player.setKickAngles(new Angles(x, y, z));
    }
  }
View Full Code Here


      z = (int)data[offset + 2];
      if(x < 0) x = x + 256;
      if(y < 0) y = y + 256;
      if(z < 0) z = z + 256;
      offset = offset + 3;
      player.setGunAngles(new Angles(x, y, z));
    }
  }
View Full Code Here

      if(angle < 0) angle = angle + 256;
      roll = (int)(PI / 128.0 * (float)angle);
      offset = offset + 1;
    }
//    else result.setRoll(0);
    return (offset > prevOff ? new Angles(pitch, yaw, roll) : null);
  }
View Full Code Here

/*-------------------------------------------------------------------*/
/*-------------------------------------------------------------------*/
  private Angles processAngles()
  {
    Angles result = null;
    int angle = 0;

    result = new Angles();

    // process angles
    if((bitmask & 0x00000400) != 0) {
      angle = (int)data[offset];
      if(angle < 0) angle = angle + 256;
      result.setPitch((int)(PI / 128.0 * (float)angle));
      offset = offset + 1;
    }
    else result.setPitch(0);
    if((bitmask & 0x00000004) != 0) {
      angle = (int)data[offset];
      if(angle < 0) angle = angle + 256;
      result.setYaw((int)(PI / 128.0 * (float)angle));
      offset = offset + 1;
    }
    else result.setYaw(0);
    if((bitmask & 0x00000008) != 0) {
      angle = (int)data[offset];
      if(angle < 0) angle = angle + 256;
      result.setRoll((int)(PI / 128.0 * (float)angle));
      offset = offset + 1;
    }
    else result.setRoll(0);
    return result;
  }
View Full Code Here

      {
        StringTokenizer st2 = new StringTokenizer(value, " ");
        origin = new Origin(Integer.parseInt(st2.nextToken()), Integer.parseInt(st2.nextToken()), Integer.parseInt(st2.nextToken()));
      }
      else if(key.equals("angle"))
        angles = new Angles(0, Integer.parseInt(value), 0);
      else if(key.equals("light"))
        brightness = Integer.parseInt(value);
      else if(key.equals("spawnflags"))
        spawnflags = Integer.parseInt(value);
      else if(key.equals("target"))
View Full Code Here

/**  Initialise the agent in preparation for a game session. */
/*-------------------------------------------------------------------*/
  private void init()
  {
    // movement wrappers
    angles = new Angles(0, 0, 0);
    velocity = new Velocity(0, 0, 0);
    action = new Action(false, false, false);
    currentMove = new Move(angles, velocity, action, 0);
    previousMove = new Move(angles, velocity, action, 0);
    lastMove = new Move(angles, velocity, action, 0);
View Full Code Here

TOP

Related Classes of soc.qase.state.Angles

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.