Problem Docking port wrong rotations in Orbiter

Zatnikitelman

Addon Developer
Addon Developer
Joined
Jan 13, 2008
Messages
2,302
Reaction score
6
Points
38
Location
Atlanta, GA, USA, North America
I'm working on my truss system, and the docking ports for the pallets are along the sides of the trusses (flat sides of regular hexagons, two sides pointing vertically). However, for some reason, I've got one docking port definition that when a vessel is docked, is rotated in a crazy manner, not consistent with other similarly-defined docking ports.

This is how it should look: https://dl.dropboxusercontent.com/u/8017682/Orbiter/GOOD.jpg

This is how it actually looks: https://dl.dropboxusercontent.com/u/8017682/Orbiter/BAD.jpg

and which I undock the pallet, it instantly snaps to this, before floating away on the correct directional vector: https://dl.dropboxusercontent.com/u/8017682/Orbiter/STILLBAD.jpg

With dbeachy1's help, I boiled down my docking port definitions to only this. To be clear, this is the ONLY call to CreateDock found anywhere in my code right now.
Code:
CreateDock(_V(-2.25,0.916735,-0.654291),_V(0.0,0.5,-0.866025),_V(0.0,0.866025,0.5));

When I do have other docking ports however, they use the same numbers, only with changes to the signs of the coordinates, DIR and ROT vectors, and a change in the X-value. The truss's long-axis is the X-axis. I'm particularly hoping someone can determine if the DIR and ROT vectors are indeed perpendicular to each other. I've checked and re-checked, and the vectors do indeed appear to be normalized.

Thanks for any help in figuring this madness out.
Matt
 

Hielor

Defender of Truth
Donator
Beta Tester
Joined
May 30, 2008
Messages
5,580
Reaction score
2
Points
0
Wait, that's the only call to CreateDock, or you have six calls to CreateDock?

If you have six, post them all.
 

Hielor

Defender of Truth
Donator
Beta Tester
Joined
May 30, 2008
Messages
5,580
Reaction score
2
Points
0
OIC, so you only have the problematic port remaining.

Which side of the truss is this supposed to be?
 

Zatnikitelman

Addon Developer
Addon Developer
Joined
Jan 13, 2008
Messages
2,302
Reaction score
6
Points
38
Location
Atlanta, GA, USA, North America
It's supposed to be on the other side, but flat on it:
https://dl.dropboxusercontent.com/u/8017682/Orbiter/TheSide.jpg

However, I've discovered new behavior. Updating the orientation of the truss, does not affect the orientation of the pallet. HOWEVER, when I alter the orientation of the pallet through scenario editor, it will snap onto the dock, and then orientation changes will be effected like normal.
 

Zatnikitelman

Addon Developer
Addon Developer
Joined
Jan 13, 2008
Messages
2,302
Reaction score
6
Points
38
Location
Atlanta, GA, USA, North America
And some new information. Thanks to tl8 helping with this, I was reminded that the cross product of the DIR and ROT vectors should be a vector of magnitude 1. Some of the numbers I was playing with did indeed not meet this requirement, and usually resulted in a vector of magnitude of 0.5. However, after making one docking port (thanks to Loru), I moved onto the next one, and it's still giving the weird behavior, DESPITE meeting the property above. What else could be going wrong with this?
 

Quick_Nick

Passed the Turing Test
Donator
Joined
Oct 20, 2007
Messages
4,088
Reaction score
204
Points
103
Location
Tucson, AZ
And some new information. Thanks to tl8 helping with this, I was reminded that the cross product of the DIR and ROT vectors should be a vector of magnitude 1. Some of the numbers I was playing with did indeed not meet this requirement, and usually resulted in a vector of magnitude of 0.5. However, after making one docking port (thanks to Loru), I moved onto the next one, and it's still giving the weird behavior, DESPITE meeting the property above. What else could be going wrong with this?

The numbers you posted are just fine as far as being unit vectors and perpendicular to each other. (cross product with length 1 is just for double-checking)

I feel like it may be a problem with Orbiter, but I don't know what. The fact that it adjusts to the exact correct orientation when you use Scenario Editor seems to indicate the problem isn't with your vectors, and throws out all kinds of logic.
Check your code all around the problematic line. On occasion, I've improperly placed braces for example and ended up with code that functions roughly correctly but might unintentionally be part of a loop or something like that.
 

Zatnikitelman

Addon Developer
Addon Developer
Joined
Jan 13, 2008
Messages
2,302
Reaction score
6
Points
38
Location
Atlanta, GA, USA, North America
tl8 gave me a good idea to try putting the docking port definition in a .cfg file instead of leaving it in the .dll. I STILL get the same weird result. Here's the .cfg file:
Code:
; === Configuration file for vessel class truss === 
ClassName = truss 
module = OrbiterTruss 

BEGIN_DOCKLIST 
-2.25 0.916735 0.654291 0 0.5 0.866025 0 0.866025 -0.5 
END_DOCKLIST

tl8 also suggested to try it out with attachment points. So I tried it both using attachment points coded in the .dll as well as the .cfg file, and the attachment points were right, I didn't get the weird offset and angled results from using the docking ports. Does anyone have any experience with oddly-angled docking ports in Orbiter?
 
Last edited:
Top