• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Distance controlled animations

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
34,536
Country
netherlands
Over this weekend I did some tests with distance controlled animations for hangar doors. We already knew that the 033B distance to RefPoint variable was actually the distance from the viewpoint to the RefPoint of the scenery. This means that in spot plane view your animation might trigger or un-trigger while your aircraft itself is not moving.

Therefore I tested the distance along the axis variables, to see if they solved this problem. Unfortunately they also seem to be from the viewpoint and not from the RefPoint of the aircraft.

This means that it does not seem possible to make a truely distance triggered animation, that also works correctly when going to spot plane view.

Have others also noticed this or do you maybe have an idea to solve this?
 
Hi Arno.

I don't know how easy it would be to implement this:

Could you use the IfInBox commands, and further control them by the plane0heading ( 01bbah )?

Dick
 
Hi Dick,

That is a good idea, I could use the IFINBOX command instead of using the variables directly. I don't even think that the plane heading is need then, as long as the box is defined on the correct location.

Do other designers also think this would be useful (so to have a correctly working distance check)? Then I cna build it into CAT, otherwise I will just tweak my ASM files by hand :D.
 
Hi Arno,


I don't know what you mean by an IFINBOX, but I've that is a right way to check the distance, I'm sure that I and many people will find that very usefull. So I think it is worth the time, to put in into cat :cat:
 
Go for it Arno. Hangers would work very well... May I also compliment Dick on the idea!
 
I will, but after my initial reaction I realised that it would not only be needed for the animation condition, but also for the trigger. So I have to look how I can fit that into the GUI. Will probably need to add an option that allows you to specify the minimum and maximum values of the x, y and z of the bounding box.
 
Yup, you need the ifinbox also for the trigger. That's why my jetways didn't work at the beginning of my animation journey...
It's just ideal to define a box fitting the gate position as a supplement to a trigger, so only that and no other jetway will move.
I also tried it with refpoint variables, and yes, when viewing from spot view, everything went :banghead:

But which ifinbox commant shall we use? Referring to the FS2000 sdk there are:

BGL_IFIN_BOX_RAW_PLANE
BGL_IFIN_INSTANCED_BOX_PLANE
BGL_IFINBOXP

The latter is the best candidate in my opinion, as it takes the current refpoint with its heading.
Problem with all those box commands is rotation when the object's refpoint isn't equal to the center of the box. you have to move and turn the box with some trigonometry. I attached a sketch to illustrate it...




But a question, because of XML the placement isn't done explicitly in our source codes, do those commands mentioned above take the refpoint info from the xml file or not??

And can someone confirm that those commands are "spot plane view - safe" ;)

Jeff
 

Attachments

  • rotation.JPG
    rotation.JPG
    23.5 KB · Views: 739
Hi Jeff,

Jeffrey Stähli said:
It's just ideal to define a box fitting the gate position as a supplement to a trigger, so only that and no other jetway will move.

Yes, in that case you will use the IFINBOX command as the animation condition, while using another variable as trigger. But for hangar doors for example it might be nice to use the IFINBOX as trigger, so it is needed for both.

Jeffrey Stähli said:
I also tried it with refpoint variables, and yes, when viewing from spot view, everything went :banghead:

Good, that confirms what I found as well :).

Jeffrey Stähli said:
The latter is the best candidate in my opinion, as it takes the current refpoint with its heading.

I think that is not a big problem I our case, the the entire MDL object is rotated when placing. Then the box should move with it, but I will have to test this first of course :).


Jeffrey Stähli said:
Problem with all those box commands is rotation when the object's refpoint isn't equal to the center of the box. you have to move and turn the box with some trigonometry. I attached a sketch to illustrate it...

Cool, maths :D. I don't think this is needed however. Almost every object will be designed along one of the axis of GMax. I don't think maybe people do design their object at a strange angle in GMax. So you can just define the box along these axis as well then. That the object starts moving later on, your gate for example, should not influence the animation condition or trigger, as long as the plane stays in the box we defined. Or do you think there is a good case where it could be needed?

Jeffrey Stähli said:
But a question, because of XML the placement isn't done explicitly in our source codes, do those commands mentioned above take the refpoint info from the xml file or not??

I will test this of course, but I think it just takes the 0,0 point as defined in GMax as reference point. The only thing the XML code does is to link this 0,0 point in the local axis to a latitude and longitude in the world.

Jeffrey Stähli said:
And can someone confirm that those commands are "spot plane view - safe" ;)

I guess I will test that first, before starting to code CAT. Should be easy to do, it I just tweak my hangar code a little bit :). I will report back on this. But I have used similar code in my Bumpy tool and that seems to be spot plane safe.
 
Then the box should move with it, but I will have to test this first of course

hehe, let's hope that they do ;) so all that math isn't required.
I thought that the box is not transformed and rotated automatically when setting the objects heading in the xml. But that's just a unproven statement... :D I'll test that one as well.

Laters,
Jeff
 
Ok, i did some tests...

I set up a small gmax object with a red cube and a green pole. The pole will change its color from green to red if the aircraft is in a specified checkbox (IFIN_BOX_PLANE). The object's refpoint is the center of the pole, so the red box is offset.

I placed 2 of those scenes in the fs world with xml: one is just at heading 000, the other one is rotated by 060( and a bit further east).

The results.
By that occasion, I also checked the spot-view refpoint problem...and hooray, the box command is "spot view safe" :)

The following images are taken at the north oriented box (hdg 000).
outside.jpg

inside.jpg


Here a top down view:
box1hdg000.jpg


Now, the rotated box...
box1hdg060.jpg


Hmm, let's search the trigger spot ...ahhh, there it is!!!
box1hdg060virtual.jpg


I tested it also with IFIN_INSTANCED_BOX_PLANE and IFINBOXP...same results...( I hoped the rotation is read by the commands....nope..)

So then, we have to transform and rotate the ifinbox's center point separately if the object isn't oriented to 000°!

so if we rotated the object by 60°, we have to set the ifinbox values manually

Then it should work again at the expected spot!

phew, I hope it makes sense :D
Arno, I hope you have the same results with your tests...

Jeff

EDIT: calculations were wrong, so back to drawing board :scratchch
 
Last edited:
Hi Jeff,

Thanks for the testing. I am at the university now, but when I get home this evening I will do some tests as well. But at this moment it seems we need some maths as well, should be fun :).

I do also remember that there is a new Fs2004 command to check the position of the plane, I will look into that as well (can't remember it exactly, so will have to look it up).
 
Did you get any result by this problem?
I also wanted to use this variant and can not rotate the object:(
 
No, there does not seem to be a way around this, you will have to define the bounding box/condition check so that it is made for the heading at which your final object will be placed. It does not respond to the heading of your XML file.
 
Is there a possibility to tweak a animated model only by visible yes and no. I need to make a complex model with several animations in dependancy of my position.
 
Hi Christoph,

Yes, that is possible. But when you want to apply the condition on the whole object and not on the animation itself CAT is not really the best tool to use. You can better use MDL Tweaker in that case.
 
But in Mdl Tweaker I do not have the functionality of bounding box?
In Object statistics I found something with bounding box.
Can I change this?
If Yes, does this effect the angle in XML? Or does it again work only with angle 0?
Thanks
 
Hi Christoph,

No, that other bounding box is no condition. That indicates the size of the object and is used to optimize the performance. If you enter anything but the optimal solution there you will get trouble.

Good point that there is no bounding box condition in MDL Tweaker. You will have to use multiple condition then with the distance along the X, Y and Z axis to get the same result.
 
Back
Top