Package org.jwildfire.create.eden.primitive

Examples of org.jwildfire.create.eden.primitive.Point


      }
    }
  }

  private void writeTransform(StringBuffer pSB, Primitive pPrimitive) {
    Point position = pPrimitive.getPosition();
    Point rotate = pPrimitive.getRotate();
    Point size = pPrimitive.getSize();
    if (Math.abs(position.getX()) > MathLib.EPSILON || Math.abs(position.getY()) > MathLib.EPSILON || Math.abs(position.getZ()) > MathLib.EPSILON ||
        Math.abs(rotate.getX()) > MathLib.EPSILON || Math.abs(rotate.getY()) > MathLib.EPSILON || Math.abs(rotate.getZ()) > MathLib.EPSILON ||
        Math.abs(size.getX() - 1.0) > MathLib.EPSILON || Math.abs(size.getY() - 1.0) > MathLib.EPSILON || Math.abs(size.getZ() - 1.0) > MathLib.EPSILON) {
      pSB.append("  transform {\n");
      if (Math.abs(rotate.getX()) > MathLib.EPSILON) {
        pSB.append("    rotatex " + pPrimitive.getRotate().getX() + "\n");
      }
      if (Math.abs(rotate.getY()) > MathLib.EPSILON) {
        pSB.append("    rotatez " + (-pPrimitive.getRotate().getY()) + "\n");
      }
      if (Math.abs(rotate.getZ()) > MathLib.EPSILON) {
        pSB.append("    rotatey " + (-pPrimitive.getRotate().getZ()) + "\n");
      }
      if (Math.abs(size.getX() - 1.0) > MathLib.EPSILON || Math.abs(size.getY() - 1.0) > MathLib.EPSILON || Math.abs(size.getZ() - 1.0) > MathLib.EPSILON) {
        pSB.append("    scale " + pPrimitive.getSize().getX() + " " + pPrimitive.getSize().getZ() + " " + pPrimitive.getSize().getY() + "\n");
      }
      if (Math.abs(position.getX()) > MathLib.EPSILON || Math.abs(position.getY()) > MathLib.EPSILON || Math.abs(position.getZ()) > MathLib.EPSILON) {
        pSB.append("    translate " + pPrimitive.getPosition().getX() + " " + pPrimitive.getPosition().getZ() + " " + pPrimitive.getPosition().getY() + "\n");
      }
View Full Code Here

TOP

Related Classes of org.jwildfire.create.eden.primitive.Point

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.