Search Unity

[RELEASED] Truss Physics for Unity3D. Soft-body simulation plugin.

Discussion in 'Assets and Asset Store' started by Heartbroken, Aug 22, 2015.

  1. Shadow-X6

    Shadow-X6

    Joined:
    Apr 29, 2016
    Posts:
    99
    Yes
    But there is Error Script that has a strange syntax and I don't know how to fix it
     
  2. Shadow-X6

    Shadow-X6

    Joined:
    Apr 29, 2016
    Posts:
    99
    .
     

    Attached Files:

  3. Mr_Dss

    Mr_Dss

    Joined:
    Feb 3, 2016
    Posts:
    15
    Can you share it in PM?
     
  4. Shadow-X6

    Shadow-X6

    Joined:
    Apr 29, 2016
    Posts:
    99
    Gmail ?
     
    Mr_Dss likes this.
  5. Mr_Dss

    Mr_Dss

    Joined:
    Feb 3, 2016
    Posts:
    15
  6. Shadow-X6

    Shadow-X6

    Joined:
    Apr 29, 2016
    Posts:
    99
  7. chiny1

    chiny1

    Joined:
    Nov 1, 2017
    Posts:
    11
    But it´s still poor documented...
     
  8. Shadow-X6

    Shadow-X6

    Joined:
    Apr 29, 2016
    Posts:
    99
    I have Generated Project RedCar you also want to send ? :)
     
  9. Chris2D

    Chris2D

    Joined:
    Nov 18, 2017
    Posts:
    4
    I think it would be helpful if you could just post up a few screenshots showing some of the truss structures and how the joints/constraints are applied to those. I've started playing with the free download of truss physics to determine if it's going to work for my purposes, and it's not that hard to get something simple like an inflated tire "working" but I'm finding there is a lot of trial and error in getting my wheel and tire to work well with the rest of the parts of a vehicle.
     
  10. Shadow-X6

    Shadow-X6

    Joined:
    Apr 29, 2016
    Posts:
    99
    Can you work with TrussPhysics?
    Because this generated project contains a Script error
    Write to me at Gmail: Facerougex@gmail.com :)
     
  11. Chris2D

    Chris2D

    Joined:
    Nov 18, 2017
    Posts:
    4
    Heartbroken, first thank you for developing this asset...I'm still in the testing phase but am becoming more certain that I will be buying it.

    You mentioned before that you could explain how you implemented steering by manually altering the length of some links. I would appreciate this information too, any direction you can provide on how to alter link lengths in C# would likely save me quite a bit of time digging and guessing. I've tried applying steering via rotation, but it feels like the tire is fighting me and will not rotate smoothly.
     
  12. kilomotor

    kilomotor

    Joined:
    Dec 17, 2015
    Posts:
    2
    @Chris2D. Maybe you've figured it out already, but Heartbroken explained steering with this post: https://forum.unity.com/threads/released-truss-physics-for-unity3d-soft-body-simulation-plugin.349503/page-4#post-2901676
    (just a few pages back in this thread)
    You need to set up a steerable truss (search out rigs of rods examples) and then modify the lengths of the links.

    This is an awesome asset. I've been playing with the free demo for a while and have a basic car setup. But it could be used for so much more! (if only I had the time - or the imagination).

    Hats off to Heartbroken for creating such an awesome Unity asset.
     
  13. Chris2D

    Chris2D

    Joined:
    Nov 18, 2017
    Posts:
    4
    Thank you kilomotor...I'm not sure how I missed that post when reading through this thread. I've been busy with other aspects of my project lately and hadn't had time to pursue this further, but I will be back to it as soon as I get some free time.

    This does seem like a great asset, and clearly it has amazing potential based on what people like Anders have been able to accomplish! I hope the community around it grows to the point where we have a few more examples and tutorials to help the new folks get going with it a little faster. Heartbroken's included samples do illustrate the basics quite well, but a couple tutorials showing creative ways that people are using Truss would be awesome.
     
  14. bigy

    bigy

    Joined:
    Sep 6, 2017
    Posts:
    5
    Hi Heartbroken,

    it's great asset, but not well documented.

    1. Please, can you be more specific about Snap attributes minLimit, maxLimit, strength and relation among them?
    2. Can I explicitly break link?
    3. Can you be more specific about Link attribute breaking?
    4. Value of function linkLength (TxSoftBody) should be changed when softbody is deforming, right? For me, softbody.truss.linkLength[link_index] is equal to softbody.linkLength[link_index] no matter what. Is it bug?

    Thank you
     
    Last edited: Dec 22, 2017
  15. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    1. minLimit and maxLimit are min/max distances a snapped node is allowed to be from the feature it's snapped to (a point on the other rigid body, a node of the other soft body, a line going though two nodes of the other soft body). Strength is how much force can be applied to a snap before it breaks.
    2. No.
    3. It's not used.
    4. Both TxSoftBody.linkLength and TxTruss.linkLength are initial length of a link. There's no function to get the current length of a link. But you can get the link nodes positions and compute the distance. It's not a bug, just a bad design.
     
    bigy likes this.
  16. bumd

    bumd

    Joined:
    Aug 20, 2017
    Posts:
    6
    Hello, I tried to make a basketball that mimics a real ball and i failed with this. If I rise the pressure up, node points are starting to glitch. I experimented with stiffness and adiabatic index settings but no luck. And also the spheres given by the demo scene are likely to gain volume when pressured up while my relatively small basketball is not ... I can imagine some global scale of the object interfering with this...

    Is this can be done, I know it's not intended for this but it's similar principle and maybe the max limit of the calculations can be adjusted to do this accordingly.
     
  17. White-Mohawk

    White-Mohawk

    Joined:
    Apr 1, 2013
    Posts:
    1
    Hi Heartbroken,

    First of all : Congrats on an awesome package. I downloaded the evaluation package and tried some stuff out and I find it very amazing what you accomplished !!

    From what I understand is that this is a soft-body-package and that it realisticly mimics how objects would interact with each other. How it deforms when a force is applied to them, correct ?

    I came across your package looking for a realistic car physics/handling and stumbled upon various youtube videos of trucks where handled realistocly, tires deforming and all. Noticed that it was done with Truss Physics.

    My main question is : did you used Truss Physics to mimics the engine and driving force of the trucks or is dat another asset like Edy Vehicle Physics or Realistic Car Controller or something you wrote yourself and you used Truss Physics to handle how the materials from the truck must behave ?

    My extra question if you don't mind : is there a unity project with an example of how a car should be built with Truss Physics.

    I am defenitly buying your asset either way.

    Thanks for your time, effort and dedication !!
    Keep up tha good work.

    Cheers,
    Kristof
     
  18. bigy

    bigy

    Joined:
    Sep 6, 2017
    Posts:
    5
    Hi,
    I have tried to make a tire (first image). Truss looks good, but weird things happen in the play mode (second image). Truss keeps the shape, but mesh implodes. I am not sure what is the problem. I fiddled with link attributes and truss design, but with no result.

    Do you have some advice?

    Thank you
     

    Attached Files:

    Last edited: Jan 3, 2018
  19. bigy

    bigy

    Joined:
    Sep 6, 2017
    Posts:
    5
    I have created mesh from the beginning and it is working now.
     
  20. hauwing

    hauwing

    Joined:
    Dec 13, 2017
    Posts:
    61
    Hi Heartbroken,


    This is definitely an awesome package. Have downloaded an evaluation copy and played around with some features, and managed to produce a simple drivable car, but the process is rather painful, not because of the stitching of nodes and links, but the frequent Unity crashes and freezes during the development. I am not sure if this is purely the problem of my computer with Unity (2017.3.1f1), but I tried to use my other computer also with Unity 2017.3.1f1, the same problem occurs, maybe the problem only exists in 2017.3.1f1.

    I believe that the Tx Constraint is causing the hangings (at least for most of the time). For example, I created some constraints in a softbody, it did work and was able to play as expected, but once I changed the softbody Truss by changing the stiffness of a link, or change the mass, or even just changed the position of an object by a just a small amount, it freeze (CPU revving to more than 30% by Unity but not responsive) when I played again. And once the constraint failed, it will freeze again when I just click on the tick box to disable it or simply remove it. So I had to repeat the same cycle to kill Unity, re-open it, disable the whole game object, removed the constraint, and added it back manually, enable the game object again, and it worked again, and luckily it can be played for a few rounds, and all of a sudden it freezed again even though nothing had been changed.

    Just want to let you know my observation. This is really a fantastic package. I had a great time playing with the softbody features, it would be even better if the freezing issue can be resolved, Thanks.
     
  21. bigy

    bigy

    Joined:
    Sep 6, 2017
    Posts:
    5
    Hi,

    same for me. Also, more than one motor causes freezing editor. Unfortunately, it looks like that there is no more development.

    Still, it's great asset.
     
  22. bigy

    bigy

    Joined:
    Sep 6, 2017
    Posts:
    5
    Hi,

    does anybody know more about motor attributes target rate and max torque? What is unit of measurement?

    It's rad/s and N.m (thx Heartbroken).
     
    Last edited: Feb 23, 2018
  23. Naveed_Khurshid

    Naveed_Khurshid

    Joined:
    Oct 8, 2016
    Posts:
    3
    I am using truss physics unity package available on asset store for research in my university project but there is no red car demo in that package,red car demo is also no available at drop box link which you shared.kindly share this demo with me as I am facing to much problems in configuration of truss physics on vehicle.Thanks
     
  24. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    This has been requested too many times, red car DOES NOT come with the package. I guess is to prevent asset flippers.
     
  25. GHOSTBLACK

    GHOSTBLACK

    Joined:
    Apr 25, 2018
    Posts:
    7
    Hello Heartbroken What you did is a great job, do not see attention to those who are not so happy, keep working on.
    Tell me how to optimize physics(on our scene 4 cars)? And we have crashes in the UnityEditor and also random crashes and friezes on iOS and we were not able to compiled under PS4 SDK... I need your help))



    This video captured from iOS 11.3

    P.S. I managed to get some results some months later and I learned a lot of new things! Guys who can not understand how this works, you have to go to the sources and watch how were built Rigs of Rods and BeamingNG

    Sorry for my not perfect english)
     
    Last edited: Apr 25, 2018
  26. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    908
    Very cool! Did you rig all the car with Truss physic? Cause some years ago we tried the red car demo on an average android but it was not powerful enough (too much contact points to calc).
     
  27. GHOSTBLACK

    GHOSTBLACK

    Joined:
    Apr 25, 2018
    Posts:
    7
    You are the very person who created UnityCar! I bought your package he taught me a lot! Real Drift is a great app! It fascinates me))
    Yes all cars is entirely created on Truss Physics, and all scene too)
    I used to create the physics of the wheel only 10 facets of the cylinder, and based on it I built a truss wheel, in the Rigs of Rods used something similar. You can make in RealDrift the optional inclusion of SoftBody wheels for powerful devices. I tested only for iPad Pro 13.3 and iPhoneX this allows to actually fully work a four cars (all soft body) on the scene! But I'm see random friezes and crashes take place may once every half an hour or the application may crash. It's not stable, but I hope I can solve all the problems!
     
  28. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    908
    Cool. Did you change the fixed time step of truss phyisc too? Cause it seems that cars are not really stiff.
     
  29. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Looks cool. I didn't think it can run on iOS even with only one car. Probably iPhones are more powerful now than when I tried them. Anyways, my Mac is dead already, so I can't do anything for iOS. As for PS4, only registered developers can make middleware for this platform. And I'm not one of them.
     
  30. GHOSTBLACK

    GHOSTBLACK

    Joined:
    Apr 25, 2018
    Posts:
    7
    I do not know if these parameters are correct, but I managed to come to this values in an experimental way, with them I achieved maximum realism and stability. Use parameter Worker Threads -2 described earlier here led to unstable work and system crashes.



    I sent you a message, help if you will not be difficult))
     
  31. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    908
    If im not wrong, you can also change the fixed time step, like in unity physic. @Heartbroken correct me if Im wrong.
     
  32. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Yes. The SubstepSize is fixedStep/(2^SubstepPower)
     
  33. Shadow-X6

    Shadow-X6

    Joined:
    Apr 29, 2016
    Posts:
    99
    Hi GhostBlack
    This is really good work
    Pls you can send me in Gmail : Facerougex@gmail.com i pay you $ Donate
    Thanks
     
  34. GHOSTBLACK

    GHOSTBLACK

    Joined:
    Apr 25, 2018
    Posts:
    7
    Hi, I can not send you the source code, I can only try to explain this.
    For examples source code, you can ask for only HeartBroken but he is not very responsive person.
     
  35. Mr_Dss

    Mr_Dss

    Joined:
    Feb 3, 2016
    Posts:
    15
    Hello. Can you send me source Red Car Demo? I sent my Invoice number to you.
     
  36. ASDev

    ASDev

    Joined:
    Dec 9, 2012
    Posts:
    48
    Thanks Heartbroken, I happened to setup vehicle with Truss Physics. I created a scene like BeamNG and set up car model which I found in internet. It looks pretty cool, and I working on optimization and various parameters

     
  37. GHOSTBLACK

    GHOSTBLACK

    Joined:
    Apr 25, 2018
    Posts:
    7
    Good job!)
    I managed to slightly improve the situation with the optimization of my project.



    @Heartbroken Tell me how the RayCast work correctly in Truss Physics, I'm trying to do the snow deformation of the through the Tessellation shader iOS Metal
     
    Last edited: May 2, 2018
  38. Shadow-X6

    Shadow-X6

    Joined:
    Apr 29, 2016
    Posts:
    99
    Pls Can everyone working with TrussPhysics ? help to me ? :)
    Thanks
     
  39. ASDev

    ASDev

    Joined:
    Dec 9, 2012
    Posts:
    48
    I can help to understand how to set up a vehicle. First of all you need stable truss for your softbody, for car body. I used box truss from examples, but I moved nodes and its shape become similar to shape of car body. Then you need to create lever arms of suspention. I did it with nodes and links like in this picture

    Red lines - truss links, violet line - truss link too, this is rear axle. green circles - nodes on car truss body. Green lines - shock absorbers. It's a links with some values of stifness and damper. Wheel has 2 nodes in the center of 2 sides of the wheel. Internal node connected to appropriate node on violet axle, and external node of the wheel connected to EDGE. Edge - 2 nodes on violet axle. That's all for rear suspention
     
    Fibonaccov likes this.
  40. Shadow-X6

    Shadow-X6

    Joined:
    Apr 29, 2016
    Posts:
    99
    You have Car Control Truss ? :O
     
  41. ASDev

    ASDev

    Joined:
    Dec 9, 2012
    Posts:
    48
    It's my own script to add torque and steering to wheels
     
  42. Shadow-X6

    Shadow-X6

    Joined:
    Apr 29, 2016
    Posts:
    99
    Oh Sure
    Pls you can help me with TrussPhysics ?
    Contact Facerougex@gmail.com
    Thanks :)
     
  43. crudeMe

    crudeMe

    Joined:
    Jul 8, 2015
    Posts:
    89
    If you are willing to spend money on Truss setup, why don't you find someone on Unity Connect for that matter?
     
  44. Mr_Dss

    Mr_Dss

    Joined:
    Feb 3, 2016
    Posts:
    15
    @Heartbroken I bought asset 9 days ago. Sent invoice to your email and to PM. Can you stop to ignore me and send me red car demo source please?
     
  45. Shadow-X6

    Shadow-X6

    Joined:
    Apr 29, 2016
    Posts:
    99
    I have TrussPhysics
    But I do not know how it works
    I need someone who knows
    Forum that is useless to me
     
  46. GHOSTBLACK

    GHOSTBLACK

    Joined:
    Apr 25, 2018
    Posts:
    7
    Thank you very much HeartBroken
    We managed to get TrussPhysics to work on PlayStation4
     
  47. Shadow-X6

    Shadow-X6

    Joined:
    Apr 29, 2016
    Posts:
    99
    Nice Work ! :)
    You got Facebook I need to talk to you
     
  48. GHOSTBLACK

    GHOSTBLACK

    Joined:
    Apr 25, 2018
    Posts:
    7
    Sorry, but I do not have facebook account, it takes a lot of time))
     
  49. Shadow-X6

    Shadow-X6

    Joined:
    Apr 29, 2016
    Posts:
    99
    And Gmail ? :)
     
  50. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Well, it looks like Unity 2018 has it's compiler changed, and some old tricks don't work anymore.

    For people who have difficulties fixing the compilation errors themselves, here is the solution:

    In TxRigidBody.cs file find the lines containing:

    Code (CSharp):
    1. float angle; Vector3 axis; (rb.rotation * Quaternion.Inverse(m_prevRotation)).ToAngleAxis(out angle, out axis);
    there are two of them. And replace them with the:

    Code (CSharp):
    1. Quaternion rotationDelta = rb.rotation * Quaternion.Inverse(m_prevRotation);
    2. float angle; Vector3 axis; rotationDelta.ToAngleAxis(out angle, out axis);
    That's it. There are also some warnings. Here are a couple of tips to get rid of them:

    All calls of SphereCap functions, like this one:

    Code (CSharp):
    1. Handles.SphereCap(-1, position, Quaternion.identity, size);
    should be replaced with SphereHandleCap:

    Code (CSharp):
    1. Handles.SphereHandleCap(-1, position, Quaternion.identity, size, EventType.Repaint);
    In TxSceneSettings.cs line 58:

    Code (CSharp):
    1. if (Application.isPlaying)
    replace with

    Code (CSharp):
    1. if (Application.isPlaying && TxWorld.created)
    That seems all. Have fun.
     
unityunity