Package com.threed.jpct

Examples of com.threed.jpct.SimpleVector


  private boolean checkVisible(Planet planet) {
    // TODO: Can be simply optimized by determination of a direction vector
    // that goes from center of the camera to center of the planet.
    // Next, this vector should be passed to pickPoligon method instead of
    // return value from reproject2D3D.
    SimpleVector planetProjection = Interact2D.projectCenter3D2D(
        world.getCamera(), buffer, planet.getBoundingSphere());

    if (planetProjection != null) {
      if (planet.getBoundingSphere().getID() == Interact2D.getObjectID(Interact2D.pickPolygon(
          world.getVisibilityList(), Interact2D.reproject2D3D(world.getCamera(), buffer,(int) planetProjection.x, (int) planetProjection.y))))
View Full Code Here


    }
    return false;
  }
 
  private void checkSelectionAndFocus(List<Planet> planets){
    SimpleVector mouse3DPos = Interact2D.reproject2D3D(world.getCamera(), buffer, Mouse.getX(), Mouse.getY());
    mouse3DPos.y = -mouse3DPos.y;
    int focusedObjectID = Interact2D.getObjectID(Interact2D.pickPolygon(world.getVisibilityList(), mouse3DPos));
    if(focusedObjectID != -1){
      if(focusedPlanet == null || focusedObjectID != focusedPlanet.getBoundingSphere().getID()){
        for(Planet planet : planets){
View Full Code Here

    if(srcPlanet != null && destPlanet != null)
      universe.onDragBetweenPlanets(srcPlanet, destPlanet);
  }
 
  private int getFocusedObjectId(){
    SimpleVector mouse3DPos = Interact2D.reproject2D3D(world.getCamera(), buffer, Mouse.getX(), Mouse.getY());
    mouse3DPos.y = -mouse3DPos.y;
    return Interact2D.getObjectID(Interact2D.pickPolygon(world.getVisibilityList(), mouse3DPos));
  }
View Full Code Here

    Universe universe = new Universe();
    List<Planet> planets = new ArrayList<Planet>();

    for (int i = 0; i < numberOfPlanets; i++) {
      Planet planet = new Planet();
      planet.setPosition(new SimpleVector(random(minDistance, maxDistance, true), random(minDistance, maxDistance, true), random(minDistance, maxDistance, true)));
      planet.setRadius(random(minRadius, maxRadius, false));
      planet.setPoints((int) random(minPoints, maxPoints, false));
      planet.setOwner(Ownership.NEUTRAL);

      if (planetColides(planet, planets)) {
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.