All Classes Files Functions Variables Pages
UsdPhysics Migration Guide

Migration from legacy PhysicsSchema

  • General:
    • all attributes are prefixed with physics, so say density is now physics:density attribute
    • apiName removes physics prefix, so GetDensity is still used
    • PhysicsSchemaPhysicsScene is now UsdPhysicsScene etc
    • units:
      • units respect metersPerUnit
      • all dimensional angular values are specified in degrees
  • PhysicsSchemaAPI and PhysicsSchemaMultipleAPI and its custom Unapply removed - use native UsdPrim::RemoveAPI function instead.
  • PhysicsScene:
    • rename PhysicsSchemaPhysicsScene to UsdPhysicsScene
    • gravity replaced by gravityDirection and gravityMagnitude default values can be used now, default direction (0,0,0) will pick the current -UpAxis default magnitude -inf will pick earth gravity based on metersPerUnit
    • invertCollisionGroupFilter was moved to PhysxPhysicsScene
  • PhysicsAPI:
    • rename to UsdPhysicsRigidBodyAPI
    • CreatePhysicsEnabledAttr rename to CreateRigidBodyEnabledAttr
    • bodyType - removed, was not used
    • PhysxRigidBodyAPI::wakeOnStart replaced by UsdPhysicsRigidBodyAPI::physics::startsAsleep
    • new attributes physics::velocity and physics::angularVelocity - VelocityAPI was removed
    • angularVelocity is in degrees
    • velocity is in world space used by omni.physx, there will be a flag to turn on local space as thats the default behavior to have velocity in a local space
  • VelocityAPI:
    • removed use UsdPhysicsRigidBodyAPI::physics::velocity and UsdPhysicsRigidBodyAPI::physics::angularVelocity instead
  • MassPI:
    • rename to UsdPhysicsMassAPI
    • mass attribute changed to float
    • density attribute changed to float, density now respects metersPerUnit so a density 1000 when stage is in meters is 0.001 when a stage is in cm
    • centerOfMass attribute changed from double3 to point3f
    • diagonalTensor attribute changed from double3 to float3, inertia respects metersPerUnit now, the units are mass*distance*distance
    • principalAxes attribute changed from quatd to quatf
  • CollisionAPI:
    • rename to UsdPhysicsCollisionAPI
    • physicsMaterial rel removed, use material binding instead. There is a helper function for that in physicsUtils.py def add_physics_material_to_prim(stage, prim, materialPath): bindingAPI = UsdShade.MaterialBindingAPI.Apply(prim) materialPrim = UsdShade.Material(stage.GetPrimAtPath(materialPath)) bindingAPI.Bind(materialPrim, UsdShade.Tokens.weakerThanDescendants, "physics")
    • collisionGroup rel removed, use collection:colliders that automatically applied to a UsdPhysicsCollisionGroup. Colliders that belong a certain collision group are now defined through the collection on a collisionGroup.
  • PhysxMeshCollisionAPI::approximation was replaced by UsdPhysicsMeshCollisionAPI
    • use UsdPhysicsMeshCollisionAPI::approximation to define the mesh approximation
  • PhysicsMaterialAPI:
    • density attribute changed from double to float, density now respects metersPerUnit so a density 1000 when stage is in meters is 0.001 when a stage is in cm
  • CollisionGroup:
    • rename to UsdPhysicsCollisionGroup
    • does have automatically UsdCollection:colliders applied, this collection holds the colliders that belong to that group
  • FilteringPairsAPI:
  • Plane:
  • PhysicsJoint:
    • localPos0, localPos1 changed from float3 to point3f
    • jointFriction - was never used, so got removed
    • added excludeFromArticulation that defines whether a joint should be excluded from an articulation, maximalJoint can be defined through this
    • breakForce uses metersPerUnits - mass * distance / time / time
    • breakTorque uses metersPerUnits - mass * distance * distance / time / time
  • RevolutePhysicsJoint:
  • PrismaticPhysicsJoint:
  • SphericalPhysicsJoint:
  • DistancePhysicsJoint:
  • FixedPhysicsJoint:
  • LimitAPI:
  • DriveAPI:
    • rename to UsdPhysicsDriveAPI
    • maxForce - units: linear drive: mass*DIST_UNITS/time/time angular drive: mass*DIST_UNITS*DIST_UNITS/time/time
    • targetType was removed instead its possible to set both targetPosition and targetVelocity through separate attributes.
    • targetPosition/targetVelocity for angular drive in degree
  • ArticulationAPI:
  • ArticulationJointAPI:
    • both were removed and ArticulationRootAPI has been introduced.
    • fixed articulations should have ArticulationRootAPI on a root joint that is connected to world or in the hierarchy above the joint
    • floating articulations should have ArticulationRootAPI on a body where articulation starts on in a hierarchy above.