LUA Quaternion conventions and LUA ops

Wishbone

Clueless developer
Addon Developer
Joined
Sep 12, 2010
Messages
2,420
Reaction score
2
Points
0
Location
Moscow
Three questions:

1. Is it possible to add quaternion support to Orbiter API?
2. What are the quaternion conventions I should stick to for interoperability with other folks' efforts?
3. Is it possible to define classes and overload operators in Lua (does the script used in Orbiter support the syntactic sugar for member functions)?
 
1.I think that as volume of a code for realization of quaternions so tiny that it is not meaningful to introduce it in API. Anyway in the form of the closed code.
2.Unique representation of a code of quaternions (as a part of the Orbiter's distribution kit) in project-example Dragonfly. But it is discharged of use VECTOR3 and MATRIX and besides in the Dragonfly isn't used. Nevertheless, in my opinion the project of a quaternions class - rather convenient for use, it is necessary to translate only it from vectors and matrixes difined in Dragonfly on used in Orbider API and to add a code with missing functions (formation matrixes, Euler angles from a quaternion of and other).
[Undoubtedly, quaternions have a number of advantages in the decision of a part of geometrical problems, in particular decisions on quaternions are steady against "Gimbal Lock".]
3.I think that Orbiter uses Lua in him a pure kind.In the "pure state" Lua doesn't support classes. There are additions realizing classes - as from a script (realization of classes and partially their syntax by means of scripting on "pure" Lua), and variants of change of the realization of code Lua (with introduction of a new name of language "class", allowing to import and create classes including with inheritance). But with an overload of operators I didn't meet realizations...
 
Thanks for the reply. Here's what I gleaned so far:

1. Lua has no access to the full set of API functions, hence is crippled.
2. I decided to use the Hamilton convention for quaternions (w, x, y, z) - inspired by SPICE.
3. Most of the relevant code is in Precession MFD (which is a mess) and freely available. Linking to SPICE is necessary, for the time being.
4. Right now am reading Wertz and concocting an economical attitude control scheme.
 
Back
Top