content/hifi-public/PlanetDropBundle_v1/scripts/pd_makeUtils.js
Dale Glass 0d14e5a379 Initial data.
Needs a lot of cleanup. Data has been de-duplicated, and where identical copies existed, one of them
has been replaced with a symlink.

Some files have been excluded, such as binaries, installers and debug dumps. Some of that may still
be present.
2022-02-13 18:59:11 +01:00

80 lines
2.4 KiB
JavaScript

// Scene Maker Helpers used by Maya export tools
var pd_baseUrl = "http://s3.amazonaws.com/hifi-public/PlanetDropBundle_v1/";
var mapPath = pd_baseUrl + "maps/map1.fbx";
// Following must be adjusted if changes to base map are made in authoring tool
var mapPosition = { x:11.676, y:52.233, z:-.270 };
var mapDimensions = { x:443.48, y:227.49, z:654.27 };
var skyboxUrl = "https://hifi-public.s3.amazonaws.com/images/SkyboxTextures/ThickCloudsWater2.jpg";
// Create model entity with optional userData
createModel = function(name, pos, dims, rot, modelUrl, userData)
{
print("creating model entity");
var createProperties = {
type: "Model",
name: name,
position: pos,
dimensions: dims,
rotation: rot,
modelURL: modelUrl,
userData: userData,
color: {red:205, green:45, blue:45},
visible: true
};
var entityID = Entities.addEntity(createProperties);
print("Created entityID: " + entityID);
return entityID;
}
// Create invisible box (for collider)
createBox = function(boxName, pos, dims, rot, isVisible)
{
// Invisible by default
isVisible = typeof isVisible !== 'undefined' ? isVisible : false;
print("creating invisible box");
var createProperties = {
type: "Box",
name: boxName,
position: pos,
dimensions: dims,
rotation: rot,
color: {red:45, green:45, blue:200},
visible: isVisible
};
var entityID = Entities.addEntity(createProperties);
print("Created entityID: " + entityID);
return entityID;
}
// Creates other necessary entities
pd_createBaseGeo = function()
{
// Create main map entity
createModel("MAP", mapPosition, mapDimensions, 0, mapPath, null );
// Create player detector object
var playerDetector = createBox("pd_PlayerDetector", {x:0,y:0,z:0}, {x:1,y:1,z:1}, 0, false );
var detectorUrl = pd_baseUrl + "scripts/entity/pd_playerDetector.js";
Entities.editEntity(playerDetector, {script:detectorUrl});
// Create Zone
var zoneProps = {
type: "Zone",
name: "ZONE",
position: {x:0, y:0, z:0},
dimensions: { x: 5000, y: 5000, z: 5000 },
keyLightColor: { red: 255, green: 255, blue: 255 },
stageSunModelEnabled: true,
shapeType: "sphere",
backgroundMode: "skybox",
skybox: {
color: { red: 255, green: 200, blue: 200 },
url: skyboxUrl
}
};
var zoneID = Entities.addEntity(zoneProps);
}