- Joined
- Jun 6, 2012
- Messages
- 317
- Reaction score
- 122
- Points
- 43
- Location
- Sydney, Australia, Earth, Sol
- Website
- www.orbithangar.com
hey guys, i am making a vessel that has a payload, but i want the payload to be rotated 180 degrees when it is jettisoned. this is what i have so far for the payload jettisoning:
i am using vs.arot to define the spawned vessel's rotation, but it is not rotated by 180 degrees, it's more just a random rotation that is close to about 50 degrees :idk: i have tried changing the srot value to {0, 1, 0} and {0, 180, 0} but neither works. any help would be much appreciated.
thanks in advance
Code:
void Pegasus::OrpheusSep (void)
{
if (OrpheusState == ATTACHED1) // Sanity check, is there a descent stage to jettison?
{
VESSELSTATUS vs;
char name[256];
VECTOR3 sofs = ORPHEUS_POS; // Seperation offset
VECTOR3 sdir = { 0, 1, 0}; // Seperation direction
double svel = 2; // Separation velocity
VECTOR3 srot = {0,180,0};
// Get vessel status structure
VECTOR3 rofs;
GetStatus (vs);
Local2Rel (sofs, vs.rpos);
GlobalRot (sdir, rofs);
vs.rvel += rofs*svel;
vs.arot = srot;
// Create descent stage as seperate vessel
strcpy (name, GetName());
strcat (name, "-Orpheus");
oapiCreateVessel (name, "ISV_PEGASUS/LANDERS/Orpheus", vs); // create descent stage vessel
DelMesh (Mesh_Orpheus);
OrpheusState = DETACHED1; // Set vessel status to ascent
}
}
i am using vs.arot to define the spawned vessel's rotation, but it is not rotated by 180 degrees, it's more just a random rotation that is close to about 50 degrees :idk: i have tried changing the srot value to {0, 1, 0} and {0, 180, 0} but neither works. any help would be much appreciated.
thanks in advance