• Editor
  • 4.2-beta status update

  • Editado

habahu inertia and mass are equivalent in the real world

In the real world they are related and inversely proportional, but aren't equivalent. Our physics constraint has to fudge a whole lot of things so real world accuracy isn't the goal, but the names should make some sense. We are open to improving the names.

For physics constraint, inertia is not used when applying forces, instead it is used when a bone moves and the physics controlled properties (x/y/rotation/scaleX/shearX) need to be adjusted to simulate lagging behind the action. The constrained pose from physics constraint is achieved by "offsetting" the properties from the unconstrained pose based on bone movement. Inertia controls how much bone movement is transferred to the properties' physics offset. 100% inertia means the property's offset is affected maximally by the bone movement, 0% means it is not affected at all.

Spring forces are applied over time to reduce the physics offset to zero, effectively causing the constrained pose to (try to) return to the unconstrained pose. Mass (1 / mass actually) is use to scale those forces (Newton's second law: force = mass * acceleration). Given the same amount of force, a larger mass is affected less and a smaller mass is affected more.

habahu Mass and Strength have the same effect in controlling vibration frequency

All of the properties are interconnected, so changing one affects the others. You can achieve a reduction in oscillation multiple ways. Damping is most straightforward, but you can also use less strength, making the forces returning the offset to zero weaker and therefore less likely to overshoot zero. Mass is a multiplier for the forces, so it can also make them weaker to reduce oscillation.

Tuning physics is a bit of an art. Many different behaviors can be achieved with various slider configurations. Some of them give similar results but there can be subtle and not so subtle differences.

habahu Wind and Gravity are the same thing but in different directions, why not use the same name and separate X and Y?

By the same name do you mean windX and windY? I prefer the names wind and gravity. People don't often think about wind in the up/down directions. The 2 sliders could be placed in the UI on the same row to reduce vertical space, but would be the only sliders placed that way and would require the tree to be wider to make them usable.

habahu they seem to be just external forces that cause the spring oscillator to deviate from its initial position, so I don't know how to set the parameters if I want to simulate free falling motion.

Enable translate Y and set gravity so you have a downward force. Strength is what returns the property to the unconstrained pose, so set strength to zero and your bone will fall downward forever. Set damping to zero (or near zero) so gravity's constant acceleration results in a continuous linear increase in velocity (ie it falls faster and faster over time).

    Related Discussions
    ...

    Nate Tuning physics is a bit of an art.

    Agree 😃

    One note from me. While Gravity is fine I think wind is misleading When I see wind I expect cool stuff to be simulated with wind but in reality I should do the heavy work animating the strength of the wind to make it seem like a wind. So in general without collision maybe gravity is also sounds big. we could strip those 2 properties. It would simplify the view. Anyway I mostly did not use them so far. We can add a force with its direction if we wish, by just hitting Add Button

    Wind and gravity are super useful! Especially with the new Global checkboxes (@warmanw update your Spine!). Of course you need to animate modulating the wind to get the effect you want.

    I'm not sure what your Add Force button would do?

    oh nice let me see sure you know better what to keep or remove, I trust you.

    Where are my axes? happens when create new project after dragging they appear

    Weird. What interface scale are you using?

    150
    they flicker a bit when I zoom or drag

    Nate Thank you for your explanation. Although our views may differ in some details, it is not important. I have fully understood the working mechanism of physical constraints. This is a great design.

    • A Nate le gusta esto.

    Hi Nate, are you considering providing grouping functionality for multiple constraints? One hair needs to add multiple physical constraints, and if multiple hairs are placed together, the number of constraints will become much larger. It is basically difficult to find multiple corresponding constraints in the first place solely based on color and bone name. Is it possible to group several constraints and select them all to select multiple constraints for. By controlling the parameters of the group, the percentage of the self values of wind, inertia, and other constraints within the group can be controlled.

    Yes, we hope to add folders for constraints to 4.2. The challenge is that the constraint order is important and drag and drops still needs to work for that. Giving the properties for the folder contents as if they were multi-selected would be nice, we'll see how it goes!

      Nate I have artifacts, the physics is set up and sometimes such artifacts appear... I don’t touch anything..... I made a video but where should I send it?

      Nate Hi, I have two suggestions. Is it possible to add the ability to turn constraints on/off, and is it possible to add an option for uniform scaling for scaleX in physical constraints?

      • Nate respondió a esto

        Nate не меняются значение в секвенции( бета версия
        последняя). не все кадры выводятся (не хватает последних кадров)

        • Nate respondió a esto

          habahu Disable Simulate or set physics constraint mix to 0. We've discussed uniform scaling. I'm not sure if it should be part of physics constraint or a future constraint that ties together transform properties.

          zakaroff You can post videos on YouTube/etc. The sequence FPS keying should be fixed in 4.2.04-beta. Please say the version number you are using, not just "latest one", as we release often. When the checkbox you circled is unchecked, the last frame is omitted.

            Nate я использую 4.2.04-beta, при выводе пнг секвенции с spine 2d то секвенция обрезается и видео получается дерганым как будто не хватает кадров в конце.

            Nate видео где показаны ошибки (бета-версии 4.2.04)

            • Nate respondió a esto

              OK, but I have no idea what I should be looking for.

              Hello!
              We're trying out new physics constraints and we are very excited to use them!
              Can you please tell me if unity&csharp runtime 4.2 beta has a support for new physics constraints?
              Can't figure out how to use it

                Will it be possible to access at gravity and wind properties from the runtime, globally, without having to loop on every constraint?

                • Nate respondió a esto

                  Milerael

                  UPD: From reading SkeletonJson.cs in csharp runtime I can see that physics constraints are not being parsed.

                  But I can also see that they are being parsed in spineLibGdx -> SkeletonJson.java

                  So if i got that right, physics constraints are not currently supported by csharp and unity runtimes.
                  Can you share some info on when to expect the support for this amazing feature?

                  • Nate respondió a esto