PhysX Glue Bridge

by John Rand

Scene File: Max9_PhysXGlue_Bridge_finish.max

This tutorial is a basic explanation of how to Glue mulptiple objects together to create a single dynamic object. The scene contains two arrays of cylinders to be used as rope segments, four box primitives that will be anchors for the ropes, and a box primitive array for the bridge planks. There are 4 selection sets; one for the anchors, one planks, and one for each span of rope.


Part 1 - Preparing the Scene Geometry


Open the file Max9_PhysXGlue_Bridge_start.max

First we need to setup the bridge anchors. Since these objects will not need to be affected by gravity or any other part of the simulation other than providing something for Glue to bind to, the easiest solution is to simply add the PFlow Collision Shape Modifier to them.

Choose the Planks selection set to select the anchors, go to the modify panel and add a PFlow Collision Shape world space modifier. This will create an instance of the modifier for each of the anchor shapes. Creating an instance of the modifier allows you to activate/deactive or modify the settings to one instance of the modifier and the remaining 3 modifiers will inheret the changes simplifying the process. Grouping the anchors and adding a single modifier is also possible as long as you choose the "Geometry" collision type. Bear in mind the more complex the you build your collision shapes the longer it will take to simulate.

 


Part 2 - Setup the Box#2 Dynamics


Next create a standard PhysX Flow.

Open Particle View (Keyboard Shortcut 6) to create a new particle flow system.

  • Drag a new PhysX Flow into the field
  • Remove the Shape operator
  • Remove the Spin operator
  • Create or drag a new Birth Group operator into Event01
  • Set the PhysX Shape operator to Type - Capsule Shift + Drag Event01 to clone a copy - choose copy
  • Select Event01 Birth Group
    • Rename the event "Ropes"
    • Choose the Selection Set "Rope_L"
    • The add "Selected" option is now available in the Birth Group Particle Object section, press it to add the "Rope_L" Selection Set
    • Do the same for the "Rope_U" Selection Set
    • Hide the base objects
  • Select Event02 Birth Group
    • Rename the event to "Planks"
    • Choose the Selection Set "Planks"
    • Press the "Selected" button to add the "Planks" Selection Set to the Birth Group
    • Hide the base objects
    • Wire the new event to the global PF source node
  • Click the PhysX World operator
    • Press the "=>" -Access Driver Parameters- button
    • In the modify panel notice the PhysX World Driver is now selected, turn Off ground Collision Plane
    • Scroll down to advanced parameters, open the rollout Set the Sub-frame Factor to 24 -- to increase system accuracy, this is just a starting point
    • NOTE: a good rule of thumb for this setting, "Max Binds p/Particle" multiplied by 2 plus 2 or (MBP*2)+2

       

 

Finalize the "Ropes" event first.

  • Select the "Ropes" event PhysX Shape operator
    • Set the Type to Capsule
    • Set the Interpenetration Tolerence to 1.0
    • Change the Mass type to Value and set it to 1.0
      OR
      If you have Box#3
  • Add or append a new PhysX Collision test operator
    • Add the Anchors to the test's Deflectors listbox
  • Add or append a new PhysX Glue test operator
    • Set the Bind Type to "Distance"
    • Bind Distance to 6.0 --Since the Cylinders that are used as sections of rope are a height of 5.0 the Bind Distance should be relatively close to that value
    • Tick Allow Binding Penetration --this allows the shapes to interpenetrate, creating a "Softer" simulation for the rope (Example HERE)
    • Scroll down and Enable Deflectors
    • Add all of the Anchors to the list
    • The final setting is the Maximum Distance Limit set this to Absolute 0.0 --to maintain as close to the original binding length as possible

 

Now finalize the "Planks" event.

  • Add a PhysX Drag opertor --the Drag operator resides in this event since the Plank particle objects have a higher mass than the Rope particles making it more effective
    • Enable Linear and set it to 5.0
    • Change the angular value to 2.0
  • Select the PhysX Shape operator
    • Set the Type to Box if it is not already
    • Change the Mass Type to Value and assign the value 50.0 (or do as you did for the first event if you have Box#3)
  • Add or append a new PhysX Glue test operator
    • Set the Bind Type to "Rigid"
    • Bind Distance to 25.0
    • Scroll down and disable "Current Event Particles'
    • Now Enable "Other Event Particles" and select the "Ropes" Event (Event 01)

 

Play the Animation

 


Taken Further


This scene can easily be taken further by repeating the steps above. The most important thing to take into consideration is the order of binding. Since most bind groups will generally consist of different length Binds, it is necessary to use multiple Glue Tests to get the desired result.

Here is an example taken from the scene above with a few more details added...and what fun is it if you don't drop something on it :)

Scene File: Max9_PhysXGlue_Bridge_further.max