I am currently working on my first UE4 project. The goal is to develop some physically correct flight mechanics for a helicopter.
The current model is working but feels quite arcade-ish. Here is what my blueprint does:
Lift
Every tick, a force is added to my object in the direction of the rotor. The amount is calculated based on the user input and an offset which should counterbalance gravity.
The offset obviously only helps when the helicopter isn’t tilting so the rotor generate lift in the +Z direction.
Drag
Based on the current velocity and the mass, I calculate how much drag needs to be applied. I don’t have the shape taken into acount currently. Mass and Vecloity get multiplied, together with a drag coefficient and inversed.
The vector gets added with “add force” so it’s basicly a force like the lift.
Rotation
This is my main problem currently. I “magicly” rotate my helicopter and hope that nobody notices. ;D The rotation is done with the rotor as well in real life. Some blades of the rotor are pitched down while the others are pitched up so the rotor generates lift
upwards with one half and downwards with the other half. Because of this, the rotor wants to rotate and the body rotates as well. The problem here is that because of the mass of the body, the center of rotation isn’t the center of the body or the center of the rotation but somewhere in between. Currently, I use “set Physics angular velocity” to add a rotation to the helicopter but I don’t know where this function takes it’s center from. Is there a way to change the center?
Even cooler would be to actualy simulate the behaviour I’ve explained above. Does UE4 include some way of simulating a force generated at specific points of the object? So I would generate an rotation force at the rotor and the mass of the body would help moving the center of rotation where it belongs. I’ve made a graphic showing the problem.
So basicly, my question is how UE could help me with this problem.
Is it possible to change the rotation center when using “set physics angular velocity”?
Better: Can UE4 simulate the impact of different forces being applied on an object at different locations?
That’s it. I hope you can help me with this, would be realy nice. ;D
Hi,
Sorry, I don’t know the answer to your question, but are you sure that helicopters work like you described?
Why would it generate lift downwards? I am pretty sure this is not how it works.
When the pilot increases collective, blades rotate around their long axes and they start to generate lift because now they ram into the air and move it around. Imagine any fan, like CPU fan in any PC, every blade has the same orientation and they all move the air in one direction. Same with a helicopter rotor except its blades are not fixed but can rotate around their long axes to control how much lift they generate. So there would not be any tilting of the helicopter body from side to side like in your picture.
You are right though about the body rotating with the rotor, this is why tail rotor is needed, to counteract this torque main rotor causes.
Well, I am not a helicopter expert so please correct me if I am wrong about anything, but I am pretty sure this is how things work.
I think he wants to model the angular momentum created by altering cyclic pitch, which tilts the rotor disk (and thus the craft attached to it) in a particular direction. (The force acting up to 90 degrees forward in phase of the swashplate’s tilt due to phase lag) The relatively lower and relatively higher angle of attack of the blades in a particlar position relative to the non spinning fuselage creates the tilt.
I’m not sure if adding rotation forces at points other than the pivot point is possible with blueprints, but would it be possible to simply move the pivot point up around the hub assembly and achieve the result you want at least visually?
Well, whenever I model flight mechanics I just use a SkeletalMesh as base with the root bone sitting at the CenterOfRotation. That way everything just works out of the box.
You can also go and simulate a bit more using ApplyForceAtLocation -> this will automatically add a torque around the Center Of Mass according to to the direction/location relative the CenterOfMass.
You can override the Center Of Mass in your blueprint, so AddForce and AddTorque apply in that location instead of your magic point.