Project Orion 606

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,753
Reaction score
2,732
Points
203
Location
Dallas, TX
Well another project I am working on is this. Orion 606. It basically is taking FrancisDrake Orion_MPCV and adding new features to it.

Thinks like Beacons, HGA and round Arrays.

I might make it UMMU capable.

I have FrancisDrake's permission for this:

Questions. He uses make a vessel,....
I think another way is use attachments. It is harder to add a vessel as you have to attach the parts.

But like you jettison the SM. If the SM were a vessel the animation state and beacons would follow.

orion2016.jpg


---------- Post added 09-26-16 at 06:03 AM ---------- Previous post was 09-25-16 at 04:36 PM ----------

So this is why I think the Sm should be a separate vessel and then the CM could be attached.

Before jettison
orionsm.jpg


after jettison
orionsm1.jpg


But that leads to other issues.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,753
Reaction score
2,732
Points
203
Location
Dallas, TX
Well I made a Sm dll basically removed all the things for the whole package. So basically the animation.

So when the SM is jettison. A new vessel is created. I want the animation states to be transferred to the new vessel.
Code:
void ORION2NEW::blowSM() {
		int j = 0;
		SetMeshVisibilityMode(smMeshUINT, MESHVIS_NEVER);

		if (oapiGetTimeAcceleration() > 10)		// Slow down
			oapiSetTimeAcceleration(10);

		if (mode > 9) j++;
		SetConfig2_Reentry();

		VESSELSTATUS vs;
		char name[256] = { "" };
		THRUSTER_HANDLE th_att_lin[16];
		OBJHANDLE h;
		VESSEL *v;

		GetStatus(vs);
		vs.flag[0] = 3;
		//	VECTOR3 ofs = {0,0,-3};
		//VECTOR3 ofs = { 0, 0, -2.06 };
		Local2Rel(ofs, vs.rpos);

		VECTOR3 vel = _V(0, 0, -0.02);
		VECTOR3 rofs, rvel = { vs.rvel.x, vs.rvel.y, vs.rvel.z };
		Local2Rel(ofs, vs.rpos);
		GlobalRot(vel, rofs);
		vs.rvel.x = rvel.x + rofs.x;
		vs.rvel.y = rvel.y + rofs.y;
		vs.rvel.z = rvel.z + rofs.z;

		strcpy(name, GetName()); strcat(name, "-SM");
		h = oapiCreateVessel(name, "Orion-MPCV\\orion606-SM", vs);
		v = oapiGetVesselInterface(h);


		v->SetAnimation(anim_JOINT2, JOINT2_proc);
		v->SetAnimation(anim_JOINT1, JOINT1_proc);
		v->SetAnimation(anim_JOINT7, ARM3_proc);
		v->SetAnimation(anim_HGA, HGA_proc);



		v->SetEmptyMass(SM_DRYMASS);
		ph_RM = v->CreatePropellantResource(10.0, 10.0, 1.0);
		//  CreateThruster (_V( 0.06, 2.10, -1.49), _V(0,-0.7,-0.7), RCS_THRUST, ph_RM, RCS_ISP);
		th_att_lin[8] = v->CreateThruster(_V(0.06, 2.10, -1.49), _V(0, -0.7, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[9] = v->CreateThruster(_V(-0.06, 2.10, -1.49), _V(0, -0.7, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[10] = v->CreateThruster(_V(0.06, -2.10, -1.49), _V(0, 0.7, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[11] = v->CreateThruster(_V(-0.06, -2.10, -1.49), _V(0, 0.7, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[12] = v->CreateThruster(_V(2.10, 0.06, -1.49), _V(-0.7, 0, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[13] = v->CreateThruster(_V(2.10, -0.06, -1.49), _V(-0.7, 0, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[14] = v->CreateThruster(_V(-2.10, 0.06, -1.49), _V(0.7, 0, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[15] = v->CreateThruster(_V(-2.10, -0.06, -1.49), _V(0.7, 0, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);

		for (int i = 8; i<16; i++) {
			v->AddExhaust(th_att_lin[i], R_SIZE, tex_rcs);
			v->AddExhaustStream(th_att_lin[i], &rcs_stream);
			v->SetThrusterLevel(th_att_lin[i], 1.0);
		}

		v->SetSize(6);
		v->SetCrossSections(_V(24, 28, 19));
		v->SetCW(0.5, 0.5, 1, 1);
		if (j)  return;

		// Hack to display the solar panel around the separated RM
		GetStatus(vs);
		vs.flag[0] = 3;
		ofs = _V(0, 0, -1.87);

		Local2Rel(ofs, vs.rpos);

		vel = _V(0, 0, -0.02);
		rofs, rvel = _V(vs.rvel.x, vs.rvel.y, vs.rvel.z);
		Local2Rel(ofs, vs.rpos);
		GlobalRot(vel, rofs);
		vs.rvel.x = rvel.x + rofs.x;
		vs.rvel.y = rvel.y + rofs.y;
		vs.rvel.z = rvel.z + rofs.z;

		//strcpy(name, "S");
		//h = oapiCreateVessel(name, "Orion-MPCV\\Orion-SMS", vs); // config file of created solar panel
		//v = oapiGetVesselInterface(h);

		v->SetEmptyMass(SM_DRYMASS);
		ph_RM = v->CreatePropellantResource(7.06, 7.06, 1.0);
		th_att_lin[0] = v->CreateThruster(_V(0, 0, 0), _V(0, 0, -1), 0.703 * 8 * RCS_THRUST / 3, ph_RM, RCS_ISP);

		v->SetThrusterLevel(th_att_lin[0], 1.0);

		v->SetSize(6);
		v->SetCrossSections(_V(24, 28, 19));
		v->SetCW(0.5, 0.5, 1, 1);

		v->SetEnableFocus(false);
	}
here is the animation states:
Orion:ORION606
JOINT1 0.9303
JOINT2 0.7076
JOINT7 1.0000
MODE 2
HGA 1 1.0000
WATER 0
STATUS Orbiting Earth
RPOS -5748200.44 3750501.50 2776863.32
RVEL 1138.172 149.944 4679.066
AROT 25.62 26.13 20.51
AFCMODE 7
PRPLEVEL 0:1.000000
NAVFREQ 0 0
XPDR 468
END
Orion-SM:Orion-MPCV\orion606-SM
JOINT1 0.0000
JOINT2 0.9458
JOINT7 1.0000
MODE 0
HGA 0 0.0000
STATUS Orbiting Earth
RPOS -5748196.98 3750498.32 2776856.51
RVEL 1138.841 149.256 4677.500
AROT 25.60 26.08 20.50
AFCMODE 7
PRPLEVEL 0:0.707348 1:0.832208
THLEVEL 0:1.000000 1:1.000000 2:1.000000 3:1.000000 4:1.000000 5:1.000000
NAVFREQ 0 0
XPDR 0
END

ORIONSEP1.jpg
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,753
Reaction score
2,732
Points
203
Location
Dallas, TX
So what I did is made a SM vessel basically the same except all the no-SM stuff.

So as I see it. The code creates the SM vessel and I want the animation of the main vessel to be set in the new Sm vessel



Code:
	strcpy(name, GetName()); strcat(name, "-SM");
		h = oapiCreateVessel(name, "Orion-MPCV\\orion606-SM", vs);
		v = oapiGetVesselInterface(h);


		v->SetAnimation(anim_JOINT2, JOINT2_proc);
		v->SetAnimation(anim_JOINT1, JOINT1_proc);
		v->SetAnimation(anim_JOINT7, ARM3_proc);
		v->SetAnimation(anim_HGA, HGA_proc);
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,753
Reaction score
2,732
Points
203
Location
Dallas, TX
Not sure why this is not working.

The way it should work. Is when the Sm is jettison and new vessel is created and the old SM is not seen.

This works

BUT then what needs to happen is the animation states need to be transferred to to the new SM
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,660
Reaction score
2,381
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
BUT then what needs to happen is the animation states need to be transferred to to the new SM

Do you have a DLL for the new SM vessel? In that case, you have some options to solve it. You could use a common interface defined in a common .h file to describe functions that your new vessel provides. A dynamic_cast to the new interface from VESSEL* to "OrionSMInterface*" should work then. This should work well then, assuming both vessels are compiled with the same compiler (different compilers have the tendency to react bad on RTTI in extreme cases)

If you want to use what VESSEL3 already contains, you could use clbkGeneric. All you then need is a communication protocol. For example a struct, which contains the animation states of your vessel, that you pass to the other vessel.

You could also make the SM vessel class publicly known to the main vessel. But then you need to recompile both every time the SM vessel declaration changes. If public, you could make the animation handles public and call SetAnimation of the other vessel directly. But I really don't recommend it.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,753
Reaction score
2,732
Points
203
Location
Dallas, TX
Thanks
yES. The new Sm vessel is a dll. It is basically the same as the orion except all the other stuff got removed.

I can convert to vessel3.

So what is involved?
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,660
Reaction score
2,381
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
So what is involved?

Not much. You just need to transfer the animation state from vessel X to vessel Y, after vessel Y was created.

Ideally in a way, that does not break on the first time you refactor something.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,753
Reaction score
2,732
Points
203
Location
Dallas, TX
YES!!!!:thumbup:

What would the code look like though?
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,660
Reaction score
2,381
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
YES!!!!:thumbup:

What would the code look like though?

.... like C++? :blink:

Seriously, what are you expecting here?

I have no idea of your existing code, no idea of your needs and no idea of your project priorities.

I would just create an interface with purely virtual functions, with a syntax like that:

Code:
class MyInterface {
public:
    virtual void setSolarArrayRotation(double state) = 0;
    virtual void setSolarArrayDeployment(double state) = 0;
};

The vessel would then look like this:

Code:
class MySMVessel: public VESSEL3, public MyInterface {
    ....
public: 
    ....
    virtual void setSolarArrayRotation(double state);
    virtual void setSolarArrayDeployment(double state);
    ....
};

And then use it like that:

Code:
VESSEL* pv = oapiGetVesselInterface(objNewVessel);
MyInterface* psm = dynamic_cast<MyInterface*>(pv);
if(psm != NULL) {
    psm->setSolarArrayRotation(foo);
    psm->setSolarArrayDeployment(bar);
}

(Whoever finds a syntax error in this quickly done cheap example may keep it. I am at work right now, no Orbiter or Visual Studio near me, while writing very boring project plan documentation.)
 
Last edited:

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,753
Reaction score
2,732
Points
203
Location
Dallas, TX
Thanks. I am away also. So forgive the stupid questions.
So all 3 statements would be in both vessels?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,753
Reaction score
2,732
Points
203
Location
Dallas, TX
yes in a sense.

The main vessel basically just shows/not shows meshes depending on conditions.

So when the cm and Sm are together they are really 1 vessel. That shows the cm and Sm meshes and animations.

But when the CM and SM separate there are 2 vessels. The CM vessel now doesn't show the Sm vessel mesh. The Sm veesl is just the Sm mesh and animation

---------- Post added at 04:02 PM ---------- Previous post was at 11:31 AM ----------

This is what happens when the Sm is jettison:
Code:
void ORION2NEW::blowSM() {
		int j = 0;
		SetMeshVisibilityMode(smMeshUINT, MESHVIS_NEVER);

		if (oapiGetTimeAcceleration() > 10)		// Slow down
			oapiSetTimeAcceleration(10);

		if (mode > 9) j++;
		SetConfig2_Reentry();

		VESSELSTATUS vs;
		char name[256] = { "" };
		THRUSTER_HANDLE th_att_lin[16];
		OBJHANDLE h;
		VESSEL *v;

		GetStatus(vs);
		vs.flag[0] = 3;
		//	VECTOR3 ofs = {0,0,-3};
		//VECTOR3 ofs = { 0, 0, -2.06 };
		Local2Rel(ofs, vs.rpos);

		VECTOR3 vel = _V(0, 0, -0.02);
		VECTOR3 rofs, rvel = { vs.rvel.x, vs.rvel.y, vs.rvel.z };
		Local2Rel(ofs, vs.rpos);
		GlobalRot(vel, rofs);
		vs.rvel.x = rvel.x + rofs.x;
		vs.rvel.y = rvel.y + rofs.y;
		vs.rvel.z = rvel.z + rofs.z;

		strcpy(name, GetName()); strcat(name, "-SM");
		h = oapiCreateVessel(name, "Orion-MPCV\\orion606-SM", vs);
		v = oapiGetVesselInterface(h);


		v->SetAnimation(anim_JOINT2, JOINT2_proc);
		v->SetAnimation(anim_JOINT1, JOINT1_proc);
		v->SetAnimation(anim_JOINT7, ARM3_proc);
		v->SetAnimation(anim_HGA, HGA_proc);



		v->SetEmptyMass(SM_DRYMASS);
		ph_RM = v->CreatePropellantResource(10.0, 10.0, 1.0);
		//  CreateThruster (_V( 0.06, 2.10, -1.49), _V(0,-0.7,-0.7), RCS_THRUST, ph_RM, RCS_ISP);
		th_att_lin[8] = v->CreateThruster(_V(0.06, 2.10, -1.49), _V(0, -0.7, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[9] = v->CreateThruster(_V(-0.06, 2.10, -1.49), _V(0, -0.7, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[10] = v->CreateThruster(_V(0.06, -2.10, -1.49), _V(0, 0.7, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[11] = v->CreateThruster(_V(-0.06, -2.10, -1.49), _V(0, 0.7, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[12] = v->CreateThruster(_V(2.10, 0.06, -1.49), _V(-0.7, 0, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[13] = v->CreateThruster(_V(2.10, -0.06, -1.49), _V(-0.7, 0, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[14] = v->CreateThruster(_V(-2.10, 0.06, -1.49), _V(0.7, 0, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[15] = v->CreateThruster(_V(-2.10, -0.06, -1.49), _V(0.7, 0, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);

		for (int i = 8; i<16; i++) {
			v->AddExhaust(th_att_lin[i], R_SIZE, tex_rcs);
			v->AddExhaustStream(th_att_lin[i], &rcs_stream);
			v->SetThrusterLevel(th_att_lin[i], 1.0);
		}

		v->SetSize(6);
		v->SetCrossSections(_V(24, 28, 19));
		v->SetCW(0.5, 0.5, 1, 1);
		if (j)  return;

		// Hack to display the solar panel around the separated RM
		GetStatus(vs);
		vs.flag[0] = 3;
		ofs = _V(0, 0, -1.87);

		Local2Rel(ofs, vs.rpos);

		vel = _V(0, 0, -0.02);
		rofs, rvel = _V(vs.rvel.x, vs.rvel.y, vs.rvel.z);
		Local2Rel(ofs, vs.rpos);
		GlobalRot(vel, rofs);
		vs.rvel.x = rvel.x + rofs.x;
		vs.rvel.y = rvel.y + rofs.y;
		vs.rvel.z = rvel.z + rofs.z;

		//strcpy(name, "S");
		//h = oapiCreateVessel(name, "Orion-MPCV\\Orion-SMS", vs); // config file of created solar panel
		//v = oapiGetVesselInterface(h);

		v->SetEmptyMass(SM_DRYMASS);
		ph_RM = v->CreatePropellantResource(7.06, 7.06, 1.0);
		th_att_lin[0] = v->CreateThruster(_V(0, 0, 0), _V(0, 0, -1), 0.703 * 8 * RCS_THRUST / 3, ph_RM, RCS_ISP);

		v->SetThrusterLevel(th_att_lin[0], 1.0);

		v->SetSize(6);
		v->SetCrossSections(_V(24, 28, 19));
		v->SetCW(0.5, 0.5, 1, 1);

		v->SetEnableFocus(false);
	}

Not sure where your new code should go?
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,660
Reaction score
2,381
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Of course they are not doing the same. Its like me putting my finger in your nose. I have a finger in your nose and you have a finger in your nose, but guess which of us feel better about it.

Your CM separates the SM from it. One is active, the other is passive. And the animation states should go from the active one to the passive one.


Code:
v->SetAnimation(anim_JOINT2, JOINT2_proc);
		v->SetAnimation(anim_JOINT1, JOINT1_proc);
		v->SetAnimation(anim_JOINT7, ARM3_proc);
		v->SetAnimation(anim_HGA, HGA_proc);

This is bad. You use the animation handles for vessel A on vessel B. Can't work out. Both vessels have different animations.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,753
Reaction score
2,732
Points
203
Location
Dallas, TX
ok So on the Sm vessel which I guess would be passive. What if I change the animations name and proc to
Code:
v->SetAnimation(anim_JOINT2SM, JOINT2SM_proc);
		v->SetAnimation(anim_JOINT1SM, JOINT1SM_proc);
		v->SetAnimation(anim_JOINT7SM, ARM3SM_proc);
		v->SetAnimation(anim_HGASM, HGASM_proc);
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,660
Reaction score
2,381
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
ok So on the Sm vessel which I guess would be passive. What if I change the animations name and proc to
Code:
v->SetAnimation(anim_JOINT2SM, JOINT2SM_proc);
		v->SetAnimation(anim_JOINT1SM, JOINT1SM_proc);
		v->SetAnimation(anim_JOINT7SM, ARM3SM_proc);
		v->SetAnimation(anim_HGASM, HGASM_proc);

Noooooooooooooooooooo :facepalm:

Too easy. :lol:

Where are those animations created? Nowhere, right? They should be created in the SM vessel. And be member of the SM vessel class, since it owns them. So, you actually might like to use v->anim_JOINT1SM there for example instead of anim_JOINT1SM. But now, VESSEL does not know this member variable, your own vessel class does. So you need to cast it from the general VESSEL class to the special WhateverYouAreCallingYourSM class. And the best way to safely cast a pointer of a class to a pointer of a subclass is dynamic_cast. If v is not of your WhateverYouAreCallingYourSM class, the resulting pointer of the conversion/cast would be NULL.
 
Last edited:

francisdrake

Addon Developer
Addon Developer
Joined
Mar 23, 2008
Messages
1,099
Reaction score
934
Points
128
Website
francisdrakex.deviantart.com
With dynamic casting this coding reaches new heights of C++, I was not even aware of before! :)

What I would do (simple-minded me):
I would define a new mode of the Orion, say 99, which is the SM alone. It does not render the CM and does not add the CM's mass to the vessel.

Then after separation the vessel can be created of the same type as the parent vessel, and shall inherit all properties from the parent vessel. The v->mode is set to 99, and after the next timestep the SM-only drifts away in the same configuration as the previous complete Orion.

Of course the Orion itself must be changed to reentry mode (2), so only the CM is shown. Be aware there is COG-shift included to the mass center of the capsule, which either should be duplicated in the jettisoned SM, or the SM shall be created offset -2.06 m in z-direction.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,753
Reaction score
2,732
Points
203
Location
Dallas, TX
ok. So If I go with FrancisDrake suggestion.

Code:
void ORION2NEW::blowSM() {
		int j = 0;
		SetMeshVisibilityMode(smMeshUINT, MESHVIS_NEVER);

		if (oapiGetTimeAcceleration() > 10)		// Slow down
			oapiSetTimeAcceleration(10);

		if (mode > 9) j++;
		SetConfig2_Reentry();

		VESSELSTATUS vs;
		char name[256] = { "" };
		THRUSTER_HANDLE th_att_lin[16];
		OBJHANDLE h;
		VESSEL *v;

		GetStatus(vs);
		vs.flag[0] = 3;
		//	VECTOR3 ofs = {0,0,-3};
		//VECTOR3 ofs = { 0, 0, -2.06 };
		Local2Rel(ofs, vs.rpos);

		VECTOR3 vel = _V(0, 0, -0.02);
		VECTOR3 rofs, rvel = { vs.rvel.x, vs.rvel.y, vs.rvel.z };
		Local2Rel(ofs, vs.rpos);
		GlobalRot(vel, rofs);
		vs.rvel.x = rvel.x + rofs.x;
		vs.rvel.y = rvel.y + rofs.y;
		vs.rvel.z = rvel.z + rofs.z;

		strcpy(name, GetName()); strcat(name, "-SM");
		h = oapiCreateVessel(name, "Orion-MPCV\\orion606-SM", vs);
		v = oapiGetVesselInterface(h);

                v->mode=99;

		v->SetAnimation(anim_JOINT2, JOINT2_proc);
		v->SetAnimation(anim_JOINT1, JOINT1_proc);
		v->SetAnimation(anim_JOINT7, ARM3_proc);
		v->SetAnimation(anim_HGA, HGA_proc);



		v->SetEmptyMass(SM_DRYMASS);
		ph_RM = v->CreatePropellantResource(10.0, 10.0, 1.0);
		//  CreateThruster (_V( 0.06, 2.10, -1.49), _V(0,-0.7,-0.7), RCS_THRUST, ph_RM, RCS_ISP);
		th_att_lin[8] = v->CreateThruster(_V(0.06, 2.10, -1.49), _V(0, -0.7, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[9] = v->CreateThruster(_V(-0.06, 2.10, -1.49), _V(0, -0.7, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[10] = v->CreateThruster(_V(0.06, -2.10, -1.49), _V(0, 0.7, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[11] = v->CreateThruster(_V(-0.06, -2.10, -1.49), _V(0, 0.7, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[12] = v->CreateThruster(_V(2.10, 0.06, -1.49), _V(-0.7, 0, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[13] = v->CreateThruster(_V(2.10, -0.06, -1.49), _V(-0.7, 0, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[14] = v->CreateThruster(_V(-2.10, 0.06, -1.49), _V(0.7, 0, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[15] = v->CreateThruster(_V(-2.10, -0.06, -1.49), _V(0.7, 0, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);

		for (int i = 8; i<16; i++) {
			v->AddExhaust(th_att_lin[i], R_SIZE, tex_rcs);
			v->AddExhaustStream(th_att_lin[i], &rcs_stream);
			v->SetThrusterLevel(th_att_lin[i], 1.0);
		}

		v->SetSize(6);
		v->SetCrossSections(_V(24, 28, 19));
		v->SetCW(0.5, 0.5, 1, 1);
		if (j)  return;

		// Hack to display the solar panel around the separated RM
		GetStatus(vs);
		vs.flag[0] = 3;
		ofs = _V(0, 0, -1.87);

		Local2Rel(ofs, vs.rpos);

		vel = _V(0, 0, -0.02);
		rofs, rvel = _V(vs.rvel.x, vs.rvel.y, vs.rvel.z);
		Local2Rel(ofs, vs.rpos);
		GlobalRot(vel, rofs);
		vs.rvel.x = rvel.x + rofs.x;
		vs.rvel.y = rvel.y + rofs.y;
		vs.rvel.z = rvel.z + rofs.z;

		//strcpy(name, "S");
		//h = oapiCreateVessel(name, "Orion-MPCV\\Orion-SMS", vs); // config file of created solar panel
		//v = oapiGetVesselInterface(h);

		v->SetEmptyMass(SM_DRYMASS);
		ph_RM = v->CreatePropellantResource(7.06, 7.06, 1.0);
		th_att_lin[0] = v->CreateThruster(_V(0, 0, 0), _V(0, 0, -1), 0.703 * 8 * RCS_THRUST / 3, ph_RM, RCS_ISP);

		v->SetThrusterLevel(th_att_lin[0], 1.0);

		v->SetSize(6);
		v->SetCrossSections(_V(24, 28, 19));
		v->SetCW(0.5, 0.5, 1, 1);

		v->SetEnableFocus(false);
	}

and the vessel it creates is a similar dll with basically the mesh and animations, right

---------- Post added at 04:47 AM ---------- Previous post was at 04:41 AM ----------

Noooooooooooooooooooo :facepalm:

Too easy. :lol:

Where are those animations created? Nowhere, right?



They should be created in the SM vessel. And be member of the SM vessel class, since it owns them. So, you actually might like to use v->anim_JOINT1SM there for example instead of anim_JOINT1SM.

The animations are created in both vessels. I thought you said they needed to be different names?

originally in both vessel animations were created. So they were a copy. So when the new vessel was created the animation info would be told to it.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,753
Reaction score
2,732
Points
203
Location
Dallas, TX
Ok on the copy part. We have the main vessel Orion606. I just copied the whole dll and renamed it to orion606sm. removed unnecessary items for the sm.

"What does that? "

that is the issue.
I thought this told the new created SM vessel what values for it to be?
Code:
h = oapiCreateVessel(name, "Orion-MPCV\\orion606-SM", vs);
		v = oapiGetVesselInterface(h);

Code:
v->SetEmptyMass(SM_DRYMASS);
		ph_RM = v->CreatePropellantResource(10.0, 10.0, 1.0);
		//  CreateThruster (_V( 0.06, 2.10, -1.49), _V(0,-0.7,-0.7), RCS_THRUST, ph_RM, RCS_ISP);
		th_att_lin[8] = v->CreateThruster(_V(0.06, 2.10, -1.49), _V(0, -0.7, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[9] = v->CreateThruster(_V(-0.06, 2.10, -1.49), _V(0, -0.7, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[10] = v->CreateThruster(_V(0.06, -2.10, -1.49), _V(0, 0.7, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[11] = v->CreateThruster(_V(-0.06, -2.10, -1.49), _V(0, 0.7, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[12] = v->CreateThruster(_V(2.10, 0.06, -1.49), _V(-0.7, 0, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[13] = v->CreateThruster(_V(2.10, -0.06, -1.49), _V(-0.7, 0, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[14] = v->CreateThruster(_V(-2.10, 0.06, -1.49), _V(0.7, 0, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);
		th_att_lin[15] = v->CreateThruster(_V(-2.10, -0.06, -1.49), _V(0.7, 0, -0.7), RCS_THRUST / 3, ph_RM, RCS_ISP);

		for (int i = 8; i<16; i++) {
			v->AddExhaust(th_att_lin[i], R_SIZE, tex_rcs);
			v->AddExhaustStream(th_att_lin[i], &rcs_stream);
			v->SetThrusterLevel(th_att_lin[i], 1.0);
		}

		v->SetSize(6);
		v->SetCrossSections(_V(24, 28, 19));
		v->SetCW(0.5, 0.5, 1, 1);
		if (j)  return;

tells the new vessel to make rcs,....
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,660
Reaction score
2,381
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
tells the new vessel to make rcs,....

Make it again. It is the same vessel class, you just manipulate it from outside. ovcInit, constructor, clbkSetClassCaps and clbkSetStateEx and clbkPostCreation have already been called for that vessel.
 
Top