satelliteGuy
New member
- Joined
- Feb 25, 2010
- Messages
- 10
- Reaction score
- 0
- Points
- 0
I'm trying to directly position with keys a spacecraft in the earth's orbit on a geostationary position. Somehow all my attempts have failed.
My approach: use clbkPostStep:
void StationaryOrbit::clbkPostStep (double simt, double simdt, double mjd)
OBJHANDLE earthHandle = oapiGetGbodyByName ( "Earth" );
MATRIX3 earthRotInGlobal;
MATRIX3 earthAxisRotation;
VECTOR3 earthPos;
double earthRotation;
oapiGetPlanetObliquityMatrix ( earthHandle, &earthRotInGlobal );
oapiGetGlobalPos ( earthHandle, &earthPos );
earthRotation = oapiGetPlanetCurrentRotation ( earthHandle );
earthAxisRotation.m11 = cos ( earthRotation );
earthAxisRotation.m12 = 0;
earthAxisRotation.m13 = -sin ( earthRotation );
earthAxisRotation.m21 = 0;
earthAxisRotation.m22 = 1;
earthAxisRotation.m23 = 0;
earthAxisRotation.m31 = sin( earthRotation );
earthAxisRotation.m32 = 0;
earthAxisRotation.m33 = cos ( earthRotation );
VESSEL2STATUS status;
status.rbody = earthHandle;
status.arot = status.vrot = status.rvel = _V (0,0,0);
status.rpos = mul ( earthRotInGlobal, mul ( earthAxisRotation, targetPositionInEarthCoordinateSystem ) );
status.version = 2;
status.status = 0;
clbkSetStateEx ( &status );
}
Now, the earth sould NOT rotate underneath my satellite - but it still does. What am I doing wrong? I don't want Orbiter to simulate the orbit, I would like to control the position myself (like position that thing anywhere). I am fully aware that I'm trying to override Orbiter's simulation capabilities, but this is kind of a test to visualize trajectories provided from other sources.
Any help is appreciated.
My approach: use clbkPostStep:
void StationaryOrbit::clbkPostStep (double simt, double simdt, double mjd)
OBJHANDLE earthHandle = oapiGetGbodyByName ( "Earth" );
MATRIX3 earthRotInGlobal;
MATRIX3 earthAxisRotation;
VECTOR3 earthPos;
double earthRotation;
oapiGetPlanetObliquityMatrix ( earthHandle, &earthRotInGlobal );
oapiGetGlobalPos ( earthHandle, &earthPos );
earthRotation = oapiGetPlanetCurrentRotation ( earthHandle );
earthAxisRotation.m11 = cos ( earthRotation );
earthAxisRotation.m12 = 0;
earthAxisRotation.m13 = -sin ( earthRotation );
earthAxisRotation.m21 = 0;
earthAxisRotation.m22 = 1;
earthAxisRotation.m23 = 0;
earthAxisRotation.m31 = sin( earthRotation );
earthAxisRotation.m32 = 0;
earthAxisRotation.m33 = cos ( earthRotation );
VESSEL2STATUS status;
status.rbody = earthHandle;
status.arot = status.vrot = status.rvel = _V (0,0,0);
status.rpos = mul ( earthRotInGlobal, mul ( earthAxisRotation, targetPositionInEarthCoordinateSystem ) );
status.version = 2;
status.status = 0;
clbkSetStateEx ( &status );
}
Now, the earth sould NOT rotate underneath my satellite - but it still does. What am I doing wrong? I don't want Orbiter to simulate the orbit, I would like to control the position myself (like position that thing anywhere). I am fully aware that I'm trying to override Orbiter's simulation capabilities, but this is kind of a test to visualize trajectories provided from other sources.
Any help is appreciated.