Advanced Question Forcing Vessel position change

BruceJohnJennerLawso

Dread Lord of the Idiots
Addon Developer
Joined
Apr 14, 2012
Messages
2,585
Reaction score
0
Points
36
Hello all,

Currently working on this right now:

http://www.orbiter-forum.com/showthread.php?t=32521

My idea is roughly like this:

-Camera vessel has a char * sequence that it uses to check the objects list for a match, then returns the appropriate ObjectHandle.
-ObjectHandle is used to retrieve the global position vector of the target object, then any transformations will be applied to it (ie motion around the cameras target object)
-Then the Camera vessel forces its position to the targets globalpos vector + whatever transformations are wanted

The part Im unsure about is how to force that position change. Ive been reading through the vessel API, but I'm not sure of the best option so far.

Code:
	bool SetElements (OBJHANDLE hRef, const ELEMENTS &el, ORBITPARAM *prm = 0, double mjd_ref = 0, int frame = FRAME_ECL) const;

looks like it might work, but that would force me to use an ELEMENTS struct, which wont allow me to work with the position vector format like I want to. Is there a better way to do this?

:hailprobe:
 

Izack

Non sequitur
Addon Developer
Joined
Feb 4, 2010
Messages
6,665
Reaction score
13
Points
113
Location
The Wilderness, N.B.
DefSetState/DefSetStateEx would be best in this case, I believe. You can set the position literally this way.
 
Top