private static void GmBsCmnClearObject3DNNFadedColor(AppMain.OBS_OBJECT_WORK obj_work) { AppMain.AMS_DRAWSTATE drawState = obj_work.obj_3d.draw_state; drawState.fog.flag = AppMain.g_obj_draw_3dnn_draw_state.fog.flag; drawState.fog_color.Assign(AppMain.g_obj_draw_3dnn_draw_state.fog_color); drawState.fog_range.Assign(AppMain.g_obj_draw_3dnn_draw_state.fog_range); }
public AMS_DRAWSTATE(AppMain.AMS_DRAWSTATE drawState) { this.drawflag = drawState.drawflag; this.diffuse.Assign(drawState.diffuse); this.ambient.Assign(drawState.ambient); this.specular.Assign(drawState.specular); this.envmap.Assign(drawState.envmap); this.alpha.Assign(drawState.alpha); this.blend.Assign(drawState.blend); for (int index = 0; index < 4; ++index) { this.texoffset[index].Assign(drawState.texoffset[index]); } this.fog.flag = drawState.fog.flag; this.fog_color.Assign(drawState.fog_color); this.fog_range.Assign(drawState.fog_range); this.zmode.Assign(drawState.zmode); }
private static void GmBsCmnSetObject3DNNFadedColor( AppMain.OBS_OBJECT_WORK obj_work, AppMain.NNS_RGB color, float intensity, float radius, float length) { AppMain.SNNS_VECTOR disp_pos = new AppMain.SNNS_VECTOR(); AppMain.AMS_DRAWSTATE drawState = obj_work.obj_3d.draw_state; drawState.fog.flag = 1; drawState.fog_color.r = color.r; drawState.fog_color.g = color.g; drawState.fog_color.b = color.b; AppMain.ObjCameraDispPosGet(AppMain.g_obj.glb_camera_id, out disp_pos); float f32 = AppMain.FX_FX32_TO_F32(obj_work.pos.z); float num1 = AppMain.nnAbs((double)disp_pos.z - (double)f32); float num2; float num3; if ((double)length * (double)intensity > (double)num1) { num2 = 1.175494E-38f; num3 = num2 + num1 / intensity; } else { num2 = num1 - length * intensity; if ((double)num2 <= 0.0) { num2 = 1.175494E-38f; } num3 = num2 + length; } drawState.fog_range.fnear = num2 + radius; drawState.fog_range.ffar = num3 - radius; }