noncompiled/models/universe/Universe.js
// returns a dictionary mapping body ids for stars to a list of positions sampled along their orbits
returns a dictionary mapping body ids for stars to a list of positions sampled along their orbits
returns a dictionary mapping body ids for stars to a list of positions sampled along their orbits
function star_sample_positions_map(config, world_id, min_perceivable_period, max_sample_count) {
        max_sample_count = max_sample_count || 16;
        var origin   = cycle_of_body(world_id);
        var samples_ = samples(config, max_sample_count, min_perceivable_period);
        var result = {};
        for (var sample of samples_){
            var body_matrices = origin.get_body_matrices(sample, cycles);
            for (var star_id in stars) {
                var star_matrix = body_matrices[star_id];
                var star_pos = Matrix4x4.get_translation(star_matrix);
                result[star_id] = result[star_id] || [];
                result[star_id].push(star_pos);
            }
        }
        return result;
    }
function star_sample_positions_map ( config , world_id , min_perceivable_period , max_sample_count ) { max_sample_count = max_sample_count || 16 ; var origin = cycle_of_body ( world_id ) ; var samples_ = samples ( config , max_sample_count , min_perceivable_period ) ; var result = { } ; for ( var sample of samples_ ) { var body_matrices = origin . get_body_matrices ( sample , cycles ) ; for ( var star_id in stars ) { var star_matrix = body_matrices [ star_id ] ; var star_pos = Matrix4x4 . get_translation ( star_matrix ) ; result [ star_id ] = result [ star_id ] || [ ] ; result [ star_id ] . push ( star_pos ) ; } } return result ; }
returns a dictionary mapping body ids for stars to a list of positions sampled along their orbits
returns a dictionary mapping body ids for stars to a list of positions sampled along their orbits