#NEWLINE# def _setup_camera_rig( self ) : #NEWLINE# #INDENT# ' Setups the cameras to render a cubemap ' #NEWLINE# directions = ( Vec3 ( 1 , 0 , 0 ) , Vec3 ( ( - 1 ) , 0 , 0 ) , Vec3 ( 0 , 1 , 0 ) , Vec3 ( 0 , ( - 1 ) , 0 ) , Vec3 ( 0 , 0 , 1 ) , Vec3 ( 0 , 0 , ( - 1 ) ) ) #NEWLINE# for i in range ( 6 ) : #NEWLINE# #INDENT# region = self . target . internal_buffer . make_display_region ( ( i / 6 ) , ( ( i / 6 ) + ( 1 / 6 ) ) , 0 , 1 ) #NEWLINE# region . set_sort ( ( 25 + i ) ) #NEWLINE# region . set_active ( True ) #NEWLINE# region . disable_clears ( ) #NEWLINE# region . set_clear_depth_active ( True ) #NEWLINE# region . set_clear_depth ( 1.0 ) #NEWLINE# region . set_clear_color_active ( True ) #NEWLINE# region . set_clear_color ( Vec4 ( 0 ) ) #NEWLINE# lens = PerspectiveLens ( ) #NEWLINE# lens . set_fov ( 90 ) #NEWLINE# lens . set_near_far ( 0.001 , 1.0 ) #NEWLINE# camera = Camera ( ( 'EnvmapCam-' + str ( i ) ) , lens ) #NEWLINE# camera_np = self . rig_node . attach_new_node ( camera ) #NEWLINE# camera_np . look_at ( camera_np , directions [ lens ] ) #NEWLINE# region . set_camera ( camera_np ) #NEWLINE# self . regions . append ( region ) #NEWLINE# self . cameras . append ( camera_np ) #NEWLINE# #UNINDENT# self . cameras [ 0 ] . set_r ( 90 ) #NEWLINE# self . cameras [ 1 ] . set_r ( ( - 90 ) ) #NEWLINE# self . cameras [ 3 ] . set_r ( 180 ) #NEWLINE# self . cameras [ 5 ] . set_r ( 180 ) #NEWLINE# for camera_np in self . cameras : #NEWLINE# #INDENT# self . _pipeline . tag_mgr . register_camera ( 'envmap' , camera_np . node ( ) )