[OPEN-SOURCE] Machinery Modelling Toolkit

The instancing is used because track is made of collection of individual mesh links. Of course this could be done in other ways, like using skeletal mesh. The code is all there, you can implement it in any way you want.

Hi it’s me again. I’m battling with unstable physics. I’m trying to do basic friction script.

This is the basic blueprint

https://i.imgur.com/2lP3SiN.png

And Physics tick with trace

https://i.imgur.com/O48gSbe.png

And my settings

https://i.imgur.com/8AIGZpG.png

https://forums.unrealengine.com/blob:https://imgur.com/804ee8b8-bb6c-4daa-8f12-8175720d0bcd

Any idea why this might be happening?

  1. Single point used for friction, which means that anytime the friction is applied of the center of mass, it will add some torque
  2. The way the code is structured, can work only if “box” is oriented vertically, so if it happens to flip, you won’t be able to line trace correctly anymore

Yes, because it’s just a simple test,it doesn’t matter how many points I add. I have a snowmobile which does the same thing, it runs ok and suddenly, spontanously starts to glitch everywhere. I don’t know what’s causing that.

I found the solution. The problem was scaled up model and i had to regenerate the terrain, previous one was causing bugs.

greetings
could you update to 4.25 would you its urgent …

Master branch of the plugin is on 4.25 version now.

1 Like

@ Hi, I am kinda new to unreal but I want to make the “simplest” tank simulation I can get away with [so I can have large numbers at once, among other things going on] so probably I want to go with something basic like the standard vehicle movement component as a starting point, however what I do want is a visually accurate track simulation/animation. For your various track animations that you have experimented with here, are they able to be “transplanted” to a non-MMT pawn type easily enough? And which one would you advise to use? In LightTankTraceWheelsWithAnimBPPrototype, which I believe is the one with the most advanced track animation, the function “UpdateTrackAnimationComponents” which goes into “UpdateTrackAnimation [Target is MMTTrack Animation Component]” I assume is hidden away in the plugin code itself. Is that a collapsed version of the original “Animate Treads Instanced Mesh” in “A_TrackedVehicle”, or is it different/better/more performant?

It’s a better performant and structured code. LightTankTraceWheelsWithAnimBPPrototype is where the latest version of various tech pieces lives.
As to moving it into a different pawn, as long as you can provide information about movement of the roadwheels, it should work.

Thanks, I will see what I can do.

Hello @, I was wondering if I could get you’re help. So I’m trying to make an ATV with tracks on them and I’ve tried many methods even with this system, but I’ve run into a lot of confusion when trying to integrate the build track and Animation system with what I have. The current system that I have set up is using a wheeled vehicle BP with one rigged mesh and that works well aside from the tracks. So could I get a bit of help with trying to figure out how to integrate this system with my ATV? Much appreciation if you can! 2020 06 24 17 09 02 - YouTube

greetings again you upload the plugin for 4.25 but its request visual studio to compile could you upload or just compile the plugin to work with 4.25 as you did in 4.22 version of it would you or you just could hope you response as could you can as by evening and thanks…

https://github.com//MMT_Content

master content

Hi, truly amazing work with this plugin. But unfortunately i might be too stupid to get the plugin working in another project. Seems like the MMT Tick is never being called.

I feel Iam missing something important but I am going nuts trying to find it.

  • A reboot changed everything… sorry for premature post

I should not have delved into such project as total newbie, but i managed to get all running with a clean build from scratch :slight_smile:

Again thanks alot for this nice plugin

Hi, I have another question :slight_smile:

Since the physics event tick should be the place where we call the mmt commands like addforce and addtorque, I was wondering if there is a way to call an event to perform in this physics event tick ONLY on call. Atm I have the functions which should be called placed inside the physics tick with one variable set to 0, so whenever I need this function to be called I just change the value to sth unequal to 0. But since this doesnt seem to be a very clean solution, I was wondering if there is an easy way around this “sleeping function”.

Thx in advance

Hi,
Been trying to rebuild plugin for source build of UE4-4.25.1.(Chaos enabled). Using the RunUAT and have these errors. My apologies, I’m not that skilled in programming to sort this one out.
I do have it all working in my UE4 4.23 source build with ChaosDemo. I’m using your latest source MMT plugin from GitHub. To get this far I had to edit the .cpp file’s #include “MMT.h” (example) and place them 1st.
Also this one “Cannot open include file: ‘ModuleManager.h’: No such file or directory” I just added a path to it’s location in the MMT.h. ie; "#include “G:\UE4-4.25.1-S\Engine\Source\Runtime\Core\Public\Modules/ModuleManager.h”
seems to have fixed that one. But this is where I am now stuck.

ProcessResult.StdOut: [2/6] Module.MMT.cpp
ProcessResult.StdOut: G:/UE4_Src_Projects/MMT_Folder/HostProject/Plugins/MMT/Source/MMT/Private/MMTBPFunctionLibrary.cpp(125): error C2228: left of ‘.IsValid’ must have class/struct/union
ProcessResult.StdOut: G:/UE4_Src_Projects/MMT_Folder/HostProject/Plugins/MMT/Source/MMT/Private/MMTBPFunctionLibrary.cpp(125): note: type is ‘FPhysicsActorHandle’
ProcessResult.StdOut: G:/UE4_Src_Projects/MMT_Folder/HostProject/Plugins/MMT/Source/MMT/Private/MMTBPFunctionLibrary.cpp(125): note: did you intend to use ‘->’ instead?
ProcessResult.StdOut: [3/6] Module.MMT.gen.cpp

Any help much appreciated. Thanks.

First to have a clean include just change


#include "ModuleManager.h"

to


#include "Modules/ModuleManager.h"

For the compile error regarding chaos change the line with the IsValid() check to:


#if WITH_CHAOS
if (PhysicsActor.IsParticleValid())
#else
if (PhyiscsActor.IsValid())
#endif

Hi MaSe87, Thanks for reply. Your code gave me pretty much same error. Your
#include “Modules/ModuleManager.h”
is a lot neater, thanks for that.

G:/MMT_Plugins/MMT_Plugins_rebuild/HostProject/Plugins/MMT/Source/MMT/Private/MMTBPFunctionLibrary.cpp(128): error C2228: left of ‘.IsParticleValid’ must have class/struct/union
G:/MMT_Plugins/MMT_Plugins_rebuild/HostProject/Plugins/MMT/Source/MMT/Private/MMTBPFunctionLibrary.cpp(128): note: type is ‘FPhysicsActorHandle’
G:/MMT_Plugins/MMT_Plugins_rebuild/HostProject/Plugins/MMT/Source/MMT/Private/MMTBPFunctionLibrary.cpp(128): note: did you intend to use ‘->’ instead?

//AddTorque to a component using BodyInstance as its valid during physics sub-stepping
void UMMTBPFunctionLibrary::MMTSetInertiaTensor(UPrimitiveComponent * Target, const FVector& InertiaTensor)

{
FBodyInstance* BodyInstance = GetBodyInstance(Target);
if (BodyInstance != NULL) {
FPhysicsActorHandle PhyiscsActor = BodyInstance->GetPhysicsActorHandle();
//if (PhyiscsActor.IsValid())
#if WITH_CHAOS
if (PhyiscsActor.IsParticleValid())
#else
if (PhyiscsActor.IsValid())
#endif
{
FPhysicsInterface::SetMassSpaceInertiaTensor_AssumesLocked(PhyiscsActor, InertiaTensor);
}
}
}

I have noticed some misspelling of “physics” in the code in several lines ie; it’s spelled “phyiscs” in places.,that’s in the original MMTBPFunctionLibrary.cpp file. Not sure if that’s causing any problems or not. I’ve tried using correct spelling on those and rebuilding plugin,…did not help either. ( was worth a shot. lol.) Thanks again for your help.

Not sure what I’m doing wrong here, but if I try and use Parent Bone Space for my suspension, the road wheel will for some reason move 1.7km away immediately upon simulation. If I use Component Space it works as intended, however.

Has there been any changes with 4.25? Cross-referenced my blueprints and rig to that of the LightTankTraceWheelsWithAnimBPPrototype a hundred times but I simply can’t figure out what I’ve done wrong here.

Last few hours I’ve been trying to get the suspension arm to rotate along the Y-axis using LookAt so it looks as if it’s attached to the road wheel. But I simply can’t get it to work. It’ll either look in really weird directions or simply just not inherit any of the wheel’s “height”.

Any ideas? For context it’s a rather accurately modeled Tiger 1 torsion bar suspension*(torsion bar and suspension arm are modeled)*.

Edit:

Well I found part of the issue, if I divide the location calculated in the UpdateAnimationWheels function by 10.0 - it works as intended. For some reason any transform I’m doing to a bone is multiplied by 10.

I thought that usually resetting the XForm fix these kind of weird behaviours, but sadly it did not in this case…

Edit 2:

Solved, System Unit Setup had for some reason decided to change so 1 Unit = 10.0cm. So now I have to re-scale everything…