Originally posted by OldRaven
View Post
Announcement
Collapse
No announcement yet.
[OPEN-SOURCE] Machinery Modelling Toolkit
Collapse
X
-
Originally posted by 0lento View PostSpinTires is a DX9 game so it can't even use tessellation. It's also taking the deformations into account in away that I don't believe their collision model is that coarse (possible that they do the math on same data). If you need something like this, I think this could help to achieve it: https://forums.unrealengine.com/show...nerated-meshes! Other option would be to do make the displacement data both on gpu and cpu and use cpu version to offset the suspension values (would only work on linetraces and shape casts and not with actual physics geometry).
Comment
-
Originally posted by BoredEngineer View PostSo M113 hull is somehow gets stuck on something, if you enable debug mode (Alt+Shift+D) you will see that collision point is somehow outside of the M113 hull (pink point), which is weird 0_o.
It's also when you start a new scene.. no driving on terrain and / or geometry
Comment
-
So, this is what I found - something happened to landscape. The collision is happening with heightmap of the main landscape. The landscape in another level (airplanes) works just fine. I found the way to replicate this issue, making a copy of the landscape creates this.
So no worries, we can fix this by not copying landscape
I'll try to make a level with this bug being reproducible and report it. Will work on the other piece of the guide now.
Comment
-
Originally posted by OldRaven View PostDid you change anything in the code?
It's also when you start a new scene.. no driving on terrain and / or geometry
Comment
-
Looking at Tiger right now:
1) Don't rotate root scene component of suspension, just leave it at 0,0,0. Instead rotate the SuspensionArm component.
2) Now I see what you mean about suspension arms, that's an unusual order, I thought that on both side there were bending toward the back of the tank. Here I see that right side bends to a back and left side to the front.
3) I've set suspension arms to 25 degrees rotation in Y
4) For stability of the physics constraints it's important that connected components have not more than 10 times difference in mass (ideal), unfortunately as we are dealing with tanks we can't have torsion bars weight a ton each. But something like 100-200 kg might make a trick.
5) Projection settings I usually set to 0.1 Linear Tolerance and 1.0 of Angular Tolerance
6) The collision components which will come in contact with ground, like Collision Wheels, Idler and Sprocket need to have SmallFrictionMaterial physics material, so they can slide easily over obstacles - it improves stability.
After setting all this, it seams to be working more or less fine. I'll send you file back with the settings.
Comment
-
Bug fixed, Yay! The solution to collision issues of M113 and A_Tracked_Vehicle is rather simple. We need to remove center of mass offset from A_Tracked_Vehicle's root body, like this:
If center of mass offset is needed, then it can be set in a specific child blueprint like M113. The fix is on the github.
Comment
-
Continuation of the guide
"Update Friction" function is responsible for orderly calling "Track Anisotropic Friction" components to apply friction force to the tank. There are couple of things which a necessary to make it happen.
First we need to count how many friction points are in the contact with the ground or in collision with some obstacle. The other thing we need to provide is the velocity of the tracks. Tracks velocity is influenced by the engine and friction itself.
The velocity of the tracks is handled using Track Transmission Processor component. We need to add two of them, one per each track. Example of components and their settings from T-26 Light Tank:
Later, Track Transmission Processor can be replaced by Track Transmission Processor Modular which is build to work plug-in-play with Modular Drive Train. As to parameters, this is their meaning:
Reference Frame Component Name - name of the a chassis or root physics component of the tank
Sprocket Radius Cm - radius of the track sprocket in centimeters
Sprocket Mass - mass of the sprocket in kg
Track Mass - total mass of the track in kg
These parameters can be hard to find but they are important for the overall handling of the vehicle. Higher mass of the sprocket and track will make a larger inertia of track movement, which will make it harder to slow it down or accelerate. The heavier the tracks and sprocket the more power from the engine is necessary to spin tracks, especially in cases when we want to spin tracks in opposite direction for neutral turn.
Brake Force - is the amount of force that we apply to track when brakes are enabled
Mechanical Friction Static Limit - is a threshold of track acceleration, if acceleration is lower than this parameter tracks won't move. This parameter imitates some of the mechanical binding that happens in transmission because of mechanical friction and inefficiency.
Mechanical Friction Kinetic Coefficient - is a unit-less parameter that effects how fast tracks will slow down without engine torque
"Update Friction" function need to be called from MMT Physics Tick event and receive delta time as input.
Inside of the function we will have three parts:
- counting of valid friction points
- setting parameters and calling TrackAnisotropicFriction component to apply friction force
- gathering of reaction force and providing it as parameter into TrackTransmissionProcessor
To count valid friction points we need a temporary array of all TrackAnisotropicFriction components and local integer variable PointsCount:
For a second and third part we need two local vector variables RightTrackReactionForce and LeftTrackReactionForce, which we will use to accumulate reaction forces from TrackAnisotropicFriction->PhysicsUpdate() output.
This is how it all combines:
For each side of the tracks we have a loop out of corresponding TrackAnisotropicFriction components. In each loop, we get track velocity vector from the TrackTransmissionProcessor component and provide it into each TrackAnisotropicFriction component using UpdateTrackData function. Then we call PhysicsUpdate function, providing PointsCount (calculated earlier) and DeltaTime. The output of this function we accumulate into RightTrackReactionForce and LeftTrackReactionForce.
All what is left is to use SetTrackApplicationForce function of TrackTransmissionProcessor to provide reaction force created by friction back into the loop.
Comment
-
Originally posted by OldRaven View PostDid you only change the A_TrackedVehicle Blueprint? Then that is the only file I have to replace..
Comment
-
Originally posted by OldRaven View Postreplaced.. and it works now.
What I do find weird.. when you go in you landvehicle map and take the m113 or ripsaw.. and turn on debug mode... I still get a hull collision message popping up that it is hitting the ground when you go on the terrain.
Comment
Comment