/** * Raw Scene API object - should always correspond with the Scene Schema * @param id String * @param path String * @param name String * @param meshes GameLib.D3.API.Mesh [] * @param position GameLib.API.Vector3 * @param quaternion GameLib.API.Quaternion * @param scale GameLib.API.Vector3 * @param parentSceneId * @param lights GameLib.D3.API.Light[] * @param worlds GameLib.D3.API.World[] * @param entityManager GameLib.EntityManager * @param shapes GameLib.D3.API.Shape[] * @param cameras * @param activeCameraIndex * @param splines GameLib.D3.API.Spline[] * @constructor */ GameLib.D3.API.Scene = function( id, path, name, meshes, position, quaternion, scale, parentSceneId, lights, worlds, entityManager, shapes, cameras, activeCameraIndex, splines ) { if (GameLib.Utils.UndefinedOrNull(id)) { id = GameLib.Utils.RandomId(); } this.id = id; if (GameLib.Utils.UndefinedOrNull(path)) { path = null; } this.path = path; if (GameLib.Utils.UndefinedOrNull(name)) { name = 'unnamed'; } this.name = name; if (GameLib.Utils.UndefinedOrNull(meshes)) { meshes = []; } this.meshes = meshes; if (GameLib.Utils.UndefinedOrNull(position)) { position = new GameLib.API.Vector3(); } this.position = position; if (GameLib.Utils.UndefinedOrNull(quaternion)) { quaternion = new GameLib.API.Quaternion(); } this.quaternion = quaternion; if (GameLib.Utils.UndefinedOrNull(scale)) { scale = new GameLib.API.Vector3(1,1,1); } this.scale = scale; if (GameLib.Utils.UndefinedOrNull(parentSceneId)) { parentSceneId = null; } this.parentSceneId = parentSceneId; if (GameLib.Utils.UndefinedOrNull(lights)) { lights = []; } this.lights = lights; if (GameLib.Utils.UndefinedOrNull(worlds)) { worlds = []; } this.worlds = worlds; if (GameLib.Utils.UndefinedOrNull(entityManager)) { entityManager = null; } this.entityManager = entityManager; if (GameLib.Utils.UndefinedOrNull(shapes)) { shapes = []; } this.shapes = shapes; if (GameLib.Utils.UndefinedOrNull(cameras)) { cameras = []; } this.cameras = cameras; if (GameLib.Utils.UndefinedOrNull(activeCameraIndex)) { activeCameraIndex = 0; } this.activeCameraIndex = activeCameraIndex; if (GameLib.Utils.UndefinedOrNull(splines)) { splines = []; } this.splines = splines; };