Announcement

Collapse
No announcement yet.

[OPEN-SOURCE] Machinery Modelling Toolkit

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    @BoredEngineer... phenomenal plugin, thank you so much. I'm using it at the very center of my physics pawn control.

    Here is the thing, I'm using the PID controller to AddTorque(MMT) in roll to my pawn... pitch and yaw is controlled by the player. I'm aiming to torque the roll to match the surface the player is hovering over. It works perfectly for small transitions, by getting the ground rotation from a line trace beneath the pawn. But when the wall is vertically in front of the player, and the player correctly pitches upwards... the roll reliably goes a bit haywire. I've tried it on Physics Tick, and normal Tick with the same results.

    My formula is simple, PlayerRotation - GroundRotation and feed roll into the PID. Is there something I'm doing wrong?

    Click image for larger version

Name:	PID-controller.jpg
Views:	436
Size:	56.6 KB
ID:	1745926


    Click image for larger version

Name:	Ground-Rotation.jpg
Views:	420
Size:	72.5 KB
ID:	1745927

    Comment


      Probably a gimbal lock. Using quaternions could help.
      Youtube Channel

      Comment


        Thanks! I tried quats... still about the same result. Flip, I thought it might solve it too.

        Might there be some issue with the delta roll magnitude (it's trying to rotate the 'wrong' way around), with my formula for assembling the ground rotation, or with the way I'm applying the torque in local/world space? #puzzled



        Click image for larger version  Name:	PID-Quat.jpg Views:	0 Size:	59.6 KB ID:	1746374Click image for larger version  Name:	AddTorque.jpg Views:	0 Size:	92.0 KB ID:	1746375
        Attached Files
        Last edited by aNorthStar; 04-17-2020, 05:49 AM.

        Comment


          wooo... finally got it working... in this specific case, it didn't need quats, just for the ground rotation to be transformed to local space... then applying the torque also in local space... thank you

          Click image for larger version  Name:	Rotate-to-ground.jpg Views:	0 Size:	55.7 KB ID:	1747115
          Last edited by aNorthStar; 04-18-2020, 06:53 PM.

          Comment


            Hi BoredEngineer! Can we use unique meshes for tracks or only instanced meshes?
            I want each track to be different.
            Last edited by Sound_Priest; 05-02-2020, 04:55 AM.

            Comment


              Originally posted by Sound_Priest View Post
              Hi BoredEngineer! Can we use unique meshes for tracks or only instanced meshes?
              I want each track to be different.
              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.
              Youtube Channel

              Comment


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

                This is the basic blueprint

                And Physics tick with trace

                And my settings


                Any idea why this might be happening?

                Comment


                  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
                  Youtube Channel

                  Comment


                    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.

                    Comment


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

                      Comment


                        greetings
                        could you update to 4.25 would you its urgent .......................

                        Comment


                          Master branch of the plugin is on 4.25 version now.
                          Youtube Channel

                          Comment


                            BoredEngineer 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?

                            Comment


                              Originally posted by galacticf3ar View Post
                              BoredEngineer 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.
                              Youtube Channel

                              Comment


                                Originally posted by BoredEngineer View Post
                                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.

                                Comment

                                Working...
                                X