<commit_before>"use strict";

// For conditions of distribution and use, see copyright notice in LICENSE
/*
 *      @author <NAME>
 *      @author <NAME>
 *      @author <NAME>
 *      Date: 2014
 */

var app = new Tundra.Application();

function setupEditorControls() {
    var controls = new THREE.EditorControls(app.viewer.camera, app.viewer.renderer.domElement);
}

function loadxml3d() {
    app.start();
    var parser = new Tundra.SceneParser(app.dataConnection);
    parser.parseDocXml3D(document);

    // hack to get the right xml3d-created camera and not the default one.
    window.setTimeout(setupEditorControls, 2000);
}
<commit_msg>fix #44 - view controls are gone / broken in xml3d examples. EditorControls only works in a camera parented directly to the scene so the examples viewer uses the viewer default camera, only gets the position from the scene defined camera<commit_after>"use strict";

// For conditions of distribution and use, see copyright notice in LICENSE
/*
 *      @author <NAME>
 *      @author <NAME>
 *      @author <NAME>
 *      Date: 2014
 */

var app = new Tundra.Application();

function setupEditorControls() {
    var v = app.viewer;
    v.defaultCamera.position = v.camera.parent.position;
    v.defaultCamera.rotation = v.camera.parent.rotation;
    v.defaultCamera.scale = v.camera.parent.scale;
    v.defaultCamera.lookAt(new THREE.Vector3());

    app.viewer.setActiveCamera({'threeCamera': v.defaultCamera});
    var controls = new THREE.EditorControls(v.defaultCamera, v.renderer.domElement);
}

function loadxml3d() {
    app.start();
    var parser = new Tundra.SceneParser(app.dataConnection);
    parser.parseDocXml3D(document);

    // hack to get the right xml3d-created camera and not the default one.
    window.setTimeout(setupEditorControls, 2000);
}

{'fraction_non_alphanumeric': 0.10706401766004416, 'fraction_numerical': 0.01434878587196468, 'mean_word_length': 3.625, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 5}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2731813', 'n_tokens_mistral': 547, 'n_tokens_neox': 523, 'n_words': 159}