SetCenteralForce() for hovercraft-like effect?

I mean, personally I would use “math” and not “animation” in the JME com.jme3.anim* sense. I was using the term more generally.

A control that just randomly rotated the spatial slightly, adjusted it up/down, etc…

I don’t think you understand. I wasn’t talking about the hovering motion, I was talking about how to apply a constant force.

If you use your method of deltaTime, each frame time is added up. The first time may be 0.72648, the second time may be 0.71142 and so on. This means it’s basically any time after 0.7 and will jump all over the place as it “randomly” gets impulses.

To simulate up and down motion you’d animate the force, not the model.

Use a smoothstep or linear function to animate the force up and down slightly.

Hmm okay, just set the physics location up a bit / down… will try that

For me, spatial location and physics location are not really the same thing so I always have some latitude.

…if you carefully control (hah) the order of your controls, it’s not hard to do with regular JME stuff either.

But try Jay’s advice first because maybe you can just get it to work right anyway.

Okay, I tried to do setLinearVelocity(new Vector3f(0, 450 * tpf, 0) when deltaTime is greater than 1, its kind of bouncing up now… I will try tinkering with the numbers so it stays slightly above ground before gravity takes over

No no the hover effect by moving an inner node sounds a lot easier tbh.

Why when deltaTime > 1? Just remove deltaTime completely.

Well then it just goes straight up till infinty

Because you’re applying a linear force and not an impulse :confused:

I’ll let you play. There’s a lot of information to take in.

It seems to be doing the same thing with an impulse. If the impulse is 50 * tpf it goes up with no animation. If its 10 it doesnt move at all…

If I don’t set a deltaTime for that, it simply goes up and beyond, the lower the number I put next to tpf, the slower it goes up

So my gravity is -9.8f, I basically want it to “hover” so it needs to be more than 9.8f, but then I want gravity to come back in action to lower it

If you increase the weight you’ll increase the perceived scale of force required.

E.g if the weight is 1kg the amount of force will be between 1-2 or whatever. But at 100kg it will be between 100 and 200.

Weight is 2, thats probably the reason of the impulse not working. I will fix that and see if it works

Hmm… problem is impulse w/o delta is giving me smooth movement, not the jerky up/down for a hovercraft

I just mean that instead of having minute scales to fiddle with, increase the scale so you have more perceived range to toy with.

Ah… so impulses won’t do it, then… at least w/o delta… Delta is nessecary so that gravity has time to “push” it down

Basically the impulse should go up, then in the time that deltatime builds up, gravity cancels out what impulse did

I mean if it works then go with it. But given that deltaTime is in effect random because frame times change every frame, I’d probably set a base force, where it isn’t quite sufficient enough to raise, and add a force that animates up and down to it.

For me it just eliminates the randomness of DeltaTime.

I will try. It works (w/ delta time) but the thing is… if I move it down too low so that it touches the ground, weird thing happen…

Is there a way to “prevent” the turnovers that happen when I collide with an object?

Limit angularVocity.

Edit: I mean physicsRotation.

Sorry for late reply, it works, I limit it with quaternine with (0, 0, 0) from angles but now the corners go insde of the terrain and it wobbly a ton… Can I somehow find the distance from the ground to the center of object? And similarly from alll the other sides as well… so that if the distance is less than 0.5 or similar, apply a force away

Going to try collision listeners, but I’m not sure where to apply the force(which direction)