Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Addons > Addon Requests
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Addon Requests If you have a request for a new addon or want to know where to find a specific addon, ask it here!

Reply
 
Thread Tools
Old 01-13-2020, 01:10 AM   #1051
Donamy
Beta Tester


Default

All the payload bay cameras pan and tilt.
Donamy is online now   Reply With Quote
Old 01-13-2020, 02:01 AM   #1052
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Quote:
Originally Posted by Donamy View Post
 All the payload bay cameras pan and tilt.
Yes. I can do that also. But you need to add no clipping as you get clipped by the bay and hardware.

But not sure if you can see that view from the monitor in the cockpit?

Except for the RMS views. The pan and tilt can be simulated in the Camera MFD. So just make 4 Camera settings.

Last edited by gattispilot; 01-13-2020 at 02:05 AM.
gattispilot is offline   Reply With Quote
Old 01-13-2020, 07:43 AM   #1053
Donamy
Beta Tester


Default

Kinda cheesy if the cameras, don't move.
Donamy is online now   Reply With Quote
Old 01-13-2020, 09:44 AM   #1054
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Well In SF they don't move at all. I know in SSU they do. I can animate them and get the view in the VC just not on the CCTV.

But clipping needs to be turned off in D3D9

This may all I can do:


Still haven't figured out why the buttons are not working. I can get them to turn on/off though.

So in 2010 does the SSu CRT work. I couldn't get them to come on

Last edited by gattispilot; 01-13-2020 at 11:48 AM.
gattispilot is offline   Reply With Quote
Thanked by:
Old 01-13-2020, 05:31 PM   #1055
Donamy
Beta Tester


Default

If each camera was a vessel you could use it's view point on the CCTV.
Donamy is online now   Reply With Quote
Old 01-13-2020, 05:45 PM   #1056
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Quote:
Originally Posted by Donamy View Post
 If each camera was a vessel you could use it's view point on the CCTV.
Not sure how?

So in SSu do the CCTV work?

I can animate the camera and the view in the VC. But how to put the vc view on the mfd?
gattispilot is offline   Reply With Quote
Old 01-13-2020, 07:07 PM   #1057
Donamy
Beta Tester


Default

You have to have Dx9 and use the Camera MFD. SSU does not have working CCTVs in the aft flightdeck.
Donamy is online now   Reply With Quote
Thanked by:
Old 01-13-2020, 11:23 PM   #1058
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

So It sounds like the way to do it is just set up Camera MFD with the 4 payload camera. Then use the Camera MFD to move the camera.

But I need to figure out the buttons. I think it may be that the front MFD button change along the x axis and the CCTv would have the main change on the z axis.

---------- Post added at 05:23 PM ---------- Previous post was at 01:33 PM ----------

So I am stuck on why the rear side mfd/CCTV buttons are not working.

IS there some code to display where the cursor is when the button is pressed?

Code:
void Atlantis::RegisterVC_AftMFD ()
{
	
		SURFHANDLE tex1 = oapiGetTextureHandle (hOrbiterVCMesh, 20);
	// activate MFD function buttons
		oapiVCSetAreaClickmode_Quadrilateral(AID_CCTV1_BUTTONS, _V(-1.009214, 2.905935, 12.39062), _V(-0.906, 2.906741, 12.285), _V(-1.007, 2.913594, 12.392), _V(-0.903 , 2.914401,  12.288));
		oapiVCSetAreaClickmode_Quadrilateral(AID_CCTV2_BUTTONS, _V(-0.9271295, 2.69396, 12.31786), _V(-0.9271295, 2.694549, 12.285), _V(-0.9271295, 2.701223, 12.31629), _V(-0.9271295,  2.702009 , 12.41936));

	
	// D. Beachy: register+activate MFD power buttons
	const double powerButtonRadius = 0.01; // radius of power button on each MFD
	oapiVCRegisterArea(AID_CCTV1_PWR, PANEL_REDRAW_NEVER, PANEL_MOUSE_LBDOWN | PANEL_MOUSE_ONREPLAY);
	oapiVCRegisterArea(AID_CCTV2_PWR, PANEL_REDRAW_NEVER, PANEL_MOUSE_LBDOWN | PANEL_MOUSE_ONREPLAY);

	oapiVCSetAreaClickmode_Spherical(AID_CCTV1_PWR, _V(-1.079, 3.0613, 12.412), .01);
	oapiVCSetAreaClickmode_Spherical(AID_CCTV2_PWR, _V(-1.0401, 2.8382, 12.443), .01);


	oapiVCRegisterArea(AID_CCTV1_BUTTONS, _R(0, 99, 255, 112), PANEL_REDRAW_USER, PANEL_MOUSE_LBDOWN | PANEL_MOUSE_LBUP | PANEL_MOUSE_LBPRESSED | PANEL_MOUSE_ONREPLAY, PANEL_MAP_BACKGROUND, tex1);
	oapiVCRegisterArea(AID_CCTV2_BUTTONS, _R(0, 113, 255, 126), PANEL_REDRAW_USER, PANEL_MOUSE_LBDOWN | PANEL_MOUSE_LBUP | PANEL_MOUSE_LBPRESSED | PANEL_MOUSE_ONREPLAY, PANEL_MAP_BACKGROUND, tex1);}
Code:
bool Atlantis::clbkVCMouseEvent (int id, int event, VECTOR3 &p)
{


	static bool counting = false;
	static double t0 = 0.0;

	switch (id) {
	// handle MFD selection buttons
	case AID_CDR1_BUTTONS:
	case AID_PLT1_BUTTONS:
    case AID_MFD1_BUTTONS:
	case AID_CCTV1_BUTTONS:
	case AID_CCTV2_BUTTONS:
	//case AID_MFDA_BUTTONS: 
	{
		int mfd = id-AID_CDR1_BUTTONS+MFD_LEFT;
		int bt = (int)(p.x*5.99);
		if (bt < 5) oapiProcessMFDButton (mfd, bt, event);
		else {
			if (event & PANEL_MOUSE_LBDOWN) {
				t0 = oapiGetSysTime();
				counting = true;
			} else if ((event & PANEL_MOUSE_LBUP) && counting) {
				oapiSendMFDKey (mfd, OAPI_KEY_F2);
				counting = false;
			} else if ((event & PANEL_MOUSE_LBPRESSED) && counting && (oapiGetSysTime()-t0 >= 1.0)) {
				oapiSendMFDKey (mfd, OAPI_KEY_F1);
				counting = false;
			}
		}
		} return true;

    // D. Beachy: handle power buttons
    case AID_CDR1_PWR:
   	case AID_PLT1_PWR:
	case AID_MFD1_PWR:
	case AID_CCTV1_PWR:
	case AID_CCTV2_PWR:
    //case AID_MFDA_PWR: 
	{
        int mfd = id - AID_CDR1_PWR+MFD_LEFT;
        oapiSendMFDKey(mfd, OAPI_KEY_ESCAPE);
        } return true;
        


	// handle MFD brightness buttons
	case AID_CDR1_BRT:
	case AID_PLT1_BRT:
	case AID_MFD1_BRT: 
	
	//case AID_MFDA_BRT:
	{
		static double t0, brt0;
		static bool up;
		int mfd = id-AID_CDR1_BRT;
		if (event & PANEL_MOUSE_LBDOWN) {
			up = (p.x >= 0.5);
			t0 = oapiGetSysTime();
			brt0 = mfdbright[mfd];
		} else if (event & PANEL_MOUSE_LBPRESSED) {
			double dt = oapiGetSysTime()-t0;
			double brt, dbrt = dt * 0.2;
			if (up) brt = min (1.0, brt0 + dbrt);
			else    brt = max (0.25, brt0 - dbrt);
			mfdbright[mfd] = brt;
			if (vis) {
				MATERIAL mat;
				memset (&mat, 0, sizeof(MATERIAL));
				mat.emissive.r = mat.emissive.g = mat.emissive.b = (float)brt;
				mat.emissive.a = 1.0f;
				DEVMESHHANDLE hMesh = GetDevMesh (vis, mesh_vc);
				oapiSetMaterial (hMesh, 23+mfd, &mat);
			}
		}
	} return true;
		







		

	// handle panel R13L events (payload bay operations)
	case AID_R13L:
		return plop->VCMouseEvent (id, event, p);
	}
	
	return false;
}
So I can turn the mfd on/off when I press in the right area.
gattispilot is offline   Reply With Quote
Old 01-15-2020, 11:55 AM   #1059
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

So just guessing now. But because of 45 degree angle of the CCTV

I am thinking that is why I am not being able to hit the buttons. I made a large area and did hit so that part is right.

So I adjusted the view to a 45 degree view.
But I think I need to see what the coordinates of the cursor are to be adjust the click area.

Last edited by gattispilot; 01-16-2020 at 12:32 PM.
gattispilot is offline   Reply With Quote
Old 01-16-2020, 12:34 PM   #1060
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

So I am at a lost. So for now I may just got back to a static screen. I know the SSu has a Z axis MFD but couldn't find the code part to see how they dealt with it.
gattispilot is offline   Reply With Quote
Old 01-16-2020, 07:12 PM   #1061
Donamy
Beta Tester


Default

I don't get what you are trying to do.
Donamy is online now   Reply With Quote
Old 01-16-2020, 07:22 PM   #1062
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Trying to place a MFD with button where the 2 CCTV screens are. Placing the screen there is not an issue. But getting the buttons to work is. All the other mfd/s work but this one. I think it may be that the screen is at 45 degree angle. The mfd I think is for MFD that are on the x axis/ The CCTV are along the x/z axis
gattispilot is offline   Reply With Quote
Old 01-16-2020, 10:53 PM   #1063
Donamy
Beta Tester


Default

The MFD on the side aft flight isn't in the XZ plane.
Donamy is online now   Reply With Quote
Thanked by:
Old 01-16-2020, 11:53 PM   #1064
gattispilot
Addon Developer
 
gattispilot's Avatar
Default

Quote:
Originally Posted by Donamy View Post
 The MFD on the side aft flight isn't in the XZ plane.

You are right it is along the z axis.


So I got it show the cursor point. 0 z value. But the x and Y value make no sense.



But I can't the button to work.
gattispilot is offline   Reply With Quote
Old 01-17-2020, 12:53 AM   #1065
Donamy
Beta Tester


Default

Which button, or is it no buttons ?
Donamy is online now   Reply With Quote
Thanked by:
Reply

  Orbiter-Forum > Orbiter Addons > Addon Requests


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 07:35 AM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.