}
}
}
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");
}