Skip to content

Commit

Permalink
Merge pull request orbiternassp#5 from maxq519/X-Pointer-Code
Browse files Browse the repository at this point in the history
X pointer code
  • Loading branch information
Jordan-64 committed Nov 16, 2023
2 parents 451004c + 0693b39 commit cd4bf4a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Orbitersdk/samples/ProjectApollo/src_lm/LEM.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class CrossPointer

void DrawSwitchVC(int id, int event, SURFHANDLE surf);
void SetDirection(const VECTOR3 &xvec, const VECTOR3 &yvec);
void DefineVCAnimations(UINT vc_idx);
void DefineVCAnimations(UINT vc_idx, bool left);
void DefineMeshGroup(UINT _grpX, UINT _grpY);

bool IsPowered();
Expand All @@ -207,7 +207,7 @@ class CrossPointer
UINT grpX, grpY;

VECTOR3 xvector, yvector;
MGROUP_TRANSLATE *xtrans, *ytrans;
MGROUP_ROTATE *xtrans, *ytrans;
};

#define CROSSPOINTER_LEFT_START_STRING "CROSSPOINTER_LEFT_START"
Expand Down
4 changes: 2 additions & 2 deletions Orbitersdk/samples/ProjectApollo/src_lm/lemswitches.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ class LMRCSBQtyInd : public CurvedMeter {
SURFHANDLE NeedleSurface;
};

class TempMonitorInd : public LinearMeter {
class TempMonitorInd : public CurvedMeter {
public:
TempMonitorInd();
void Init(SURFHANDLE surf, SwitchRow &row, LEM *s);
Expand Down Expand Up @@ -672,4 +672,4 @@ class LEMMasterAlarmSwitch : public PushSwitch {
protected:
LEM_CWEA *cwea;
SURFHANDLE switchsurfacevc;
};
};
10 changes: 7 additions & 3 deletions Orbitersdk/samples/ProjectApollo/src_lm/lemsystems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3206,10 +3206,14 @@ void CrossPointer::DefineMeshGroup(UINT _grpX, UINT _grpY)
grpY = _grpY;
}

void CrossPointer::DefineVCAnimations(UINT vc_idx)
void CrossPointer::DefineVCAnimations(UINT vc_idx, bool left)
{
xtrans = new MGROUP_TRANSLATE(vc_idx, &grpX, 1, xvector);
ytrans = new MGROUP_TRANSLATE(vc_idx, &grpY, 1, yvector);
VECTOR3 rot_point = _V(0.380, 0.673, 1.819);
if (left == true) {
rot_point.x *= -1;
}
xtrans = new MGROUP_ROTATE(vc_idx, &grpX, 1, rot_point, _V(1, 0, 0), (float)(37 * RAD));
ytrans = new MGROUP_ROTATE(vc_idx, &grpY, 1, rot_point, _V(0, -1, 0), (float)(37 * RAD));
anim_xpointerx = lem->CreateAnimation(0.5);
anim_xpointery = lem->CreateAnimation(0.5);
lem->AddAnimationComponent(anim_xpointerx, 0.0f, 1.0f, xtrans);
Expand Down
11 changes: 8 additions & 3 deletions Orbitersdk/samples/ProjectApollo/src_lm/lemvc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2379,8 +2379,13 @@ void LEM::DefineVCAnimations()
FloodRotary.SetReference(P3_ROT_POS[4], P3_ROT_AXIS);
FloodRotary.DefineMeshGroup(VC_GRP_Rot_P3_05);

NEEDLE_POS = {0,0.179865,1.699588};

MainPanelVC.AddSwitch(&TempMonitorInd);
TempMonitorInd.SetDirection(_V(0.00, 0.0625*cos(P3_TILT), 0.0625*sin(P3_TILT)));
//TempMonitorInd.SetDirection(_V(0.00, 0.0625 * cos(P3_TILT), 0.0625 * sin(P3_TILT)));
//TempMonitorInd.DefineMeshGroup(VC_GRP_Needle_P3_01);
TempMonitorInd.SetReference(NEEDLE_POS);
TempMonitorInd.SetRotationRange(RAD * 38.6);
TempMonitorInd.DefineMeshGroup(VC_GRP_Needle_P3_01);

MainPanelVC.AddSwitch(&RadarSignalStrengthMeter);
Expand Down Expand Up @@ -3108,8 +3113,8 @@ void LEM::DefineVCAnimations()
RRGyroSelSwitch.DefineMeshGroup(VC_GRP_Sw_RRGyro);

MainPanelVC.DefineVCAnimations(vcidx);
crossPointerLeft.DefineVCAnimations(vcidx);
crossPointerRight.DefineVCAnimations(vcidx);
crossPointerLeft.DefineVCAnimations(vcidx, true);
crossPointerRight.DefineVCAnimations(vcidx, false);

InitFDAI(vcidx);
}
Expand Down

0 comments on commit cd4bf4a

Please sign in to comment.