/** * Apply the model's position, orientation, and scale to a COLLADA root. * * @param root COLLADA root to configure. */ protected void configureColladaRoot(ColladaRoot root) { root.setResourceResolver(this); Position refPosition = this.model.getLocation().getPosition(); root.setPosition(refPosition); root.setAltitudeMode(KMLUtil.convertAltitudeMode(this.model.getAltitudeMode())); KMLOrientation orientation = this.model.getOrientation(); if (orientation != null) { Double d = orientation.getHeading(); if (d != null) root.setHeading(Angle.fromDegrees(d)); d = orientation.getTilt(); if (d != null) root.setPitch(Angle.fromDegrees(-d)); d = orientation.getRoll(); if (d != null) root.setRoll(Angle.fromDegrees(-d)); } KMLScale scale = this.model.getScale(); if (scale != null) { Double x = scale.getX(); Double y = scale.getY(); Double z = scale.getZ(); Vec4 modelScale = new Vec4(x != null ? x : 1.0, y != null ? y : 1.0, z != null ? z : 1.0); root.setModelScale(modelScale); } }