July 21, 200619 yr Commercial Member This is really a follow-on from my last post, Grabbing Mouse Co-ordinates. I'm still trying to get a hold of this ASI's speedbugs to rotate them via MOUSE_LEFTDRAG. I've got the actual maths in place to calculate the rotaional movement from the x and y co-ordinates and I know where the mouse cursor is on the instrument background. I can't find anything useful in the MAKE_NEEDLE pelement->struct to tell me where the needle is.... but I did find the rather odd fact that pelement->save_position.x (or y) divides the instrument face into quadrants of 64x64, regardless of any other measurement (bitmap, gauge size etc).Arne: if you're reading; you once gave me this code from an ATR-42 ASI but I've lost a complete CD full of all my FS2K/2K2 source code somewhere through the years and that was on it.... :(-Dai
July 22, 200619 yr I'll dig around. Are you sure you really need the actaul position? For speed bugs you can work without the actual position. Assume a speed bug as ELEMENT_NEEDLE showing a custom value. In the mouse function you can calculate angle and distance to the pivot point of the gauge, if angle and distance are near the speed bug you can "pick up and move" the speed bug by setting the angle from mouse position to the custom variable. In my ATR-42 ASI I decided to make that unnecessary complicated by using the actual speed as a variable not the angle on the gauge. So reverse lookup with nonlinearity tables was included. However I'll send the code as soon as I find it.
July 22, 200619 yr Author Commercial Member >In the mouse function you can calculate angle and distance to the pivot point of the gauge, if angle and distance are near the speed bug you can "pick up and move" the>speed bug by setting the angle from mouse position to the custom variable.Yaargghhh!!!! I was so obsessed with grabbing within the boundary box of the speedbug that I totally overlooked the obvious. I've already written that code to calculate the rotational angle from the x and y pixels.... :-bang Thanks Arne!-Dai
Create an account or sign in to comment