Jump to content
Sign in to follow this  
zapat

rotating & moving an object at the same time (setPosASL & setPosASL2)

Recommended Posts

I have a non-simulated object (Tower).

I would like to animate its tumbling down (falling).

For this I need to rotate it and move it along a curve at the same time on each frame.

I use:

1. setPos variation

2.[] call BIS_fnc_setPitchBank

to achieve this

PROBLEM:

I need ASL move for this: falling disregards terrain, right?

When I setPosASL the object, setPitchBank will rotate it NOT around the center of the object, but the center will be waay underground, I guess at the center of the distance of the sea level !!?! I mean WTF?! Why? Edit: It is doing the same with setPosATL too. WTF ^ 2.

If I setPosASL2 the object, setPitchBank will rotate it around its center, but I cannot move the object along its X,Y by setPosASL2. I mean WTF again ?! Why doesn't it move?!

If I simply setPos the object it both moves, and rotates, but it lags and twitches a lot, even if I desregard terrain by taking getTerrainHeight into consideration. WTF again!

I know it is hard to imagine this without seeing, but maybe someone has an idea. I use an FSM for this so I cannot paste code here.

I've had this idea, maths and stuff is kinda working, but this ARMA-habit of something-not-working-again is driving me nuts tonight.

Thx for listening. :)

---------- Post added at 11:47 PM ---------- Previous post was at 11:24 PM ----------

Lol, after 5 hours of sweating, I needed to post this to discover that I needed a

_tower setDir 0;

before setPitchBank. Well, it is still interesting, since I didn't touch its direction... At least it works now, making this topic useless. Sorry.

Edited by zapat

Share this post


Link to post
Share on other sites

It's always very important to read the notes on the command wiki, anything that involves vectors like setPitchBank has an odd relationship with setDir. I know your pain well lol.

Share this post


Link to post
Share on other sites

I wouldn't use setPosASL for this. You say that you need ASL because the object is falling and it disregards terrain, but the object you are using has no physics.

Perhaps I'm not quite understanding what you want to do. I assume you want this tower to topple, like it's being demolished?

By the way, setPitchBank doesn't use vectors, it uses degrees. Also, I've always found you need to do the setDir after the setpitchbank, not before.

Edited by Tankbuster

Share this post


Link to post
Share on other sites

It works now Tankbuster, thanks.

And "topple" is the word. :)

I need ASL, because it is falling AND moving sideways at the same time along a curve AND rotating. I need to setPos it, since it doesn't have physics (no setVelocity). I cannot attach it to another object, since the top part of the TV tower is strange: it has a 100m gap in the visual, so that you can easily put it on top of the others, but this 100m gap exists in the obejct's dimensions.

I have it nailed now, and it looks fun. :) Will be a big part of my mission.

Share this post


Link to post
Share on other sites
It works now Tankbuster, thanks.

And "topple" is the word. :)

I need ASL, because it is falling AND moving sideways at the same time along a curve AND rotating. I need to setPos it, since it doesn't have physics (no setVelocity). I cannot attach it to another object, since the top part of the TV tower is strange: it has a 100m gap in the visual, so that you can easily put it on top of the others, but this 100m gap exists in the obejct's dimensions.

I have it nailed now, and it looks fun. :) Will be a big part of my mission.

Show us a vid then. :)

Share this post


Link to post
Share on other sites

Soon. Top part falling down is okay, but I just can't get the physics of the bottom part toppling: it is not accelerating realistic. :(

Share this post


Link to post
Share on other sites

Here is what I got now:

Sorted out the bottom part too, but this is a lot more fun now.

Share this post


Link to post
Share on other sites

Looks really good, nice to see a little physics applied to objects.

Out of interest is there anyway velocity x,y,z could be added, I was thinking of things tumbling out of aircraft.

This looks really good dropped from higher altitudes but there's no forward velocity.

Share this post


Link to post
Share on other sites

F2k Sel: First thing I tried was attachto to a small object (so I can add velocity to a non-simulated object via a simulated one), but these tower-parts have very unique dimensions and it didn't work. It would work with any other object though: so yes, things tumbling out of aircraft is a good idea, and I guess easily achieveable. Many objects are simulated so manipulating velocities (instead of calculating positions on every frame) make the whole thing simplier and much more universal. Still, I am afraid smooth rotation needs to be calculated on every frame... It just needs someone better in physics. :)

Edited by zapat

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×