There is only one way I know of that would make that possible. You would add a circular flat mesh inside the scope, behind the reticle, and that mesh would have a second camera rendered to the texture of that material. The camera would be attached to a dummy BONE inside the scope called BONE_objective_lens and the camera Field Of View and sensor mode would be called in a method to set these parameters for that camera only. When NV or IR modes are not switched on the display mesh would be hidden from view for the normal visual spectrum. It would be much the same as an MFD screen in an aircraft, where a sensor's camera view is rendered to a flat plane on the display. There are only two missing methods, 1. render second camera and 2. render camera to texture, everything else is currently possible.
The script would be something like this:
"use strict";
//global variables
var geom, optic, ot_world, ot_fb, sensorMode, flirMode, objective_lens_pos;
function initialize(reload){
this.geom = get_geomob(0);
this.optic = get_cam(1);
ot_world = this.$query_interface("ot::js::world.get");
ot_fb = this.$query_interface('ot::js::fb.get');
sensorMode = "IR";
flirMode = "WHT";
objective_lens_pos = this.geom.get_joint_model_pos(this.geom.get_joint('objective_lens'));
}
function update(dt){
var hfov, ir_contrast, ir_amplify, ir_noise, nvg_contrast, nvg_amplify, nvg_noise;
if(sensorMode == "IR"){hfov = 16;}
else if(sensorMode == "NVG"){hfov = 24;}
if(flirMode == "WHT"){ir_contrast = 1; ir_amplify = 1; ir_noise = 1; ir_focus = 1;}
else if(flirMode == "BLK"){ir_contrast = 1; ir_amplify = 1; ir_noise = 1; ir_focus = 1;}
nvg_contrast = 1; nvg_amplify = 1, nvg_noise = 1;
//Infrared Mode
if(sensorMode=="IR"){
this.optic.set_ir_cam_pos(objective_lens_pos);
this.optic.ot_world.set_camera_fov(hfov);
this.optic.render_to_tex(optic_display);
this.optic.ot_fb.set_ir_params(ir_contrast, ir_amplify, ir_noise, ir_focus);
this.optic.ot_fb.ir_enable(true);
this.optic.ot_fb.nvg_enable(false);
this.geom.set_mesh_visible_id(optic_display, true);
}
//Night Vision Mode
else_if(sensorMode=="NVG"){
this.optic = this.set_nvg_cam_pos(objective_lens_pos);
this.optic.ot_world.set_camera_fov(hfov);
this.optic.render_to_tex(optic_display);
this.optic.ot_fb.set_nvg_params(nvg_contrast, nvg_amplify, nvg_noise);
this.optic.ot_fb.nvg_enable(true);
this.optic.ot_fb.ir_enable(false);
this.geom.set_mesh_visible_id(optic_display, true);
}
else{
this.geom.set_mesh_visible_id(optic_display, false);
}
}
Regards,
Uriah