// Map a texture onto an object.

grapler.prototype.mapTexture = function(objID, textureID, faceID)

{

// Make sure the ID is not empty, if it is report an error, otherwise continue.

if (this.objectID[objID] == undefined)

{

system.pushEvent("grapler3d", "[ERROR] Failure to map texture: Object \"" + id + "\" does not exist!");

} else {

// Find the location for the new texture

var position = this.objectID[objID];

var assignment = this.objects[position]["map"].length;

// Begin mapping the texture to it's points.

this.objects[position]["map"][assignment] = {};

this.objects[position]["map"][assignment].texture = textureID;

this.objects[position]["map"][assignment].face = faceID;

};

};

// as Used in main.js

world.addPolygon("test", "sky", -90, 90, -90, -90, -90, -90, 90, -90, -90, 90, 90, -90);