In 5.4
If you want to add collision you need to add the good schemas to your prim and then the token physics:approximation value and the physics:collisionEnabled boolean
over "pCylinder380" (
prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"]
)
{
uniform token physics:approximation = "boundingCube"
bool physics:collisionEnabled = 1
approximations values are
If you want to use another mesh as your collision mesh :
- Meshes that represent collision shapes should be sibling from rendering mesh
- These meshes should have the “guide” purpose
- These meshes must use the “PhysicsCollisionAPI”, “PhysicsMeshCollisionAPI”. They should also use the none approximation
def Mesh "Duck" (
prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"]
prepend references = @Assets/Game/USD/Duck.usda@
)
{
token visibility = "inherited"
matrix4d xformOp:transform = ( (1, -0, 0, 0), (0, 1, -0, 0), (0, 0, 1, 0), (-80, -150, 20, 1) )
uniform token[] xformOpOrder = ["xformOp:transform"]
}
def Mesh "Box" (
prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"]
prepend references = @Assets/Game/Box.usda@
)
{
token visibility = "inherited"
matrix4d xformOp:transform = ( (1, -0, 0, 0), (0, 1, -0, 0), (0, 0, 1, 0), (-70, -150, 20, 1) )
uniform token[] xformOpOrder = ["xformOp:transform"]
uniform token purpose = "guide"
uniform token physics:approximation = "none"
}
def Mesh "Sphere" (
prepend apiSchemas = ["PhysicsCollisionAPI", "PhysicsMeshCollisionAPI"]
prepend references = @Assets/Game/Sphere.usda@
)
{
token visibility = "inherited"
matrix4d xformOp:transform = ( (1, -0, 0, 0), (0, 1, -0, 0), (0, 0, 1, 0), (-50, -150, 100, 1) )
uniform token[] xformOpOrder = ["xformOp:transform"]
uniform token purpose = "guide"
uniform token physics:approximation = "none"
}
The cube and sphere will be used as collision meshes for the duck