9036 lines · 213.8 KB · JavaScript
RawDownload
//  Copyright 2016 High Fidelity, Inc.//////  Distributed under the Apache License, Version 2.0.//  See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html// var version = 1219; var WORLD_OFFSET = {    x: 0,    y: 0,    z: 0} var WORLD_SCALE_AMOUNT = 1.0; function offsetVectorToWorld(vector) {    var newVector;     newVector = Vec3.sum(vector, WORLD_OFFSET);     return newVector} function scaleVectorToWorld(vector) {    var newVector;     newVector = Vec3.multiply(vector, WORLD_SCALE_AMOUNT);     return newVector} function transformToSmallerWorld(vector) {    var newVector = offsetVectorToWorld(vector);    // newVector = scaleVectorToWorld(newVector);    return newVector;} var cellLayout;var baseLocation = "https://hifi-content/DomainContent/CellScience/"; var utilsScript = Script.resolvePath('Scripts/utils.js');Script.include(utilsScript); assignVariables(); var locations = {    cellLayout: [offsetVectorToWorld({        x: 3000,        y: 13500,        z: 3000    }), offsetVectorToWorld({        x: 3276.6,        y: 13703.3,        z: 4405.6    }), 1800],    cells: [offsetVectorToWorld({        x: 13500,        y: 13500,        z: 13500    }), offsetVectorToWorld({        x: 13501,        y: 13501,        z: 13501    }), 400],    ribosome: [offsetVectorToWorld({        x: 13500,        y: 3000,        z: 3000    }), offsetVectorToWorld({        x: 13685,        y: 3248,        z: 2861    }), 1000],    hexokinase: [offsetVectorToWorld({        x: 3000,        y: 3000,        z: 13500    }), offsetVectorToWorld({        x: 2755,        y: 3121,        z: 13501    }), 2000],    mitochondria: [offsetVectorToWorld({        x: 3000,        y: 13500,        z: 3000    }), offsetVectorToWorld({        x: 3240,        y: 13519,        z: 3874    }), 1000],    translation: [offsetVectorToWorld({        x: 3000,        y: 13500,        z: 3000    }), offsetVectorToWorld({        x: 2962,        y: 13492,        z: 3342    }), 1000]}; var scenes = [{    name: "Cells",    objects: "",    location: locations.cells[0],    entryPoint: locations.cells[1],    zone: {        dimensions: {            x: 4000,            y: 4000,            z: 4000        },        light: {            r: 255,            g: 200,            b: 200        },        intensity: 1.1,        ambient: 0.7,        sun: true,        skybox: "cells_skybox_cross"    },    instances: [{        model: "Cell",        dimensions: {            x: 500,            y: 570,            z: 500        },        offset: {            x: 0,            y: 0,            z: 0        },        radius: 500,        number: 10,        userData: JSON.stringify({            entryPoint: locations.cellLayout[1],            target: locations.cellLayout[1],            location: locations.cellLayout[1],            baseURL: baseLocation        }),        script: "zoom.js?" + version,        visible: true    }],    boundary: {        radius: locations.cells[2],        center: locations.cells[0],        location: locations.cellLayout[1],        target: locations.cellLayout[0]    }}, {    name: "CellLayout",    objects: cellLayout,    location: locations.cellLayout[0],    entryPoint: locations.cellLayout[1],    zone: {        dimensions: {            x: 4000,            y: 4000,            z: 4000        },        light: {            r: 247,            g: 233,            b: 220        },        intensity: 2.3,        ambient: 0.7,        sun: true,        skybox: "cosmos_skybox_blurred"    },    instances: [{        model: "translation",        dimensions: {            x: 10,            y: 16,            z: 10        },        offset: {            x: 0,            y: 0,            z: 0        },        radius: 300,        number: 7,        userData: JSON.stringify({            grabbableKey: {                grabbable: false            },            target: locations.ribosome[1],            location: locations.ribosome[0],            baseURL: baseLocation        }),        script: "zoom.js?" + version,        visible: true    }, {        model: "vesicle",        dimensions: {            x: 60,            y: 60,            z: 60        },        randomSize: 10,        offset: {            x: 0,            y: 0,            z: 0        },        radius: 1000,        number: 22,        userData: JSON.stringify({            grabbableKey: {                grabbable: false            }        }),        script: null,        visible: true    }, { //golgi vesicles        model: "vesicle",        dimensions: {            x: 10,            y: 10,            z: 10        },        randomSize: 10,        offset: {            x: -319,            y: 66,            z: 976        },        radius: 140,        number: 10,        userData: JSON.stringify({            grabbableKey: {                grabbable: false            }        }),        script: null,        visible: true    }, { //golgi vesicles        model: "vesicle",        dimensions: {            x: 15,            y: 15,            z: 15        },        randomSize: 10,        offset: {            x: -319,            y: 66,            z: 976        },        radius: 115,        number: 7,        userData: JSON.stringify({            grabbableKey: {                grabbable: false            }        }),        script: null,        visible: true    }, {        model: "vesicle",        dimensions: {            x: 50,            y: 50,            z: 50        },        randomSize: 10,        offset: {            x: 0,            y: 0,            z: 0        },        radius: 600,        number: 15,        userData: JSON.stringify({            grabbableKey: {                grabbable: false            }        }),        script: null,        visible: true    }, { //outer vesicles        model: "vesicle",        dimensions: {            x: 60,            y: 60,            z: 60        },        randomSize: 10,        offset: {            x: 0,            y: 0,            z: 0        },        radius: 1600,        number: 22,        userData: JSON.stringify({            grabbableKey: {                grabbable: false            }        }),        script: null,        visible: true    }, { //outer vesicles        model: "vesicle",        dimensions: {            x: 40,            y: 40,            z: 40        },        randomSize: 10,        offset: {            x: 0,            y: 0,            z: 0        },        radius: 1400,        number: 22,        userData: JSON.stringify({            grabbableKey: {                grabbable: false            }        }),        script: null,        visible: true    }, { //outer vesicles        model: "vesicle",        dimensions: {            x: 80,            y: 80,            z: 80        },        randomSize: 10,        offset: {            x: 0,            y: 0,            z: 0        },        radius: 1800,        number: 22,        userData: JSON.stringify({            grabbableKey: {                grabbable: false            }        }),        script: null,        visible: true    }, {        model: "hexokinase",        dimensions: {            x: 3,            y: 4,            z: 3        },        randomSize: 10,        offset: {            x: 236,            y: 8,            z: 771        },        radius: 80,        number: 7,        userData: JSON.stringify({            grabbableKey: {                grabbable: false            },            target: locations.hexokinase[1],            location: locations.hexokinase[0],            baseURL: baseLocation        }),        script: "zoom.js?" + version,        visible: true    }, {        model: "pfructo_kinase",        dimensions: {            x: 3,            y: 4,            z: 3        },        randomSize: 10,        offset: {            x: 236,            y: 8,            z: 771        },        radius: 60,        number: 7,        userData: JSON.stringify({            grabbableKey: {                grabbable: false            },            target: locations.hexokinase[1],            location: locations.hexokinase[0],        }),        script: "zoom.js?" + version,        visible: true    }, {        model: "glucose_isomerase",        dimensions: {            x: 3,            y: 4,            z: 3        },        randomSize: 10,        offset: {            x: 236,            y: 8,            z: 771        },        radius: 70,        number: 7,        userData: JSON.stringify({            grabbableKey: {                grabbable: false            },            target: locations.hexokinase[1],            location: locations.hexokinase[0],        }),        script: "zoom.js?" + version,        visible: true    }],    boundary: {        radius: locations.cellLayout[2],        center: locations.cellLayout[0],        location: locations.cells[1],        target: locations.cells[0]    }}, {    name: "Ribosome",    objects: "",    location: locations.ribosome[0],    entryPoint: locations.ribosome[1],    zone: {        dimensions: {            x: 4000,            y: 4000,            z: 4000        },        light: {            r: 250,            g: 185,            b: 182        },        intensity: 0.6,        ambient: 2.9,        sun: true,        skybox: "ribosome_skybox"    },    instances: [{        model: "translation_highres",        dimensions: {            x: 500,            y: 500,            z: 200        },        offset: {            x: 0,            y: 0,            z: 0        },        radius: 1,        number: 1,        userData: JSON.stringify({            grabbableKey: {                grabbable: false            }        }),        script: null,        visible: true    }],    boundary: {        radius: locations.ribosome[2],        center: locations.ribosome[0],        location: locations.translation[1],        target: locations.translation[0]    }}, {    name: "Hexokinase",    objects: "",    location: locations.hexokinase[0],    entryPoint: locations.hexokinase[1],    zone: {        dimensions: {            x: 4000,            y: 4000,            z: 4000        },        light: {            r: 255,            g: 255,            b: 255        },        intensity: 0.6,        ambient: 0.6,

Lines 1–500 of 9036.