示例#1
0
exports.set_hover_cam_angle = function(camobj, angle) {
    m_print.error("set_hover_cam_angle() deprecated, use rotate_camera() or rotate_hover_camera() instead");

    if (!camera.is_hover_camera(camobj)) {
        m_print.error("set_hover_cam_angle(): wrong object or camera move style");
        return;
    }
    var render = camobj._render;

    if (!render.use_distance_limits) {
        m_print.error("set_hover_cam_angle(): distance/hover_angle limits are not defined or disabled");
        return;
    }

    var angles = camera.get_camera_angles(camobj, _vec2_tmp);
    // NOTE: prepare hover angle (CCW style)
    var angle_ccw = -angle;
    var rot_angle = angle_ccw - angles[1];

    if (rot_angle)
        camera.rotate_hover_camera(camobj, 0, rot_angle);

    transform.update_transform(camobj);
    m_phy.sync_transform(camobj);
}
示例#2
0
exports.get_hover_cam_angle = function(camobj) {
    m_print.error("get_hover_cam_angle() deprecated, use get_camera_angles() instead");
    if (!camera.is_hover_camera(camobj)) {
        m_print.error("get_hover_cam_angle(): wrong object or camera move style");
        return null;
    }

    return -camera.get_camera_angles(camobj, _vec2_tmp)[1];
}
示例#3
0
exports.get_camera_angles = function(camobj, dest) {
    if (!dest)
        var dest = new Float32Array(2);
    camera.get_camera_angles(camobj, dest);
    return dest;
}