I've been working on some code for a vessel to automatically manage the center of mass (CM). The idea is you build the vessel in "station coordinates", where you establish some origin not at the CM, then attach meshes, thrusters, airfoils, and masses to the vessel. The masses are my own contribution, and contains code like what is the CM of a cylinder, or what is the mass and CM of a solid-fueled propellant grain as it burns. From all of these masses, it calculates the CM in station coordinates, then shifts the CM accordingly. It remembers the last CM to calculate the amount of shift. You can detatch masses completely, like for a stage drop, and it does the right thing.
The code mostly works fine, the meshes and thrusters automatically move, but it doesn't seem like the airfoils do. Also touchdown points, but airfoils are more important. Is this a bug, or a missing feature in ShiftCG?
The concrete example I am working on is a sounding rocket. It has two stages and two sets of fins. I set the station origin to the tail end of the rocket, attach all the parts, then let my CM manager figure the actual CM and move it. With the station origin where it is, all the airfoils are forward of the station origin, but aft of the CM. When I calculate and shift to the center of mass, the airfoils remain forward of the CM and the rocket is unstable.
I need a way to do this. I have it mostly worked out with EditAirfoil and a bit of memory hacking to read the current airfoil attack point, but obviously that ties it to Orbiter 060929. I wonder if I missed the obvious way.
The code mostly works fine, the meshes and thrusters automatically move, but it doesn't seem like the airfoils do. Also touchdown points, but airfoils are more important. Is this a bug, or a missing feature in ShiftCG?
The concrete example I am working on is a sounding rocket. It has two stages and two sets of fins. I set the station origin to the tail end of the rocket, attach all the parts, then let my CM manager figure the actual CM and move it. With the station origin where it is, all the airfoils are forward of the station origin, but aft of the CM. When I calculate and shift to the center of mass, the airfoils remain forward of the CM and the rocket is unstable.
I need a way to do this. I have it mostly worked out with EditAirfoil and a bit of memory hacking to read the current airfoil attack point, but obviously that ties it to Orbiter 060929. I wonder if I missed the obvious way.
Last edited: