Skip to content

Commit

Permalink
Merge pull request orbiternassp#594 from jalexb88/CMVC
Browse files Browse the repository at this point in the history
CMVC: Remove bad call in SetStage; Fix offset definitions in Register…
  • Loading branch information
indy91 authored Mar 31, 2021
2 parents 60f3765 + 8aad305 commit 372ec7f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 20 deletions.
1 change: 1 addition & 0 deletions Orbitersdk/samples/ProjectApollo/src_csm/ecs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,7 @@ SaturnSideHatch::SaturnSideHatch(Sound &opensound, Sound &closesound) :
open = true; // Hatch open at prelaunch
toggle = 0;

sidehatch_state.SetState(1.0, 0.0);
sidehatch_state.SetOperatingSpeed(0.2);
anim_SideHatchVC = -1;
anim_gearboxsel = -1;
Expand Down
2 changes: 0 additions & 2 deletions Orbitersdk/samples/ProjectApollo/src_csm/saturn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2594,8 +2594,6 @@ void Saturn::SetStage(int s)
CheckSMSystemsState();
CheckSaturnSystemsState();

if (InVC) RegisterActiveAreas();

//
// Event management
//
Expand Down
47 changes: 29 additions & 18 deletions Orbitersdk/samples/ProjectApollo/src_csm/saturnvc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ bool Saturn::clbkLoadVC (int id)
case SATVIEW_LEFTDOCK:
viewpos = SATVIEW_LEFTDOCK;
SetCameraMovement(_V(0.0, 0.0, 0.0), 0, 0, _V(0.0, 0.0, 0.0), 0, 0, _V(0.0, 0.0, 0.0), 0, 0);
oapiVCSetNeighbours(-1, -1, -1, SATVIEW_LEFTSEAT);
oapiVCSetNeighbours(-1, SATVIEW_RIGHTDOCK, -1, SATVIEW_LEFTSEAT);
SetCOASMesh();
SetView(true);

Expand All @@ -788,7 +788,7 @@ bool Saturn::clbkLoadVC (int id)
case SATVIEW_RIGHTDOCK:
viewpos = SATVIEW_RIGHTDOCK;
SetCameraMovement(_V(0.0, 0.0, 0.0), 0, 0, _V(0.0, 0.0, 0.0), 0, 0, _V(0.0, 0.0, 0.0), 0, 0);
oapiVCSetNeighbours(-1, -1, -1, SATVIEW_RIGHTSEAT);
oapiVCSetNeighbours(SATVIEW_LEFTDOCK, -1, -1, SATVIEW_RIGHTSEAT);
SetView(true);

return true;
Expand Down Expand Up @@ -843,23 +843,34 @@ void Saturn::RegisterActiveAreas() {
int i = 0;

VECTOR3 ofs = _V(0.0, 0.0, 0.0);
if (vcidx != -1) GetMeshOffset(vcidx, ofs);

/*if (stage < 12) {
ofs.z = 43.65;
} else if (stage < 20) {
ofs.z = 28.5;
} else if (stage < 30) {
ofs.z = 15.25;
} else if (stage < 40) {
ofs.z = 2.1;
} else if (stage < 42) {
ofs.z = 0.0;
} else {
ofs.z = -1.2;
}*/

//sprintf(oapiDebugString(), "OFS %lf", ofs.z);
if (SaturnType == SAT_SATURNV) {
if (stage < 12) {
ofs.z = 43.65;
} else if (stage < 20) {
ofs.z = 28.5;
} else if (stage < 30) {
ofs.z = 15.25;
} else if (stage < 40) {
ofs.z = 2.1;
} else if (stage < 42) {
ofs.z = 0.0;
} else {
ofs.z = -1.2;
}
} else {
if (stage < 12) {
ofs.z = 35.15;
} else if (stage < 30) {
ofs.z = 22.9;
} else if (stage < 40) {
ofs.z = 2.1;
} else if (stage < 42) {
ofs.z = 0.0;
} else {
ofs.z = -1.2;
}
}

//
// Register active areas for switches/animations here
Expand Down

0 comments on commit 372ec7f

Please sign in to comment.