I've got two little bits of custom XML animation tag code that I'm trying to get working and they're driving me crazy.The first one is a simple mechanical angle-of-attack vane mounted on the nose pitot. Originally I had it set up to use the AOA needle code, but it was always parallel to the ground. It should always be pointing in the direction of travel. I've tried to do that using forward and vertical speed to derive a 2D vector and then taking the arctangent and adjusting it to a 0-180 range instead of -90 to 90, but I'm having a heck of a time getting the atg operator to work.The AOA vane object is keyed from 0-180, with 0 straight down and 180 straight up. I'm not worried about the 180 degree arc to the rear, so I just blocked out negative values of horizontal momentum by taking the absolute value (the plane should never be falling or climbing backwards, anyhow). Here's the code I have so far...
<PartInfo> <Name>needle_pitch_vane</Name> <AnimLength>180</AnimLength> <Animation> <Parameter> <Code>((A:VELOCITY BODY Y, ft/sec) ((A:VELOCITY BODY Z, ft/sec) abs) /) atg rddg 90 +</Code> </Parameter> </Animation> </PartInfo>
At first I didn't have the rddg (radians to degrees) operator in there, but all the other trig functions output in rads and I'm guessing atg does as well. The problem is I'm guessing it also needs input in radians like the other trig functions, and I need it to give me the arctangent of the slope of the line (vert speed)/(absolute value of(horiz speed)). I don't know quite enough trig to take the two speed vectors and do my computations with a result in radians to make the atg operator happy.The other animation I'm trying to do just needs to take a 100 frame loop and scale up the animation speed based on airspeed, so the faster the aircraft goes, the faster the animation loops. I tried using the fly_wheel animation tag but it doesn't seem to be functional.Any help would be fantastic. Thanks in advance!