Package javara.world.logical

Examples of javara.world.logical.Incarnator


    rootNode.attachChild(player.getHector().getHectorNode());
    physicsSpace.add(player.getCharacterControl());
  }

  public void addIncarnator(Vector3f location, float angle, int order) {
    incarnators.add(new Incarnator(location, angle, order));
  }
View Full Code Here


  protected AssetManager assetManager;
  protected Quaternion headRot;
  protected Listener listener;

  public Player(World world, InputManager input, Camera cam, Listener listener, Hector hull) {
    Incarnator incarn = world.getIncarnator(0);
   
    this.listener = listener;
    this.world = world;
    assetManager = world.getAssetManager();
    inputManager = input;
    hector = hull;

    player = new CharacterControl(hector.getCollisionShape(), .1f);
    player.setJumpSpeed(PLAYER_JUMP_SPEED);
    player.setFallSpeed(PLAYER_FALL_SPEED);
    player.setGravity(PLAYER_GRAVITY);
    player.setCollisionGroup(PhysicsCollisionObject.COLLISION_GROUP_01);
    player.setUserObject(this);
    walkAngle = incarn.getStartAngle();

    hector.getHectorNode().addControl(player);

    camNode = new CameraNode("PlayerCam", cam);
    camNode.setControlDir(ControlDirection.SpatialToCamera);
    camNode.setLocalTranslation(Vector3f.ZERO);
    camNode.lookAt(Vector3f.UNIT_Z, Vector3f.UNIT_Y);
    hector.getHeadNode().attachChild(camNode);

    // aureus: temporary solution; scout should ultimately be a separate object
    scoutNode = new Node();
    scoutNode.setLocalTranslation(new Vector3f(0.0f, 3.0f, -10.0f));
    Matrix3f scoutMatrix = new Matrix3f();
    scoutMatrix.fromAngleAxis((float)Math.atan2(3.0f, 10.0f), Vector3f.UNIT_X);
    scoutNode.setLocalRotation(scoutMatrix);
    hector.getLegsNode().attachChild(scoutNode);

    player.setPhysicsLocation(incarn.getLocation());

    headRot = new Quaternion();
    setupKeys(input);
  }
View Full Code Here

TOP

Related Classes of javara.world.logical.Incarnator

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.