Package com.threed.jpct

Examples of com.threed.jpct.SimpleVector


    calculateSourceOrbit();
    calculateDestinationOrbit();
    distance = sourceOrbit.distance(destinationOrbit);
    calculateJumpDistance();
    shipObject.translate(sourceOrbit);
    currentPosition = new SimpleVector(sourceOrbit.x, sourceOrbit.y, sourceOrbit.z);
    world.addObject(shipObject);
    source.setPoints(source.getPoints() - cargo);
  }
View Full Code Here


    }
  }
 
  public void onRenderUpdate(World world, FrameBuffer buffer){
    if(true){
      SimpleVector labelHandlerProjection = Interact2D.projectCenter3D2D(world.getCamera(), buffer, labelHandler);
     
      if (labelHandlerProjection != null){
        String cargoString = Integer.toString(cargo);
        Dimension d = font.getStringBounds(cargoString);
        buffer.blit(cargoBackgroundTexture, 0, 0, (int) (labelHandlerProjection.x - d.getWidth() / 2) - 2,
View Full Code Here

      }
    }
  }
 
  private void calculateJumpDistance(){
    jumpDistance = new SimpleVector();
    jumpDistance.x = speed / distance * (destinationOrbit.x - sourceOrbit.x);
    jumpDistance.y = speed / distance * (destinationOrbit.y - sourceOrbit.y);
    jumpDistance.z = speed / distance * (destinationOrbit.z - sourceOrbit.z);
  }
View Full Code Here

    jumpDistance.y = speed / distance * (destinationOrbit.y - sourceOrbit.y);
    jumpDistance.z = speed / distance * (destinationOrbit.z - sourceOrbit.z);
  }
 
  private void calculateSourceOrbit(){
    sourceOrbit = new SimpleVector();
    sourceOrbit.x = source.getPosition().x + source.getRadius()/source.getPosition().distance(destination.getPosition())*(destination.getPosition().x - source.getPosition().x);
    sourceOrbit.y = source.getPosition().y + source.getRadius()/source.getPosition().distance(destination.getPosition())*(destination.getPosition().y - source.getPosition().y);
    sourceOrbit.z = source.getPosition().z + source.getRadius()/source.getPosition().distance(destination.getPosition())*(destination.getPosition().z - source.getPosition().z);
  }
View Full Code Here

    sourceOrbit.y = source.getPosition().y + source.getRadius()/source.getPosition().distance(destination.getPosition())*(destination.getPosition().y - source.getPosition().y);
    sourceOrbit.z = source.getPosition().z + source.getRadius()/source.getPosition().distance(destination.getPosition())*(destination.getPosition().z - source.getPosition().z);
  }
 
  private void calculateDestinationOrbit(){
    destinationOrbit = new SimpleVector();
    destinationOrbit.x = destination.getPosition().x - destination.getRadius()/source.getPosition().distance(destination.getPosition())*(destination.getPosition().x - source.getPosition().x);
    destinationOrbit.y = destination.getPosition().y - destination.getRadius()/source.getPosition().distance(destination.getPosition())*(destination.getPosition().y - source.getPosition().y);
    destinationOrbit.z = destination.getPosition().z - destination.getRadius()/source.getPosition().distance(destination.getPosition())*(destination.getPosition().z - source.getPosition().z);
  }
View Full Code Here

  public void setRadius(float r) {
    radius = r;
  }

  public void setPosition(float x, float y, float z) {
    position = new SimpleVector(x, y, z);
  }
View Full Code Here

  @Override
  public void onUpdate(World world, FrameBuffer buffer) {
    planetObject.setTexture(owner.toString());

    if (visible) {
      SimpleVector labelHandlerProjection = Interact2D.projectCenter3D2D(world.getCamera(), buffer, labelHandler);

      if (labelHandlerProjection != null) {
        String pointString = Integer.toString(points);
        Dimension d = font.getStringBounds(pointString);
        font.blitString(buffer, pointString, (int) labelHandlerProjection.x - d.width / 2, (int) labelHandlerProjection.y, 100, Color.WHITE);
View Full Code Here

  }
 
  private void setDistance(){
    cameraHandler.getTranslationMatrix().setIdentity();
    cameraHandler.translate(0, 0, distance);
    cameraHandler.setRotationPivot(new SimpleVector(0,0,-distance));
    camera.setPositionToCenter(cameraHandler);
    camera.lookAt(SimpleVector.ORIGIN);
  }
View Full Code Here

    setDefaultPosition();
    lookAtCenter();
  }
 
  private void lookAtCenter(){
    camera.lookAt(new SimpleVector(0,0,0));
  }
View Full Code Here

  private void setDefaultScene(){
    this.sceneObjects = new ArrayList<Object3D>();
  }
 
  private void setDefaultPosition(){
    camera.setPosition(new SimpleVector(0, 0, distance));
  }
View Full Code Here

TOP

Related Classes of com.threed.jpct.SimpleVector

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.