No announcement yet.

Physical constraints for a hierarchical model

  • Filter
  • Time
  • Show
Clear All
new posts

    Physical constraints for a hierarchical model

    I have a hierarchical rigid armature (such as a robot arm or leg)
    This is rendered using individual static meshes, not using a skinned mesh.
    I have created static mesh components in my actor for each segment.
    I have meshes for the segments.
    I use the convention that 0,0,0 in the mesh is the attachment to the parent.
    I then offset each child bone by length-of-parent-bone along the X axis, and attach/rotate the child appropriately there.
    The bone pieces have collisions that are carefully constructed to not interfere while the armature is articulating, so it shouldn't "explode" through self-penetration.

    No, I want this to articulate as a physical assembly, as a single actor.
    I tried checking "Simulate Physics" together with "fix position x/y/z" and "fix rotation x/z" so that I create a revolute joint that only rotates around the Y axis.
    However, when I start simulating this, each particular sub-object is fixed in world space, and swings around the pivot point.

    How can I make this assembly be articulated in component parent space, rather than world space?
    I know about the PhysicsConstraintActor, but I don't want to build my assembly out of a dozen actors.

    Here is the physics setup for each link in the armature:

    Click image for larger version

Name:	physics-setup.jpg
Views:	1
Size:	71.6 KB
ID:	1212159

    Interesting, i'm also curious on how to properly handle static-mesh skeleton like that!
    LinkedIn | Link custom Shaders in 4.21/4.22/4.23 | Atmosphere Modelisation | Distance Matching Locomotion | Nvidia GameWorks builds - 4.19.2 : VXGI2.0, Blast, HairWorks, Flow - Plugins: VictoryBP


      So, reading the code, in BodyInstance.cpp, there is no mention of any parent of the component, so I don't think this can currently be done.

      The follow-up question is then how to best create sub-actors for each of these bones in the armature, such that I can still drag a single blueprint into the scene to instance them, designate the blueprint as a default pawn, etc?

      Or, separately, it wouldn't be terrible hard to find the component parent, check whether that simulates physics, and then attach that as the simulation parent if it's configured.

      		DOFConstraint->InitConstraint(this, nullptr, 1.f, OwnerComponent.Get());
      I don't think that would break old projects, because presumably nobody configures a hierarchy of components to simulate physics right now because it doesn't work as expected.
      Maybe I'll give that a go?


        Progress! Further questions in this thread: