[0.4.6] Drawing.AddDirection() behavior doesn't match documentation
panourgue opened this issue ยท 1 comments
Draw a direction vector in the scene, from the center of mass of the active vessel.
Let's try:
var conn = new Connection ("Drawing");
var spaceCenter = conn.SpaceCenter ();
var targetRF = spaceCenter.TargetVessel.ReferenceFrame;
conn.Drawing ().AddDirection (
Tuple.Create (0d, 1d, 0d), // Up direction
targetRF,
2);
);
I would expect line from the CoM of the active vessel:
But AddDirection() simply draws a vector (argument 1) in the supplied ReferenceFrame (argument 2):
To actually get what we want, we have to:
var activeRF = spaceCenter.ActiveVessel.ReferenceFrame;
conn.Drawing ().AddDirection (
spaceCenter.TransformDirection (Tuple.Create (0d, 1d, 0d), targetRF, activeRF),
activeRF,
2
);
Or, even better:
var activeRF = spaceCenter.ActiveVessel.ReferenceFrame;
conn.Drawing ().AddDirection (
Tuple.Create (0d, 1d, 0d),
ReferenceFrame.CreateHybrid (conn, activeRF, targetRF),
2
);
P.S. Or am I misunderstanding something?