Search Unity

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

Discussion in 'Works In Progress - Archive' started by Heartbroken, Jan 31, 2014.

  1. ellioman

    ellioman

    Joined:
    Mar 14, 2013
    Posts:
    19
    Hey,
    After changing the worker threads to 0 I'm able to run the scene but the editor crashes once I stop playing.

    The error I'm now seeing is:

    Application Specific Information:
    abort() called
    *** error for object 0x600000183cf0: pointer being freed was not allocated
     
  2. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Cool. Could you make a crash log for this too? Thanks
     
  3. ellioman

    ellioman

    Joined:
    Mar 14, 2013
    Posts:
    19
    No problemo, here ya go.
     

    Attached Files:

  4. mensch-mueller

    mensch-mueller

    Joined:
    Nov 25, 2014
    Posts:
    156
    Hi
    That seemed to fix something. I´m also on OSX and had the same problems yesterday night. :rolleyes:
    by the way: Worker Threads are in Edit -> Truss Physics...
    And i also want this cute red car! ;)

    Cheers Michael
    and wish you big success! really promising asset!

    Edit: when i set worker threads to 0, i can start play, but on some scenes Unity hangs when i wanted to end play....
    Edit: Unity seemed to hang on all scenes, when i want to finish play mode...
    OSX 10.9.5 Unity 5.1.2p2
     
    Last edited: Aug 19, 2015
  5. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Thanks
     
  6. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Thanks. Will do my best :)
     
  7. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
  8. mensch-mueller

    mensch-mueller

    Joined:
    Nov 25, 2014
    Posts:
    156
    Good news: it´s working now! That was fast! :)

    Thanks Michael
     
  9. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
  10. PitHeimes

    PitHeimes

    Joined:
    Oct 18, 2015
    Posts:
    322
    Hey,

    awesome asset. Really love it.

    Just a quick question:
    Any way to get joints working correctliy with Tx RigidBodies. Tried multiple ways but it always behaviour is drives crazy all the time.
     
  11. Mehrdad995

    Mehrdad995

    Joined:
    Jul 17, 2013
    Posts:
    46
    Nice plugin
    Unity world really needed that literally masterpiece.
    Has anyone tested it on android yet?
    I'm curious about the performance
     
  12. dvs_code

    dvs_code

    Joined:
    Jun 21, 2013
    Posts:
    7
    Hi Heartbroken!

    This is an excellent package. Should be included in Unity for sure. We purchased the asset, but were unable to find the vehicle demo. Is there any chance you can send it to us? This is just a great example of how your physics can be used in real world things.

    Thanks!
     
  13. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Hi

    I didn't publish RedCar Demo for several reason. First of all that car model is a free asset from the Asset Store and I'm not sure its license allows publishing it as a part of my asset. Second, unlike the demos from the package, RedCar Demo is quite heavy. Current mobile platforms are too weak to run it with acceptable frame rate, and that's what the most of my users are interested in. And the last but not the least, that demo is a part of my working project with a lot of other temporary and experimental stuff, and that's not a trivial task to separate it.

    On the other hand, I try to do my best to help my users if I'm asked to. And of course I can't ignore a request from a user with the commercial license :) So, if you still want that demo, just PM or email me your invoice number and I'll send it to you as soon I extract it and clean it up a little bit.

    Cheers
     
  14. dvs_code

    dvs_code

    Joined:
    Jun 21, 2013
    Posts:
    7
    Hi Heartbroken!

    Thank you for the prompt reply. Understood about the demo. I've passed the requrest to license owner, he should contact you via PM shortly.

    Thank you once again for your hard work, keep it up!

    Regards, Dmitry.
     
  15. shahzaib

    shahzaib

    Joined:
    Dec 14, 2013
    Posts:
    32
    Hi Heartbroken,

    Just downloaded Trussphysics and playing around with Redcar demo, this package is without any iota of doubt, is awesome! I'm trying to use it with Unity's standard assets' vehicle prefab but for some reasons it isn't working and Unity stop responding as soon as I choose mesh from mesh selector for "Truss Designer".

    Regards;
    Shahzaib
     

    Attached Files:

  16. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Hi Shahzaib,

    A truss in a soft body is like a skeleton for a character skinning. It's not a trivial thing and there's no easy way to generate it automatically. It's supposed to be made by hands. As it's not always convenient to do this inside Unity, this "Truss Designer > Create From Mesh..." command allows user to model a truss in the other application (like Blender for example), import it into Unity as a mesh, and then convert it to a truss. After the conversion a truss still may need some editing, like adjusting the nodes masses, adding some internal links, etc. The model of sphere in "Pressure" demo is made this way.

    Yes, user are often confused that this command will magically create a truss from anything, and I realize I need to make it more clear some how.



    Cheers :)
     
    shahzaib likes this.
  17. shahzaib

    shahzaib

    Joined:
    Dec 14, 2013
    Posts:
    32
    Ahan! Now I know, thanks for pointing this out. :)
     
  18. crudeMe

    crudeMe

    Joined:
    Jul 8, 2015
    Posts:
    92
    Where have you downloaded redcar demo?
     
  19. shahzaib

    shahzaib

    Joined:
    Dec 14, 2013
    Posts:
    32
  20. friuns

    friuns

    Joined:
    Jan 14, 2016
    Posts:
    23
  21. chiny1

    chiny1

    Joined:
    Nov 1, 2017
    Posts:
    11
    Hi,

    I figured out, how to create Softbodies and use the truss Designer to make custom Truss Assets for the SoftBodies. The problem im facing now is that I have a wall of cubes which are softbodies and so far they were acting like they should. Now I wrote a little script, so the player can throw little balls. Therefore I just made a ball prefab and attached a sphere collider, an rigid Body and the Tx RigidBody Script to it.

    I just now want the spheres mass to be adjustable, so I added a public int to the script.

    There are two problems with that now:

    1) At first this worked well, and the spheres could be thrown normally. They actually interacted with the softbodies but I can´t see any difference by changing the mass of the spheres RigidBodiy?. It seems that the changes doesnt affect the Sotbodies at all.

    2) I messed up the prefab by changing a parameter I think, and now by throwing a ball the softbody cubes get blown away but the balls velocity is so high that It´s not even visible anymore... just for short. I don´t know why, but by instantiating a new Ball and accelerating it, it just goes off with an insane speed... How do I accelerate objects correctly, and how can I make softbodies interacting with other objects not only softbodies itself?, and last how do I change the mass of an object properly?

    Im Stuck, please can someone help me out?



    Here is a link to video, where u can see the code and my approach. Hope somebody can help me out. I think Truss Phys is worth its money, but due to the lack of infromation I think there needs to be put some effort into it.
     
    Last edited: Nov 5, 2017
  22. chiny1

    chiny1

    Joined:
    Nov 1, 2017
    Posts:
    11
    I figured out that setting the interaction to Light causes the strange behaviour. But still don´t know how, to change the mass of an object that has truss Rigidbody attached to it.
     
  23. Heartbroken

    Heartbroken

    Joined:
    Nov 18, 2012
    Posts:
    132
    Open TxRigidBody script and find OnBeforeStep() function. After

    Code (CSharp):
    1.     Rigidbody rb = m_rigidBody;
    add something like

    Code (CSharp):
    1.     TxNative.RigidSetMass(m_rigidID, rb.mass * m_massScale, rb.centerOfMass, rb.inertiaTensor * m_massScale, rb.inertiaTensorRotation);
    It will update the mass before each simulation step.
     
    chiny1 likes this.
  24. chiny1

    chiny1

    Joined:
    Nov 1, 2017
    Posts:
    11

    This is neat, thanks - Is there a reason why I can´t move a softbody? Is there a way?
    regards

    Would you please share the redCar Demo?
     
    Last edited: Nov 6, 2017
    malak likes this.