scripts/modelCreation.js
/**
 * Display a KMZ Model on Google Earth
 * @param {KmlObject} An object containing a model that can be displayed on Google Earth
 * @param {ModelSimulator} simulator The simulator to create a model for
 */
Display a KMZ Model on Google Earth
@param {KmlObject} An object containing a model that can be displayed on Google Earth
@param {ModelSimulator} simulator The simulator to create a model for
Display a KMZ Model on Google Earth @param { KmlObject } An object containing a model that can be displayed on Google Earth @param { ModelSimulator } simulator The simulator to create a model for
function createModelOnEarth(kmlObject, simulator) {
	var childIndex = getKmlModelChild(kmlObject);
	simulator.kmzModelPlacemark = kmlObject.getFeatures().getChildNodes().item(childIndex);
	var model = simulator.kmzModelPlacemark.getGeometry();
	model.setAltitudeMode(simulator.ge.ALTITUDE_RELATIVE_TO_GROUND);
	simulator.ge.getFeatures().appendChild(simulator.kmzModelPlacemark);
	setModelScale(model);
	simulationStartingTasks(simulator, model);
}
function createModelOnEarth ( kmlObject , simulator ) { var childIndex = getKmlModelChild ( kmlObject ) ; simulator . kmzModelPlacemark = kmlObject . getFeatures ( ) . getChildNodes ( ) . item ( childIndex ) ; var model = simulator . kmzModelPlacemark . getGeometry ( ) ; model . setAltitudeMode ( simulator . ge . ALTITUDE_RELATIVE_TO_GROUND ) ; simulator . ge . getFeatures ( ) . appendChild ( simulator . kmzModelPlacemark ) ; setModelScale ( model ) ; simulationStartingTasks ( simulator , model ) ; }
Display a KMZ Model on Google Earth
 @param {KmlObject} An object containing a model that can be displayed on Google Earth
 @param {ModelSimulator} simulator The simulator to create a model for
Display a KMZ Model on Google Earth @param { KmlObject } An object containing a model that can be displayed on Google Earth @param { ModelSimulator } simulator The simulator to create a model for
//Get the index of the KmlGeometry object of type KmlModel in the KmlObject //Store the KmlGeometry of the KmlModel in a variable for placement on Google Earth /* Get the KmlModel from the KmlPlacemark
	 * Objects are passed by reference in JavaScript, so the model can be modified without needing to
	 * re-associate it with its KmlPlacemark */ //Set the models altitude mode //Append the KmlPlacemark to Google Earth //Set the scale of the model //Begin the simulation animation