Package org.osm2world.core.math

Examples of org.osm2world.core.math.VectorXZ.invert()


        center = center.subtract(Y_UNIT.mult(0.5 * height));
       
        VectorXZ faceDirection = segment.getDirection();
        if (frontCenter.y < backCenter.y) {
          //invert if upwards
          faceDirection = faceDirection.invert();
        }
       
        target.drawBox(Materials.STEPS_DEFAULT,
            center, faceDirection,
            height, width, backCenter.distanceToXZ(frontCenter));
View Full Code Here


   
    VectorXZ inVector = line1.getDirection();
    VectorXZ outVector = line2.getDirection();

    if (!inbound1) { inVector = inVector.invert(); }
    if (inbound2) { outVector = outVector.invert(); }
   
    VectorXZ cutVector;
   
    if (inVector.equals(outVector)) { //TODO: allow for some small difference?
      cutVector = outVector.rightNormal();
View Full Code Here

   
    //make sure that cutVector points to the right, which is equivalent to:
    //y component of the cross product (inVector x cutVector) is positive.
    //If this isn't the case, invert the cut vector.
    if (inVector.z * cutVector.x - inVector.x * cutVector.z <= 0) {
      cutVector = cutVector.invert();
    }
   
    /* set calculated cut vector */
   
    if (inbound1) {
View Full Code Here

    /* set calculated cut vector */
   
    if (inbound1) {
      renderable1.setEndCutVector(cutVector);
    } else {
      renderable1.setStartCutVector(cutVector.invert());
    }
   
    if (inbound2) {
      renderable2.setEndCutVector(cutVector.invert());
    } else {
View Full Code Here

    } else {
      renderable1.setStartCutVector(cutVector.invert());
    }
   
    if (inbound2) {
      renderable2.setEndCutVector(cutVector.invert());
    } else {
      renderable2.setStartCutVector(cutVector);
    }
   
    /* perform calculations necessary for connectors
View Full Code Here

      NetworkWaySegmentWorldObject inRenderable =
        ((NetworkWaySegmentWorldObject)in.getPrimaryRepresentation());
     
      VectorXZ cutVector = in.getRightNormal();
      inRenderable.setEndCutVector(cutVector);
      cutVectors.add(cutVector.invert());
     
      coords.add(in.getEndNode().getPos());
      widths.add(inRenderable.getWidth());
     
    }
View Full Code Here

       
        if (inboundLines.contains(l1)) {
          d1 = d1.invert();
        }
        if (inboundLines.contains(l2)) {
          d2 = d2.invert();
        }
       
        //check whether the lines are in the first or second 180°
        //(the dot product formula will not be useful to distinguish
        //these cases - it only provides cos 0° to cos 180° - ,
View Full Code Here

      VectorXZ ortho = direction.rightNormal();

      // TODO: if we can switch off backface culling we'd only need one face here
      VectorXZ[][] draw = new VectorXZ[][] {
          getPoleCoordinates(node.getPos().add(direction.mult(-half)), ortho, width, half),
          getPoleCoordinates(node.getPos().add(direction.mult(-half)), ortho.invert(), width, half),
          getPoleCoordinates(node.getPos().add(direction.mult(half)), ortho.invert(), width, half),
          getPoleCoordinates(node.getPos().add(direction.mult(half)), ortho, width, half)
      };

      for (int i = 0; i < 4; i++) {
View Full Code Here

      // TODO: if we can switch off backface culling we'd only need one face here
      VectorXZ[][] draw = new VectorXZ[][] {
          getPoleCoordinates(node.getPos().add(direction.mult(-half)), ortho, width, half),
          getPoleCoordinates(node.getPos().add(direction.mult(-half)), ortho.invert(), width, half),
          getPoleCoordinates(node.getPos().add(direction.mult(half)), ortho.invert(), width, half),
          getPoleCoordinates(node.getPos().add(direction.mult(half)), ortho, width, half)
      };

      for (int i = 0; i < 4; i++) {
        drawHorizontalSegment(target, draw[i][0], draw[i][1], elevation, 0.1, diameter/2);
View Full Code Here

      lowerLeft = lowerCenter.subtract(toRight);
      lowerRight = lowerCenter.add(toRight);
     
      VectorXZ toBack = tunnelContent.segment.getDirection().mult(0.1);
      if (tunnelContent.segment.getEndNode() == node) {
        toBack = toBack.invert();
      }
     
      upperLeft = lowerLeft.add(toBack);
      upperCenter = lowerCenter.add(toBack);
      upperRight = lowerRight.add(toBack);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.