Python API#
This module contains python bindings to the C++ omni::physx interface.
omni::physx contains several interfaces:
PhysX – Main interface used for physics simulation.
PhysXVisualization – Interface for debug visualization control.
PhysXUnitTests – Interface for unit tests.
- Settings attributes available in this module:
SETTING_AUTOCREATE_PHYSICS_SCENE = “/persistent/physics/autocreatePhysicsScene”
SETTING_RESET_ON_STOP = “/physics/resetOnStop”
SETTING_USE_ACTIVE_CUDA_CONTEXT = “/persistent/physics/useActiveCudaContext”
SETTING_CUDA_DEVICE = “/physics/cudaDevice”
SETTING_DEFAULT_SIMULATOR = “/physics/defaultSimulator”
SETTING_PHYSICS_SCENE_MULTIGPU_MODE = “/physics/sceneMultiGPUMode”
SETTING_NUM_THREADS = “/persistent/physics/numThreads”
SETTING_MAX_NUMBER_OF_PHYSX_ERRORS = “/physics/maxNumberOfPhysXErrors”
SETTING_PHYSX_DISPATCHER = “/physics/physxDispatcher”
SETTING_EXPOSE_PROFILER_DATA = “/physics/exposeProfilerData”
SETTING_EXPOSE_PRIM_PATH_NAMES = “/physics/exposePrimPathNames”
SETTING_FORCE_PARSE_ONLY_SINGLE_SCENE = “/physics/forceParseOnlySingleScene”
SETTING_SIMULATE_EMPTY_SCENE = “/physics/simulateEmptyScene”
SETTING_DISABLE_SLEEPING = “/physics/disableSleeping”
SETTING_ENABLE_SYNCHRONOUS_KERNEL_LAUNCHES = “/physics/enableSynchronousKernelLaunches”
SETTING_DISABLE_CONTACT_PROCESSING = “/physics/disableContactProcessing”
SETTING_USE_LOCAL_MESH_CACHE = “/persistent/physics/useLocalMeshCache”
SETTING_LOCAL_MESH_CACHE_SIZE_MB = “/persistent/physics/localMeshCacheSizeMB”
SETTING_UJITSO_COOKING_DEV_KEY = “/physics/cooking/ujitsoCookingDevKey”
SETTING_UJITSO_COLLISION_COOKING = “/physics/cooking/ujitsoCollisionCooking”
SETTING_UJITSO_REMOTE_CACHE_ENABLED = “/physics/cooking/ujitsoRemoteCacheEnabled”
SETTING_UJITSO_COOKING_MAX_PROCESS_COUNT = “/persistent/physics/cooking/ujitsoCookingMaxProcessCount”
SETTING_UPDATE_TO_USD = “/physics/updateToUsd”
SETTING_UPDATE_VELOCITIES_TO_USD = “/physics/updateVelocitiesToUsd”
SETTING_OUTPUT_VELOCITIES_LOCAL_SPACE = “/physics/outputVelocitiesLocalSpace”
SETTING_UPDATE_PARTICLES_TO_USD = “/physics/updateParticlesToUsd”
SETTING_UPDATE_RESIDUALS_TO_USD = “/physics/updateResidualsToUsd”
SETTING_MIN_FRAME_RATE = “/persistent/simulation/minFrameRate”
SETTING_JOINT_BODY_TRANSFORM_CHECK_TOLERANCE = “/simulation/jointBodyTransformCheckTolerance”
SETTING_ENABLE_EXTENDED_JOINT_ANGLES = “/physics/enableExtendedJointAngles”
SETTING_COLLISION_APPROXIMATE_CONES = “/physics/collisionApproximateCones”
SETTING_COLLISION_APPROXIMATE_CYLINDERS = “/physics/collisionApproximateCylinders”
SETTING_MOUSE_INTERACTION_ENABLED = “/physics/mouseInteractionEnabled”
SETTING_MOUSE_GRAB = “/physics/mouseGrab”
SETTING_MOUSE_GRAB_IGNORE_INVISBLE = “/physics/mouseGrabIgnoreInvisible”
SETTING_MOUSE_GRAB_WITH_FORCE = “/physics/forceGrab”
SETTING_MOUSE_PUSH = “/physics/mousePush”
SETTING_MOUSE_PICKING_FORCE = “/physics/pickingForce”
SETTING_PHYSICS_DEVELOPMENT_MODE = “/physics/developmentMode”
SETTING_SUPPRESS_READBACK = “/physics/suppressReadback”
SETTING_NUM_EVENT_PUMPS_FOR_TEST_STAGE_SETUP = “/physics/numEventPumpsForTestStageSetup”
SETTING_OVERRIDE_GPU = “/persistent/physics/overrideGPUSettings”
SETTING_LOG_ROBOTICS = “/physics/logRobotics”
SETTING_LOG_SCENEMULTIGPU = “/physics/logSceneMultiGPU”
SETTING_DEMO_ASSETS_PATH = “/physics/demoAssetsPath”
SETTING_TESTS_ASSETS_PATH = “/physics/testsAssetsPath”
SETTING_ADDMENU_SELECTION_LIMIT = “/physics/addMenuSelectionLimit”
SETTING_ADDMENU_SUBTREE_LIMIT = “/physics/addMenuSubtreeLimit”
SETTING_VISUALIZATION_COLLISION_MESH = “/persistent/physics/visualizationCollisionMesh”
SETTING_DISPLAY_COLLIDERS = “/persistent/physics/visualizationDisplayColliders”
SETTING_DISPLAY_COLLIDER_NORMALS = “/persistent/physics/visualizationDisplayColliderNormals”
SETTING_DISPLAY_MASS_PROPERTIES = “/persistent/physics/visualizationDisplayMassProperties”
SETTING_DISPLAY_JOINTS = “/persistent/physics/visualizationDisplayJoints”
SETTING_DISPLAY_SIMULATION_OUTPUT = “/persistent/physics/visualizationSimulationOutput”
SETTING_AUTO_POPUP_SIMULATION_OUTPUT_WINDOW = “/physics/autoPopupSimulationOutputWindow”
SETTING_DISPLAY_SIMULATION_DATA_VISUALIZER = “/persistent/physics/visualizationSimulationDataVisualizer”
SETTING_DISPLAY_TENDONS = “/persistent/physics/visualizationDisplayTendons”
SETTING_DISPLAY_DEFORMABLE_BODIES = “/persistent/physics/visualizationDisplayDeformableBodies”
SETTING_DISPLAY_DEFORMABLE_BODY_TYPE = “/persistent/physics/visualizationDisplayDeformableBodyType”
SETTING_DISPLAY_DEFORMABLE_SURFACES = “/persistent/physics/visualizationDisplayDeformableSurfaces”
SETTING_DISPLAY_ATTACHMENTS = “/persistent/physics/visualizationDisplayAttachments”
SETTING_DISPLAY_ATTACHMENTS_HIDE_ACTOR_0 = “/persistent/physics/visualizationDisplayAttachmentsHideActor0”
SETTING_DISPLAY_ATTACHMENTS_HIDE_ACTOR_1 = “/persistent/physics/visualizationDisplayAttachmentsHideActor1”
SETTING_DISPLAY_DEFORMABLES = “/persistent/physics/visualizationDisplayDeformables”
SETTING_DISPLAY_DEFORMABLE_MESH_TYPE = “/persistent/physics/visualizationDisplayDeformableMeshType”
SETTING_DISPLAY_DEFORMABLE_ATTACHMENTS = “/persistent/physics/visualizationDisplayDeformableAttachments”
SETTING_ENABLE_DEFORMABLE_BETA = “/persistent/physics/enableDeformableBeta”
SETTING_DISPLAY_PARTICLES = “/persistent/physics/visualizationDisplayParticles”
SETTING_VISUALIZATION_GAP = “/persistent/physics/visualizationGap”
SETTING_DEBUG_VIS_SIMPLIFY_AT_DISTANCE = “/persistent/physics/visualizationSimplifyAtDistance”
SETTING_DEBUG_VIS_QUERY_USDRT_FOR_TRAVERSAL = “/persistent/physics/visualizationQueryUsdrtForTraversal”
SETTING_MASS_DISTRIBUTION_MANIPULATOR = “/persistent/physics/massDistributionManipulator”
SETTING_ENABLE_PARTICLE_AUTHORING = “/physics/enableParticleAuthoring”
SETTING_ENABLE_ATTACHMENT_AUTHORING = “/physics/enableAttachmentAuthoring”
SETTING_DISPLAY_PARTICLES_SHOW_DIFFUSE = “/persistent/physics/visualizationDisplayParticlesShowDiffuseParticles”
SETTING_DISPLAY_PARTICLES_POSITION_TYPE = “/persistent/physics/visualizationDisplayParticlesParticlePositions”
SETTING_DISPLAY_PARTICLES_RADIUS_TYPE = “/persistent/physics/visualizationDisplayParticlesParticleRadius”
SETTING_DISPLAY_PARTICLES_SHOW_PARTICLE_SET_PARTICLES = “/persistent/physics/visualizationDisplayParticlesShowParticleSetParticles”
SETTING_DISPLAY_PARTICLES_SHOW_FLUID_SURFACE = “/persistent/physics/visualizationDisplayParticlesShowFluidSurface”
SETTING_DISPLAY_PARTICLES_SHOW_CLOTH_MESH_LINES = “/persistent/physics/visualizationDisplayParticlesClothMeshLines”
SETTING_DISPLAY_PARTICLES_SHOW_CLOTH_PARTICLES = “/persistent/physics/visualizationDisplayParticlesShowDeformableParticles”
SETTING_DISPLAY_PARTICLES_SHOW_CLOTH_MESH = “/persistent/physics/visualizationDisplayParticlesShowDeformableMesh”
SETTING_PVD_IP_ADDRESS = “/persistent/physics/pvdIP”
SETTING_PVD_STREAM_TO_FILE = “/persistent/physics/pvdStreamToFile”
SETTING_PVD_OUTPUT_DIRECTORY = “/persistent/physics/pvdOutputDirectory”
SETTING_PVD_PROFILE = “/persistent/physics/pvdProfile”
SETTING_PVD_DEBUG = “/persistent/physics/pvdDebug”
SETTING_PVD_MEMORY = “/persistent/physics/pvdMemory”
SETTING_PVD_ENABLED = “/persistent/physics/pvdEnabled”
SETTING_OMNIPVD_OVD_RECORDING_DIRECTORY = “/persistent/physics/omniPvdOvdRecordingDirectory”
SETTING_OMNIPVD_ENABLED = “/physics/omniPvdOutputEnabled”
SETTING_OMNIPVD_IS_OVD_STAGE = “/physics/omniPvdIsOVDStage”
SETTING_OMNIPVD_IS_RECORDING = “/physics/omniPvdIsRecording”
SETTING_TEST_RUNNER_FILTER = “/persistent/physics/testRunnerFilter”
SETTING_TEST_RUNNER_SELECTION = “/persistent/physics/testRunnerSelection”
SETTING_TEST_RUNNER_STATUS = “/physics/testRunnerStatus”
SETTING_TEST_RUNNER_REPEATS = “/physics/testRunnerRepeats”
SETTING_SHOW_COLLISION_GROUPS_WINDOW = “/physics/showCollisionGroupsWindow”
- class omni.physx.bindings._physx.ContactData#
Contact data.
- property face_index0#
Face index 0 - non zero only for meshes
- property face_index1#
Face index 1 - non zero only for meshes.
- property impulse#
Contact impulse
- property material0#
Material0 - uint64 use PhysicsSchemaTools::intToSdfPath to convert to SdfPath.
- property material1#
Material1 - uint64 use PhysicsSchemaTools::intToSdfPath to convert to SdfPath.
- property normal#
Contact normal.
- property position#
Contact position.
- property separation#
Contact separation value.
- class omni.physx.bindings._physx.ContactDataVector#
- append( ) None #
Add an item to the end of the list
- clear( ) None #
Clear the contents
- extend(*args, **kwargs)#
Overloaded function.
extend(self: omni.physx.bindings._physx.ContactDataVector, L: omni.physx.bindings._physx.ContactDataVector) -> None
Extend the list by appending all the items in the given list
extend(self: omni.physx.bindings._physx.ContactDataVector, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(
- self: omni.physx.bindings._physx.ContactDataVector,
- i: int,
- x: omni.physx.bindings._physx.ContactData,
Insert an item at a given position.
- pop(*args, **kwargs)#
Overloaded function.
pop(self: omni.physx.bindings._physx.ContactDataVector) -> omni.physx.bindings._physx.ContactData
Remove and return the last item
pop(self: omni.physx.bindings._physx.ContactDataVector, i: int) -> omni.physx.bindings._physx.ContactData
Remove and return the item at index
i
- class omni.physx.bindings._physx.ContactEventHeader#
Contact event header.
- property actor0#
Actor0 - uint64 use PhysicsSchemaTools::intToSdfPath to convert to SdfPath.
- property actor1#
Actor1 - uint64 use PhysicsSchemaTools::intToSdfPath to convert to SdfPath.
- property collider0#
Collider0 - uint64 use PhysicsSchemaTools::intToSdfPath to convert to SdfPath.
- property collider1#
Collider1 - uint64 use PhysicsSchemaTools::intToSdfPath to convert to SdfPath.
- property contact_data_offset#
Contact data offset.
- property friction_anchors_offset#
Friction anchors data offset.
- property num_contact_data#
Number of contact data.
- property num_friction_anchors_data#
Number of contact data.
- property proto_index0#
Protoindex0 from a point instancer (0xFFFFFFFF means collider is not part of an instancer).
- property proto_index1#
Protoindex1 from a point instancer (0xFFFFFFFF means collider is not part of an instancer).
- property stage_id#
Stage id.
- property type#
Contact event type.
- class omni.physx.bindings._physx.ContactEventHeaderVector#
- append(
- self: omni.physx.bindings._physx.ContactEventHeaderVector,
- x: omni.physx.bindings._physx.ContactEventHeader,
Add an item to the end of the list
- clear( ) None #
Clear the contents
- extend(*args, **kwargs)#
Overloaded function.
extend(self: omni.physx.bindings._physx.ContactEventHeaderVector, L: omni.physx.bindings._physx.ContactEventHeaderVector) -> None
Extend the list by appending all the items in the given list
extend(self: omni.physx.bindings._physx.ContactEventHeaderVector, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(
- self: omni.physx.bindings._physx.ContactEventHeaderVector,
- i: int,
- x: omni.physx.bindings._physx.ContactEventHeader,
Insert an item at a given position.
- pop(*args, **kwargs)#
Overloaded function.
pop(self: omni.physx.bindings._physx.ContactEventHeaderVector) -> omni.physx.bindings._physx.ContactEventHeader
Remove and return the last item
pop(self: omni.physx.bindings._physx.ContactEventHeaderVector, i: int) -> omni.physx.bindings._physx.ContactEventHeader
Remove and return the item at index
i
- class omni.physx.bindings._physx.ContactEventType#
Contact event type.
Members:
CONTACT_FOUND : Contact found.
CONTACT_LOST : Contact lost.
CONTACT_PERSIST : Contact persist.
- CONTACT_FOUND = <ContactEventType.CONTACT_FOUND: 0>#
- CONTACT_LOST = <ContactEventType.CONTACT_LOST: 1>#
- CONTACT_PERSIST = <ContactEventType.CONTACT_PERSIST: 2>#
- property name#
- property value#
- class omni.physx.bindings._physx.ErrorEvent#
Error events used by physics error event stream.
Members:
USD_LOAD_ERROR : Usd load error, event has dictionary with key ‘errorString’:string
PHYSX_ERROR : PhysX runtime error, event has dictionary with key ‘errorString’:string
PHYSX_TOO_MANY_ERRORS : PhysX exceeded maximum number of reported errors, event has dictionary with key ‘errorString’:string
PHYSX_CUDA_ERROR : PhysX GPU Cuda error, event has dictionary with key ‘errorString’:string
- PHYSX_CUDA_ERROR = <ErrorEvent.PHYSX_CUDA_ERROR: 2>#
- PHYSX_ERROR = <ErrorEvent.PHYSX_ERROR: 1>#
- PHYSX_TOO_MANY_ERRORS = <ErrorEvent.PHYSX_TOO_MANY_ERRORS: 3>#
- USD_LOAD_ERROR = <ErrorEvent.USD_LOAD_ERROR: 0>#
- property name#
- property value#
- class omni.physx.bindings._physx.FrictionAnchor#
Contact data.
- property impulse#
Contact impulse
- property position#
Contact position.
- class omni.physx.bindings._physx.FrictionAnchorsDataVector#
- append(
- self: omni.physx.bindings._physx.FrictionAnchorsDataVector,
- x: omni.physx.bindings._physx.FrictionAnchor,
Add an item to the end of the list
- clear( ) None #
Clear the contents
- extend(*args, **kwargs)#
Overloaded function.
extend(self: omni.physx.bindings._physx.FrictionAnchorsDataVector, L: omni.physx.bindings._physx.FrictionAnchorsDataVector) -> None
Extend the list by appending all the items in the given list
extend(self: omni.physx.bindings._physx.FrictionAnchorsDataVector, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(
- self: omni.physx.bindings._physx.FrictionAnchorsDataVector,
- i: int,
- x: omni.physx.bindings._physx.FrictionAnchor,
Insert an item at a given position.
- pop(*args, **kwargs)#
Overloaded function.
pop(self: omni.physx.bindings._physx.FrictionAnchorsDataVector) -> omni.physx.bindings._physx.FrictionAnchor
Remove and return the last item
pop(self: omni.physx.bindings._physx.FrictionAnchorsDataVector, i: int) -> omni.physx.bindings._physx.FrictionAnchor
Remove and return the item at index
i
- class omni.physx.bindings._physx.IPhysxBenchmarks#
This interface is the access point to the omni.physx benchmarks.
- enable_profile(
- self: omni.physx.bindings._physx.IPhysxBenchmarks,
- enable_profile: bool,
Enabled profiling :param enable_profile: Do custom physics profiling
- get_profile_stats( ) dict #
Get profiling stats
- subscribe_profile_stats_events(
- self: omni.physx.bindings._physx.IPhysxBenchmarks,
- fn: Callable[[List[omni.physx.bindings._physx.PhysicsProfileStats]], None],
Subscribes to physics benchmark profile stats.
Subscription cannot be changed in the onUpdate callback
If subscribed the profile stats get reset after each call, this means get_profile_stats will not work as expected.
- Parameters:
fn – The callback to be called on every physics fetchResults.
- Returns:
The subscription holder.
- class omni.physx.bindings._physx.IPhysxPropertyQuery#
- query_prim(self: omni.physx.bindings._physx.IPhysxPropertyQuery, stage_id: int, prim_id: int, query_mode: omni.physx.bindings._physx.PhysxPropertyQueryMode = <PhysxPropertyQueryMode.QUERY_RIGID_BODY_WITH_COLLIDERS: 0>, timeout_ms: int = -1, finished_fn: Callable[[], None] = None, rigid_body_fn: Callable[[omni.physx.bindings._physx.PhysxPropertyQueryRigidBodyResponse], None] = None, collider_fn: Callable[[omni.physx.bindings._physx.PhysxPropertyQueryColliderResponse], None] = None, articulation_fn: Callable[[omni.physx.bindings._physx.PhysxPropertyQueryArticulationResponse], None] = None) None #
Returns information for given prim
- Parameters:
stage_id – uint64_t Stage id
prim_id – uint64_t USD path (use PhysicsSchemaTools::sdfPathToInt)
query_mode – PhysxPropertyQueryMode Type of query to be made
timeout_ms – int64 Timeout (in milliseconds) for the request. (-1 means wait forever)
finished_fn – function Report function called when enumeration of all objects is finished
rigid_body_fn – function Report function where rigid body information will be returned in PhysxPropertyQueryRigidBodyResponse object
collider_fn – function Report function where collider information will be returned in PhysxPropertyQueryRigidBodyResponse object
- class omni.physx.bindings._physx.IPhysxReplicator#
- register_replicator(
- self: omni.physx.bindings._physx.IPhysxReplicator,
- stage_id: int,
- replicator_attach_fn: Callable[[int], list],
- replicator_attach_end_fn: Callable[[int], None],
- hierarchy_rename_fn: Callable[[str, int], str],
Register replicator for given stage.
stage_id: current stageId
replicator_attach_fn: std::function<py::list(uint64_t stageId)>;
replicator_attach_end_fn: std::function<py::list(uint64_t stageId)>;
hierarchy_rename_fn: std::function<const char* (const char* replicatePath, uint32_t index)>;
- replicate(
- self: omni.physx.bindings._physx.IPhysxReplicator,
- stage_id: int,
- path: str,
- numReplications: int,
- useEnvIds: bool = False,
- useFabricForReplication: bool = False,
Replicate hierarchy.
- Parameters:
stage_id – stage id
path – path to replicate
numReplications – number of replications
useEnvIds – setup EnvIds. See below.
useFabricForReplication – replicate hierarchy through Fabric
Environment IDs are a more efficient way to filter out independent parts of a scene (the different environments). When enabled, filtering is automatically done early within the simulation pipeline, without the need to specify extra filtering parameters like collision groups, etc. EnvIDs also potentially make co-located envs faster.
When using environment IDs (i.e. useEnvIds = True), it is also possible to encode these IDs into the bounds of the GPU broadphase to improve its performance. This is controlled by a custom attribute of the UsdPhysicsScene (physxScene:envIdInBoundsBitCount). This defines the number of bits reserved for environment IDs in the encoded bounds of the GPU broadphase. Set it to -1 to disable that feature (default). Set it to a positive number in [1;16] to enable the feature (4 or 8 are good values for most cases). Additionally, setting it to 0 disables the feature but improves the accuracy of GPU bounds, which can lead to better performance when objects are located far away from the origin.
- unregister_replicator(
- self: omni.physx.bindings._physx.IPhysxReplicator,
- stage_id: int,
Unregister replicator from stage.
- class omni.physx.bindings._physx.IPhysxSimulation#
This interface is the access point to the omni.physx simulation control.
- apply_force_at_pos(
- self: omni.physx.bindings._physx.IPhysxSimulation,
- stage_id: int,
- body_path: int,
- force: carb._carb.Float3,
- pos: carb._carb.Float3,
- mode: str = 'Force',
Applies force at given body with given force position.
- Parameters:
stage_id – USD stageId
body_path – USD path of the body encoded in uint64_t use PhysicsSchemaTools::sdfPathToInt
force – Force to apply to the body.
pos – World position where the force is applied.
mode – Supporting various modes - Force (default), Impulse, Velocity, Acceleration.
- apply_force_at_pos_instanced(
- self: omni.physx.bindings._physx.IPhysxSimulation,
- stage_id: int,
- point_instancer_path: int,
- force: carb._carb.Float3,
- pos: carb._carb.Float3,
- mode: str = 'Force',
- proto_index: int = 4294967295,
Applies force at given point instancer body with given force position.
- Parameters:
stage_id – USD stageId
point_instancer_path – USD path to a point instancer encoded in uint64_t use PhysicsSchemaTools::sdfPathToInt
force – Force to apply to the target.
pos – World position where the force is applied.
mode – Supporting various modes - Force (default), Impulse, Velocity, Acceleration.
protoIndex – If protoIndex is 0xffffffff (default), force will be applied to all instances, otherwise it will only be applied to the instance at this index.
- apply_torque(
- self: omni.physx.bindings._physx.IPhysxSimulation,
- stage_id: int,
- body_path: int,
- torque: carb._carb.Float3,
Applies torque at given body at body center of mass.
- Parameters:
stage_id – USD stageId
body_path – USD path of the body encoded in uint64_t use PhysicsSchemaTools::sdfPathToInt
torque – Torque to apply to the body.
- apply_torque_instanced(
- self: omni.physx.bindings._physx.IPhysxSimulation,
- stage_id: int,
- body_path: int,
- torque: carb._carb.Float3,
- proto_index: int = 4294967295,
Applies torque at given point instancer body at body center of mass.
- Parameters:
stage_id – USD stageId
point_instancer_path – USD path to a point instancer encoded in uint64_t use PhysicsSchemaTools::sdfPathToInt
torque – Torque to apply to the body.
protoIndex – If protoIndex is 0xffffffff (default), torque will be applied to all instances, otherwise it will only be applied to the instance at this index.
- attach_stage(
- self: omni.physx.bindings._physx.IPhysxSimulation,
- stage_id: int,
Attach USD stage. This will run the physics parser and will populate the PhysX SDK with the corresponding simulation objects.
Note: previous stage will be detached.
- Parameters:
stage_id – USD stageId (can be retrieved from a stagePtr - UsdUtils.StageCache.Get().GetId(stage).ToLongInt())
- Returns:
Returns true if stage was successfully attached.
- check_results( ) bool #
Check if simulation finished.
- Returns:
Returns true if simulation has finished.
- check_results_scene(
- self: omni.physx.bindings._physx.IPhysxSimulation,
- scene_path: int,
Check if a simulation scene is finished. Disabling a scene has no effect on this function. If scenePath is empty, it behaves like IPhysxSimulation::checkResults
Returns True if the simulation scene is finished.
scenePath uint64_t Scene USD path use PhysicsSchemaTools::sdfPathToInt
- detach_stage( ) None #
Detach USD stage, this will remove all objects from the PhysX SDK
- fetch_results( ) None #
Fetch simulation results. Writing out simulation results based on physics settings.
Note This is a blocking call. The function will wait until the simulation is finished.
- fetch_results_scene(
- self: omni.physx.bindings._physx.IPhysxSimulation,
- scene_path: int,
Fetch simulation scene results and writes out simulation results based on physics settings for a specific scene. Disabling a scene has no effect on this function. If scenePath is empty, it behaves like IPhysxSimulation::fetchResults
Note: this is a blocking call. The function will wait until the simulation scene is finished.
scenePath uint64_t Scene USD path use PhysicsSchemaTools::sdfPathToInt
- flush_changes( ) None #
Flush changes will force physics to process buffered changes
Changes to physics gets buffered, in some cases flushing changes is required if order is required.
Example - prim A gets added. Existing prim B has a relationship that gets switched to use A. Currently, the relationship change gets processed immediately and fails because prim A only gets added at the start of the next sim step.
- get_attached_stage( ) int #
Returns the currently attached stage through the IPhysxSimulation interface
- Returns:
Returns USD stage id.
- get_contact_report( ) tuple #
Get contact report data for current simulation step directly.
The contact buffer data are available for one simulation step
- Returns:
Tuple with contact event vector and contact data vector:
'contact_headers': vector of contact event headers 'contact_data': vector of contact data 'friction_anchors': vector of friction anchors data
- get_full_contact_report( ) tuple #
Get contact report data for current simulation step directly, including friction anchors.
The contact buffer data are available for one simulation step
- Returns:
Tuple with contact event vector and contact data vector:
'contact_headers': vector of contact event headers 'contact_data': vector of contact data 'friction_anchors': vector of friction anchors data
- is_change_tracking_paused( ) bool #
Check if fabric change tracking for physics listener is paused or not
Returns true if paused change tracking.
- is_sleeping(
- self: omni.physx.bindings._physx.IPhysxSimulation,
- stage_id: int,
- body_path: int,
Is body sleeping.
- Parameters:
stage_id – USD stageId
body_path – USD path of the body encoded in uint64_t use PhysicsSchemaTools::sdfPathToInt
- Returns:
True if body is asleeep
- is_sleeping_instanced(
- self: omni.physx.bindings._physx.IPhysxSimulation,
- stage_id: int,
- body_path: int,
- proto_index: int,
Is point instancer bodypoint instancer body sleeping.
- Parameters:
stage_id – USD stageId
point_instancer_path – USD path to a point instancer encoded in uint64_t use PhysicsSchemaTools::sdfPathToInt
protoIndex – Check against the instance at this index.
- Returns:
True if body is asleeep
- pause_change_tracking(
- self: omni.physx.bindings._physx.IPhysxSimulation,
- pause: bool,
Pause fabric change tracking for physics listener.
- Parameters:
tracking. (pause bool Pause or unpause change)
- put_to_sleep(
- self: omni.physx.bindings._physx.IPhysxSimulation,
- stage_id: int,
- body_path: int,
Put body to sleep.
- Parameters:
stage_id – USD stageId
body_path – USD path of the body encoded in uint64_t use PhysicsSchemaTools::sdfPathToInt
- put_to_sleep_instanced(
- self: omni.physx.bindings._physx.IPhysxSimulation,
- stage_id: int,
- body_path: int,
- proto_index: int = 4294967295,
Put point instancer body to sleep.
- Parameters:
stage_id – USD stageId
point_instancer_path – USD path to a point instancer encoded in uint64_t use PhysicsSchemaTools::sdfPathToInt
protoIndex – If protoIndex is 0xffffffff (default), all instances will be put to sleep, otherwise it will only be applied to the instance at this index.
- simulate(
- self: omni.physx.bindings._physx.IPhysxSimulation,
- elapsed_time: float,
- current_time: float,
Execute physics asynchronous simulation.
- Parameters:
elapsed_time – Simulation time (seconds).
current_time – Current time (seconds), might be used for time sampled transformations to apply.
- simulate_scene(
- self: omni.physx.bindings._physx.IPhysxSimulation,
- scene_path: int,
- elapsed_time: float,
- current_time: float,
Execute the physics simulation on a specific scene.
The PhysX simulation in the scene will simulate the exact elapsedTime passed. No substepping will happen. It is the caller’s responsibility to provide a reasonable elapsedTime. In general it is recommended to use fixed size time steps with a maximum of 1/60 of a second. If scenePath is empty, it behaves like IPhysxSimulation::simulate
scenePath uint64_t Scene USD path use PhysicsSchemaTools::sdfPathToInt elapsedTime float Simulation time (seconds). currentTime float Current time (seconds), might be used for time sampled transformations to apply.
- subscribe_contact_report_events(
- self: omni.physx.bindings._physx.IPhysxSimulation,
- fn: Callable[[omni.physx.bindings._physx.ContactEventHeaderVector, omni.physx.bindings._physx.ContactDataVector], None],
Subscribes to contact report callback function.
The contact buffer data are available for one simulation step
- Parameters:
fn – The callback to be called after simulation step to receive contact reports.
- Returns:
The subscription holder.
- subscribe_full_contact_report_events(
- self: omni.physx.bindings._physx.IPhysxSimulation,
- fn: Callable[[omni.physx.bindings._physx.ContactEventHeaderVector, omni.physx.bindings._physx.ContactDataVector, omni.physx.bindings._physx.FrictionAnchorsDataVector], None],
Subscribes to contact report callback function including friction anchors.
The contact buffer data are available for one simulation step
- Parameters:
fn – The callback to be called after simulation step to receive contact reports.
- Returns:
The subscription holder.
- subscribe_physics_trigger_report_events(
- self: omni.physx.bindings._physx.IPhysxSimulation,
- trigger_report_fn: Callable[[omni.physx.bindings._physx.TriggerEventData], None],
- stage_id: int = 0,
- prim_id: int = 0,
Register for trigger notifications
- Parameters:
trigger_report_fn – function Report function where enter or leave trigger events will be notified
stage_id – uint64_t [Optional] Stage id to filter triggers from
prim_id – uint64_t [Optional] USD path to filter triggers from (use PhysicsSchemaTools::sdfPathToInt)
- Returns:
SubscriptionId Subscription Id that can be unregistered with unsubscribe_physics_trigger_report_events
- Return type:
subscription_id
- unsubscribe_physics_trigger_report_events(
- self: omni.physx.bindings._physx.IPhysxSimulation,
- subscriptionId: int,
Unregister a subscription for trigger notifications
- Parameters:
subscription_id – SubscriptionId Subscription Id
- wake_up(
- self: omni.physx.bindings._physx.IPhysxSimulation,
- stage_id: int,
- body_path: int,
Wake up body.
- Parameters:
stage_id – USD stageId
body_path – USD path of the body encoded in uint64_t use PhysicsSchemaTools::sdfPathToInt
- wake_up_instanced(
- self: omni.physx.bindings._physx.IPhysxSimulation,
- stage_id: int,
- body_path: int,
- proto_index: int = 4294967295,
Wake up point instancer body.
- Parameters:
stage_id – USD stageId
point_instancer_path – USD path to a point instancer encoded in uint64_t use PhysicsSchemaTools::sdfPathToInt
protoIndex – If protoIndex is 0xffffffff (default), all instances will be awakened, otherwise it will only be applied to the instance at this index.
- class omni.physx.bindings._physx.IPhysxStageUpdate#
- on_attach(
- self: omni.physx.bindings._physx.IPhysxStageUpdate,
- stage_id: int,
Called when a stage gets attached, does not load physics. Does just set internally stage.
- Parameters:
stage_id – Stage Id that should be attached
- on_detach( ) None #
Called when stage gets detached.
- on_fabric_attach(
- self: omni.physx.bindings._physx.IPhysxStageUpdate,
- stage_id: int,
Called again when a stage gets attached, but at a later point, where fabric stage is already created.
- Parameters:
stage_id – Stage Id that should be attached
- on_pause( ) None #
Called when timeline gets paused.
- on_reset( ) None #
Called when timeline is stopped.
- on_resume(
- self: omni.physx.bindings._physx.IPhysxStageUpdate,
- current_time: float,
Called when timeline play is requested.
- Parameters:
current_time – Current time in seconds
- on_update(
- self: omni.physx.bindings._physx.IPhysxStageUpdate,
- current_time: float,
- elapsed_secs: float,
- enable_update: bool,
Called when on stage update.
- Parameters:
current_time – Current time in seconds
elapsed_secs – Elapsed time from previous update in seconds
enable_update – Enable physics update, physics can be disabled, but we still need to update other subsystems
- class omni.physx.bindings._physx.IPhysxStatistics#
- enable_carb_stats_upload(
- self: omni.physx.bindings._physx.IPhysxStatistics,
- enable: bool,
Enables/disables upload of Physx statistics for all PhysicsScenes into carb::stats.
- Parameters:
enable – bool true=enable, false=disable.
- get_physx_scene_statistics(
- self: omni.physx.bindings._physx.IPhysxStatistics,
- stage_id: int,
- path: int,
- stats: omni.physx.bindings._physx.PhysicsSceneStats,
Get physics scene PhysX simulation statistics.
- Parameters:
stage_id – current stageId
path – physics scene path encoded into two integers. Use PhysicsSchemaTools.encodeSdfPath to get those.
stats – PhysicsSceneStats object to store the statistics.
- class omni.physx.bindings._physx.OverlapHit#
Overlap hit results structure.
- property collision#
Path string to the collision that was hit.
- property collision_encoded#
Encoded SdfPath to the collision that was hit. PhysicsSchemaTools.decodeSdfPath will return SdfPath.
- property protoIndex#
ProtoIndex, filled for pointInstancers otherwise 0xFFFFFFFF.
- property rigid_body#
Path string to the rigid body that was hit.
- property rigid_body_encoded#
Encoded SdfPath to the rigid body that was hit. PhysicsSchemaTools.decodeSdfPath will return SdfPath.
- class omni.physx.bindings._physx.ParticleVisualizationPositionType#
Particle position debug visualiztion option for smoothed fluid particles for use with SETTING_DISPLAY_PARTICLES_POSITION_TYPE.
- SIM_POSITIONS = 0#
- SMOOTHED_POSITIONS = 1#
- class omni.physx.bindings._physx.ParticleVisualizationRadiusType#
Particle radius debug visualization option for use with SETTING_DISPLAY_PARTICLES_RADIUS_TYPE.
- ANISOTROPY = 4#
- CONTACT_OFFSET = 0#
- PARTICLE_CONTACT_OFFSET = 2#
- PARTICLE_REST_OFFSET = 3#
- RENDER_GEOMETRY = 5#
- REST_OFFSET = 1#
- class omni.physx.bindings._physx.PhysX#
This interface is the main access point to omni.physx extension. It contains functions that can control the simulation, modify the simulation or work directly with physics objects.
- compute_vehicle_velocity(
- self: omni.physx.bindings._physx.PhysX,
- path: str,
- direction: carb._carb.Float3,
Get the linear velocity of a vehicle (vehicle prim needs to have vehicle API applied).
Note
Should only be called after the simulation has been started.
- Parameters:
path – Vehicle USD path.
direction – carb.Float3: Unit length direction vector along which the linear velocity should get computed. The vector is considered to be relative to the center of mass frame of the vehicle. If None is passed in, then the local forward direction of the vehicle will be used.
- Returns:
The velocity along the provided direction vector.
- force_load_physics_from_usd( ) None #
Forces load physics objects from USD into PhysX. By default physics is not loaded; this function forces a load of all physics from USD into PhysX.
- get_error_event_stream( ) carb.events._events.IEventStream #
Error event stream sending various error events defined in ErrorEvent enum.
- Returns:
Event stream sending the physics errors.
- get_overwrite_gpu_setting( ) int #
Get CPU vs GPU simulation settings.
- Returns:
-1 - use setting from schema, 0 - force CPU, 1 - force GPU
- Return type:
Integer defining the behavior
- get_rigidbody_transformation(
- self: omni.physx.bindings._physx.PhysX,
- path: str,
Gets rigid body current transformation in a global space.
- Parameters:
path – The USD path to the rigid body.
- Returns:
Return a dictionary with transformation info:
'ret_val': bool - whether transformation was found 'position': float3 - rigid body position 'rotation': float4 - rigid body rotation (quat - x,y,z,w)
- get_simulation_event_stream_v2( ) carb.events._events.IEventStream #
Simulation event stream sending various simulation events defined in SimulationEvent enum.
- Returns:
Event stream sending the simulation events.
- get_vehicle_drive_state(
- self: omni.physx.bindings._physx.PhysX,
- path: str,
Get the drive state of a vehicle.
Note
Should only be called after the simulation has been started.
- Parameters:
path – Vehicle USD path.
- Returns:
A dictionary with the following key, value pairs. An empty dictionary is returned for an invalid path, when the simulation is not running or when the vehicle does not have a Basic or Standard drive type.
VEHICLE_DRIVE_STATE_ACCELERATOR, d (in range [0, 1]),VEHICLE_DRIVE_STATE_BRAKE0, d (in range [0, 1]),VEHICLE_DRIVE_STATE_BRAKE1, d (in range [0, 1]),VEHICLE_DRIVE_STATE_STEER, d (in range [-1, 1]),VEHICLE_DRIVE_STATE_CLUTCH, d (in range [0, 1], only applicable to PhysxVehicleDriveStandard drive type),VEHICLE_DRIVE_STATE_CURRENT_GEAR, i (only applicable to PhysxVehicleDriveStandard drive type),VEHICLE_DRIVE_STATE_TARGET_GEAR, i (only applicable to PhysxVehicleDriveStandard drive type),VEHICLE_DRIVE_STATE_GEAR_SWITCH_TIME, d (in seconds, negative value if no gear shift is in process. Only applicable to PhysxVehicleDriveStandard drive type),VEHICLE_DRIVE_STATE_AUTOBOX_TIME_SINCE_LAST_SHIFT, d (in seconds, only applicable toPhysxVehicleDriveStandard drive type),VEHICLE_DRIVE_STATE_ENGINE_ROTATION_SPEED, d (in radians per second, only applicable to PhysxVehicleDriveStandard drive type),VEHICLE_DRIVE_STATE_AUTOMATIC_TRANSMISSION, i (only applicable to PhysxVehicleDriveStandard drive type)
- get_wheel_state(
- self: omni.physx.bindings._physx.PhysX,
- path: str,
Get the wheel state.
Note
Should only be called after the simulation has been started.
- Parameters:
path – Wheel attachment USD path.
- Returns:
A dictionary with the following key, value pairs. An empty dictionary is returned for an invalid path.
VEHICLE_WHEEL_STATE_LOCAL_POSE_POSITION, (d, d, d),VEHICLE_WHEEL_STATE_LOCAL_POSE_QUATERNION, (d, d, d, d)VEHICLE_WHEEL_STATE_ROTATION_SPEED, d (in radians per second),VEHICLE_WHEEL_STATE_ROTATION_ANGLE, d (in radians),VEHICLE_WHEEL_STATE_STEER_ANGLE, d (in radians),VEHICLE_WHEEL_STATE_GROUND_PLANE, (d, d, d, d) (first 3 entries are plane normal n, fourth entry is d of equation dot(n, v) + d = 0). Only valid if wheel is on ground, see VEHICLE_WHEEL_STATE_IS_ON_GROUND,VEHICLE_WHEEL_STATE_GROUND_ACTOR, string (USD path of the actor prim the wheel is driving on). Only valid if wheel is on ground, see VEHICLE_WHEEL_STATE_IS_ON_GROUND,VEHICLE_WHEEL_STATE_GROUND_SHAPE, string (USD path of the collider prim the wheel is driving on). Only valid if wheel is on ground, see VEHICLE_WHEEL_STATE_IS_ON_GROUND,VEHICLE_WHEEL_STATE_GROUND_MATERIAL, string (USD path of the material prim the wheel is driving on). Only valid if wheel is on ground, see VEHICLE_WHEEL_STATE_IS_ON_GROUND,VEHICLE_WHEEL_STATE_GROUND_HIT_POSITION, (d, d, d) (hit position on the ground in world space). Only valid if wheel is on ground, see VEHICLE_WHEEL_STATE_IS_ON_GROUND,VEHICLE_WHEEL_STATE_SUSPENSION_JOUNCE, d,VEHICLE_WHEEL_STATE_SUSPENSION_FORCE, (d, d, d),VEHICLE_WHEEL_STATE_TIRE_FRICTION, d,VEHICLE_WHEEL_STATE_TIRE_LONGITUDINAL_DIRECTION, (d, d, d),VEHICLE_WHEEL_STATE_TIRE_LATERAL_DIRECTION, (d, d, d),VEHICLE_WHEEL_STATE_TIRE_LONGITUDINAL_SLIP, d,VEHICLE_WHEEL_STATE_TIRE_LATERAL_SLIP, d,VEHICLE_WHEEL_STATE_TIRE_FORCE, (d, d, d),VEHICLE_WHEEL_STATE_IS_ON_GROUND, i, whether the wheel did touch the ground or is in air (=0). If the vehicle is disabled or sleeping then the wheel will be treated as not touching ground too.
- is_asyncsimrender_enabled( ) bool #
Returns true if asynchronous simulation and rendering is enabled for one of the scenes in the simulation.
- is_interactive_actor_raycast(
- self: omni.physx.bindings._physx.PhysX,
- origin: carb._carb.Float3,
- direction: carb._carb.Float3,
Raycast check to detect interactive physics actors
Note
Only produces positive results during simulation
- Parameters:
origin – carb.Float3: World-space origin of raycast
direction – carb.Float3: Unit-length direction vector of raycast
- Returns:
True if interactive actor is hit; False otherwise, or if simulation is not running
- is_readback_suppressed( ) bool #
Check if GPU readback is suppressed for currently running simulation.
- Returns:
True if simulation is running with suppressed readback. Always returns false when simulation is not running.
- is_running(self: omni.physx.bindings._physx.PhysX) bool #
Check if simulation loop is running, this function returns true if play was pressed or if IPhysxSimulation was attached.
- overwrite_gpu_setting(
- self: omni.physx.bindings._physx.PhysX,
- gpuSetting: int,
Override CPU vs GPU simulation settings.
- Parameters:
gpuSetting – Integer defining the behavior: -1 - use setting from schema, 0 - force CPU, 1 - force GPU
- overwrite_solver_type(
- self: omni.physx.bindings._physx.PhysX,
- solverSetting: int,
Override PhysX solver settings.
- Parameters:
solverSetting – Integer defining the behavior: -1 - use setting from schema, 0 - force PGS, 1 - force TGS
- reconnect_pvd(self: omni.physx.bindings._physx.PhysX) None #
Reconnect to PVD (PhysX Visual Debugger)
- release_physics_objects( ) None #
Forces release of all physics objects from PhysX.
- reset_setting(
- self: omni.physx.bindings._physx.PhysX,
- setting: str,
Resets a specific physics setting to its default value.
- Parameters:
setting – The setting to reset to its default value.
- reset_settings(self: omni.physx.bindings._physx.PhysX) None #
Resets all physics settings to their default values.
- reset_settings_in_preferences( ) None #
Resets physics preferences to their default values.
- reset_settings_in_stage( ) None #
Resets physics per-stage settings to their default values.
- reset_simulation(self: omni.physx.bindings._physx.PhysX) None #
Reset physics simulation and set back original transformations stored during start_simulation. This will also remove all data from PhysX.
- save_scene_to_repx(
- self: omni.physx.bindings._physx.PhysX,
- path: str,
Save scene to RepX, if scene is not loaded, load scene, save and release.
- Parameters:
path – Path to save the RepX file.
- set_simulation_layer(
- self: omni.physx.bindings._physx.PhysX,
- layer: str,
Sets simulation layer. This layer is used when simulation output transformations are written to USD.
- Parameters:
layer – The layer that we simulate to.
- set_thread_count(
- self: omni.physx.bindings._physx.PhysX,
- numThreads: int,
Sets number of threads for simulation.
- Parameters:
numThreads – Number of threads that physics should use
- set_vehicle_to_rest_state(
- self: omni.physx.bindings._physx.PhysX,
- path: str,
Set the internal dynamics state of a vehicle back to the rest state.
Note
Should only be called after the simulation has been started.
- Parameters:
path – Vehicle USD path.
- set_voxel_range(
- self: omni.physx.bindings._physx.PhysX,
- stage_id: int,
- path: str,
- sx: int,
- sy: int,
- sz: int,
- ex: int,
- ey: int,
- ez: int,
- type: int,
- subtype: int,
- update: int,
Set Voxelmap Voxels
- Parameters:
stage_id – Stage containing source mesh primitive.
input_path – path to input primitive
sx – voxel range start X
sy – voxel range start Y
sz – voxel range start Z
ex – voxel range end X
ey – voxel range end Y
ez – voxel range end Z
type – voxel type
sub_type – voxel subtype
update – update flag, if zero, writing changes to USD is postponed, if non-zero, all accumulated changes are written to USD
- set_wheel_rotation_angle(
- self: omni.physx.bindings._physx.PhysX,
- path: str,
- rotationAngle: float,
Set the rotation angle about the rolling axis of a wheel.
Note
Should only be called after the simulation has been started.
- Parameters:
path – Wheel attachment USD path.
rotationAngle – Rotation angle of the wheel in radians.
- set_wheel_rotation_speed(
- self: omni.physx.bindings._physx.PhysX,
- path: str,
- rotationSpeed: float,
Set the rotation speed about the rolling axis of a wheel.
Note
Should only be called after the simulation has been started.
- Parameters:
path – Wheel attachment USD path.
rotationSpeed – Rotation speed of the wheel in radians per second.
- start_simulation(self: omni.physx.bindings._physx.PhysX) None #
Start simulation, store initial USD data. Call this before manually stepping simulation.
- subscribe_object_changed_notifications(
- self: omni.physx.bindings._physx.PhysX,
- object_creation_fn: Callable[[int, int, int], None] = None,
- object_destruction_fn: Callable[[int, int, int], None] = None,
- all_objects_destruction_fn: Callable[[], None] = None,
- stop_callback_when_sim_stopped: bool = True,
Subscribes to Object Changed Notifications
- Parameters:
object_creation_fn – function(path, object_id, physx_type) Notification when a physics object gets created during simulation.
object_destruction_fn – function(path, object_id, physx_type) Notification when a physics object gets destroyed during simulation.
all_objects_destruction_fn – function Notification when all physics objects get destroyed during simulation.
stopCallbackWhenSimStopped – bool Whether these callbacks should not be sent when the simulation stops
- Returns:
The subscription holder (SubscriptionId) to use with unsubscribe_object_change_notifications
- subscribe_physics_on_step_events(
- self: omni.physx.bindings._physx.PhysX,
- fn: Callable[[float], None],
- pre_step: bool,
- order: int,
Subscribes to physics pre-step or post-step events.
Subscription cannot be changed in the onUpdate callback
- Parameters:
fn – The callback to be called right before or after every physics step.
pre_step – Whether fn has to be called right before the physics step. If this is false, it will be called right after the physics step.
order – An integer value used to order the callbacks: 0 means “highest priority”, 1 is “less priority” and so on.
- Returns:
The subscription holder.
- subscribe_physics_step_events(
- self: omni.physx.bindings._physx.PhysX,
- fn: Callable[[float], None],
Subscribes to physics step events.
Subscription cannot be changed in the onUpdate callback
- Parameters:
fn – The callback to be called on every physics step.
- Returns:
The subscription holder.
- unsubscribe_object_change_notifications(
- self: omni.physx.bindings._physx.PhysX,
- subscription_id: int,
Unsubscribes object change notifications with the subscriptionID as returned by subscribe_object_changed_notifications
- update_interaction(
- self: omni.physx.bindings._physx.PhysX,
- origin: carb._carb.Float3,
- direction: carb._carb.Float3,
- event: omni.physx.bindings._physx.PhysicsInteractionEvent,
Updates actor interaction based on user input and raycast origin and direction
Note
Only provides interaction during simulation
- Parameters:
origin – carb.Float3: World-space origin of interaction
direction – carb.Float3: Unit-length direction vector of interaction
event – PhysicsInteractionEvent triggered.
- update_simulation(
- self: omni.physx.bindings._physx.PhysX,
- elapsedStep: float,
- currentTime: float,
Update physics simulation by one step.
- Parameters:
elapsedStep – Simulation step time (seconds), time elapsed between last step and this step.
currentTime – Current time (seconds), might be used for time sampled transformations to apply.
- update_simulation_scene(
- self: omni.physx.bindings._physx.PhysX,
- scene_path: int,
- elapsed_step: float,
- current_time: float,
Update and step a specific scene in the physics simulation. The specific scene specified in scenePath is updated and stepped even if marked as ‘Disabled’. If scenePath is empty, it behaves like IPhysx::updateSimulation
- Parameters:
scenePath – uint64_t Scene USD path use PhysicsSchemaTools::sdfPathToInt
elapsedStep – float Simulation time (seconds).
currentTime – float Current time (seconds), might be used for time sampled transformations to apply.
- update_transformations(
- self: omni.physx.bindings._physx.PhysX,
- updateToFastCache: bool,
- updateToUsd: bool,
- updateVelocitiesToUsd: bool = False,
- outputVelocitiesLocalSpace: bool = False,
Update transformations after simulation is done.
- Parameters:
updateToFastCache – Update transformation in fast cache.
updateToUsd – Update transformations in USD.
updateVelocitiesToUsd – Update velocities in USD.
- update_transformations_scene(
- self: omni.physx.bindings._physx.PhysX,
- scene_path: int,
- update_to_usd: bool,
- update_velocities_to_usd: bool,
Update the transformations for a specific scene in the physics simulation. The specific scene specified in scenePath has its transformations updated even if it is marked as ‘Disabled’. If scenePath is empty, it behaves like IPhysx::updateTransformations
scenePath uint64_t Scene USD path use PhysicsSchemaTools::sdfPathToInt updateToUsd bool Update transforms to USD. updateVelocitiesToUsd bool Update velocities to USD.
- class omni.physx.bindings._physx.PhysXCooking#
This interface is the access point to the omni.physx extension cooking API.
- cancel_collision_representation_task(
- self: omni.physx.bindings._physx.PhysXCooking,
- task: omni.physx.bindings._physx.PhysxCollisionRepresentationTask,
- invoke_callback: bool = True,
Cancels an async physics collision representation task made with request_convex_collision_representation
- Parameters:
task – PhysxCollisionRepresentationTask The task returned by request_convex_collision_representation to cancel
invoke_callback – bool If the on_result callback should be invoked anyway
- compute_conforming_tetrahedral_mesh(
- self: omni.physx.bindings._physx.PhysXCooking,
- src_tri_points: List[carb._carb.Float3],
- src_tri_indices: List[int],
Create a conforming tetrahedral mesh from a closed source triangle mesh.
- Parameters:
mesh (src_tri_points Vertices of the source triangle)
triangles (src_tri_indices Vertex indices of the source)
- Returns:
Dict mapping ‘points’ and ‘indices’ to the resulting tetrahedral mesh points and indices
The conforming tetrahedral mesh is defined as a tetrahedral mesh whose surface triangles align with the closed source triangle mesh and whose internal vertices lie on the inside of the closed source triangle mesh.
- compute_voxel_tetrahedral_mesh(
- self: omni.physx.bindings._physx.PhysXCooking,
- src_tet_points: List[carb._carb.Float3],
- src_tet_indices: List[int],
- src_scale: carb._carb.Float3,
- voxel_resolution: int,
Create a voxel tetrahedral mesh from a source tetrahedral mesh.
- Parameters:
src_tet_points – Vertices of teh source tetrahedral mesh
src_tet_indices – Vertex indices of the source tetrahedral mesh
src_scale – Scale of source mesh used to determine resolution of the resulting voxel mesh
voxel_resolution – Number of voxels along longest dimension of axis aligned bounding box of source mesh
- Returns:
Dict mapping ‘points’ and ‘indices’ to the resulting tetrahedral mesh points and indices
The voxel tetrahedral mesh is made by voxelizing the source tetrahedra on a regular grid. The resulting voxel tetrahedral mesh embeds all tetrahedra of the source mesh. The provided voxel resolution may be lowered automatically in order to match a lower resolution detected in the source mesh. This may help to avoid softbody convergence issues with high-resolution tetrahedra embedding low resolution collision meshes.
- cook_auto_deformable_body(
- self: omni.physx.bindings._physx.PhysXCooking,
- deformable_body_path: str,
Cooks deformable body mesh
- Parameters:
stage_id – Stage containing source mesh primitive.
deformable_body_path – path to prim with UsdPhysicsDeformableBodyAPI
- cook_deformable_body_mesh(
- self: omni.physx.bindings._physx.PhysXCooking,
- deformable_body_path: str,
Cooks deformable body mesh
- Parameters:
stage_id – Stage containing source mesh primitive.
deformable_body_path – path to UsdGeomMesh with PhysxSchemaPhysxDeformableBodyAPI
- release_local_mesh_cache( ) None #
Release Local Mesh Cache.
- request_convex_collision_representation(self: omni.physx.bindings._physx.PhysXCooking, stage_id: int, collision_prim_id: int, run_asynchronously: bool = True, on_result: Callable[[omni.physx.bindings._physx.PhysxCollisionRepresentationResult, List[omni.physx.bindings._physx.PhysxConvexMeshData]], None]) omni.physx.bindings._physx.PhysxCollisionRepresentationTask #
Request physics collision representation of an USD mesh
- Parameters:
stage_id – uint64_t Stage where prim exists
collision_prim_id – uint64_t Prim Id of the prim with CollisionAPI
run_asynchronously – bool If the request should be run asynchronously
on_result – Callable[PhysxCollisionRepresentationResult, list[PhysxConvexMeshData]) The callback with the wanted collision representation. result: Value of type PhysxCollisionRepresentationResult convexes: list of PhysxConvexMeshData
- Returns: A PhysxCollisionRepresentationTask that can be cancelled with cancel_collision_representation_task
(if async request has been made)
- class omni.physx.bindings._physx.PhysXSceneQuery#
This interface is the access point to the omni.physx extension scene query API.
- overlap_box(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- halfExtent: carb._carb.Float3,
- pos: carb._carb.Float3,
- rot: carb._carb.Float4,
- reportFn: Callable[[omni.physx.bindings._physx.OverlapHit], bool],
- anyHit: bool = False,
Overlap test of a box against objects in the physics scene.
- Parameters:
halfExtent – Box half extent.
pos – Origin of the box overlap (barycenter of the box).
rot – Rotation of the box overlap (quat x, y, z, w)
reportFn – Report function where SceneQueryHits will be reported, return True to continue traversal, False to stop traversal
anyHit – Boolean defining whether overlap should report only bool hit (0 no hit, 1 hit found).
- Returns:
Return number of hits founds
- overlap_box_any(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- halfExtent: carb._carb.Float3,
- pos: carb._carb.Float3,
- rot: carb._carb.Float4,
Overlap test of a box against objects in the physics scene, reports only boolean
- Parameters:
extent – Box extent.
pos – Origin of the box overlap.
rot – Rotation of the box overlap (quat x, y, z, w)
- Returns:
Returns True if overlap found
- overlap_mesh(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- meshPath0: int,
- meshPath1: int,
- reportFn: Callable[[omni.physx.bindings._physx.OverlapHit], bool],
- anyHit: bool = False,
Overlap test of a UsdGeom.Mesh against objects in the physics scene. Overlap test will use convex mesh approximation of the input mesh. The first query will need to cook this approximation so if the results are not stored in a local cache, this query might be slow.
- Parameters:
mesh – UsdGeom.Mesh path encoded into two integers. Use PhysicsSchemaTools.encodeSdfPath to get those.
reportFn – Report function where SceneQueryHits will be reported, return True to continue traversal, False to stop traversal
anyHit – Boolean defining whether overlap should report only bool hit (0 no hit, 1 hit found).
- Returns:
Return number of hits founds
- overlap_mesh_any(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- meshPath0: int,
- meshPath1: int,
Overlap test of a UsdGeom.Mesh against objects in the physics scene. Overlap test will use convex mesh approximation of the input mesh. The first query will need to cook this approximation so if the results are not stored in a local cache, this query might be slow. Reports only boolean.
- Parameters:
mesh – UsdGeom.Mesh path encoded into two integers. Use PhysicsSchemaTools.encodeSdfPath to get those.
- Returns:
Returns True if overlap was found.
- overlap_shape(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- meshPath0: int,
- meshPath1: int,
- reportFn: Callable[[omni.physx.bindings._physx.OverlapHit], bool],
- anyHit: bool = False,
Overlap test of a UsdGeom.GPrim against objects in the physics scene. Overlap test will use convex mesh approximation if the input is a mesh. The first query will need to cook this approximation so if the results are not stored in a local cache, this query might be slow.
- Parameters:
gprim – UsdGeom.GPrim path encoded into two integers. Use PhysicsSchemaTools.encodeSdfPath to get those.
reportFn – Report function where SceneQueryHits will be reported, return True to continue traversal, False to stop traversal
anyHit – Boolean defining whether overlap should report only bool hit (0 no hit, 1 hit found).
- Returns:
Return number of hits founds
- overlap_shape_any(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- meshPath0: int,
- meshPath1: int,
Overlap test of a UsdGeom.GPrim against objects in the physics scene. Overlap test will use convex mesh approximation if the input is a mesh. The first query will need to cook this approximation so if the results are not stored in a local cache, this query might be slow. Reports only boolean.
- Parameters:
gprim – UsdGeom.GPrim path encoded into two integers. Use PhysicsSchemaTools.encodeSdfPath to get those.
- Returns:
Returns True if overlap was found.
- overlap_sphere(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- radius: float,
- pos: carb._carb.Float3,
- reportFn: Callable[[omni.physx.bindings._physx.OverlapHit], bool],
- anyHit: bool = False,
Overlap test of a sphere against objects in the physics scene.
- Parameters:
radius – Sphere radius.
pos – Origin of the sphere overlap.
reportFn – Report function where SceneQueryHits will be reported, return True to continue traversal, False to stop traversal
anyHit – Boolean defining whether overlap should report only bool hit (0 no hit, 1 hit found).
- Returns:
Return number of hits founds
- overlap_sphere_any(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- radius: float,
- pos: carb._carb.Float3,
Overlap test of a sphere against objects in the physics scene, reports only boolean.
- Parameters:
radius – Sphere radius.
pos – Origin of the sphere overlap.
- Returns:
Returns True if overlap found.
- raycast_all(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- origin: carb._carb.Float3,
- dir: carb._carb.Float3,
- distance: float,
- reportFn: Callable[[omni.physx.bindings._physx.RaycastHit], bool],
- bothSides: bool = False,
Raycast physics scene for all collisions.
- Parameters:
origin – Origin of the raycast.
dir – Unit direction of the raycast.
distance – Raycast distance.
reportFn – Report function where RaycastHits will be reported, return True to continue traversal, False to stop traversal
bothSides – Boolean defining whether front and back side of a mesh triangle should be considered for hits.
- Returns:
Returns true if hit
- raycast_any(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- origin: carb._carb.Float3,
- dir: carb._carb.Float3,
- distance: float,
- bothSides: bool = False,
Raycast physics scene for any collision, reporting only boolean.
- Parameters:
origin – Origin of the raycast.
dir – Unit direction of the raycast.
distance – Raycast distance.
bothSides – Boolean defining whether front and back side of a mesh triangle should be considered for hits.
- Returns:
Return a boolean whether raycast hit.
- raycast_closest(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- origin: carb._carb.Float3,
- dir: carb._carb.Float3,
- distance: float,
- bothSides: bool = False,
Raycast physics scene for the closest collision.
- Parameters:
origin – Origin of the raycast.
dir – Unit direction of the raycast.
distance – Raycast distance.
bothSides – Boolean defining whether front and back side of a mesh triangle should be considered for hits.
- Returns:
Return a dictionary with raycast hit:
'position': float3 -- Hit position. 'normal': float3 -- Hit normal. 'distance': float -- Hit distance. 'faceIndex': int -- Hit mesh face index. 'collision': string -- Hit collision USD path. 'rigidBody': string -- Hit rigid body USD path. 'protoIndex': int -- Rigid body protoIndex - if not point instancer 0xFFFFFFFF 'material': string -- Hit collider material USD path.
- sweep_box_all(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- halfExtent: carb._carb.Float3,
- pos: carb._carb.Float3,
- rot: carb._carb.Float4,
- dir: carb._carb.Float3,
- distance: float,
- reportFn: Callable[[omni.physx.bindings._physx.SweepHit], bool],
- bothSides: bool = False,
Box sweep physics scene for all collisions.
- Parameters:
halfExtent – Box half extent.
pos – Origin of the sweep (barycenter of the box).
rot – Rotation of the box (quat x, y, z, w)
dir – Unit direction of the sweep.
distance – sweep distance.
reportFn – Report function where SweepHits will be reported, return True to continue traversal, False to stop traversal
bothSides – Boolean defining whether front and back side of a mesh triangle should be considered for hits.
- Returns:
Returns true if hit
- sweep_box_any(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- halfExtent: carb._carb.Float3,
- pos: carb._carb.Float3,
- rot: carb._carb.Float4,
- dir: carb._carb.Float3,
- distance: float,
- bothSides: bool = False,
Box sweep physics scene for any collision, reporting only boolean.
- Parameters:
halfExtent – Box half extent.
pos – Origin of the sweep (barycenter of the box).
rot – Rotation of the sweep box (quat x, y, z, w)
dir – Unit direction of the sweep.
distance – sweep distance.
bothSides – Boolean defining whether front and back side of a mesh triangle should be considered for hits.
- Returns:
Return a boolean if sweep hit.
- sweep_box_closest(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- halfExtent: carb._carb.Float3,
- pos: carb._carb.Float3,
- rot: carb._carb.Float4,
- dir: carb._carb.Float3,
- distance: float,
- bothSides: bool = False,
Box sweep physics scene for the closest collision.
- Parameters:
halfExtent – Box half extent.
pos – Origin of the sweep (barycenter of the box).
rot – Rotation of the sweep box (quat x, y, z, w)
dir – Unit direction of the sweep.
distance – sweep distance.
bothSides – Boolean defining whether front and back side of a mesh triangle should be considered for hits.
- Returns:
Return a dictionary with raycast hit:
'position': float3 - hit position 'normal': float3 - hit normal 'distance': float - hit distance 'faceIndex': int - hit mesh face index 'collision': string - hit collision USD path 'rigidBody': string - hit rigid body USD path 'protoIndex': int -- Rigid body protoIndex - if not point instancer 0xFFFFFFFF 'material': string -- Hit collider material USD path.
- sweep_mesh_all(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- meshPath0: int,
- meshPath1: int,
- dir: carb._carb.Float3,
- distance: float,
- reportFn: Callable[[omni.physx.bindings._physx.SweepHit], bool],
- bothSides: bool = False,
Sweep test of a UsdGeom.Mesh against objects in the physics scene. Sweep test will use convex mesh approximation of the input mesh. The first query will need to cook this approximation so if the results are not stored in a local cache, this query might be slow.
- Parameters:
mesh – UsdGeom.Mesh path encoded into two integers. Use PhysicsSchemaTools.encodeSdfPath to get those.
dir – Unit direction of the sweep.
distance – sweep distance.
reportFn – Report function where SweepHits will be reported, return True to continue traversal, False to stop traversal
bothSides – Boolean defining whether front and back side of a mesh triangle should be considered for hits.
- Returns:
Returns true if hit
- sweep_mesh_any(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- meshPath0: int,
- meshPath1: int,
- dir: carb._carb.Float3,
- distance: float,
- bothSides: bool = False,
Sweep test of a UsdGeom.Mesh against objects in the physics scene for any collision, reporting only boolean. Sweep test will use convex mesh approximation of the input mesh. The first query will need to cook this approximation so if the results are not stored in a local cache, this query might be slow.
- Parameters:
mesh – UsdGeom.Mesh path encoded into two integers. Use PhysicsSchemaTools.encodeSdfPath to get those.
dir – Unit direction of the sweep.
distance – sweep distance.
bothSides – Boolean defining whether front and back side of a mesh triangle should be considered for hits.
- Returns:
Return a boolean if sweep hit.
- sweep_mesh_closest(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- meshPath0: int,
- meshPath1: int,
- dir: carb._carb.Float3,
- distance: float,
- bothSides: bool = False,
Sweep test of a UsdGeom.Mesh against objects in the physics scene for the closest collision. Sweep test will use convex mesh approximation of the input mesh. The first query will need to cook this approximation so if the results are not stored in a local cache, this query might be slow.
- Parameters:
mesh – UsdGeom.Mesh path encoded into two integers. Use PhysicsSchemaTools.encodeSdfPath to get those.
dir – Unit direction of the sweep.
distance – sweep distance.
bothSides – Boolean defining whether front and back side of a mesh triangle should be considered for hits.
- Returns:
‘position’: float3 - hit position ‘normal’: float3 - hit normal ‘distance’: float - hit distance ‘faceIndex’: int - hit mesh face index ‘collision’: string - hit collision USD path ‘rigidBody’: string - hit rigid body USD path ‘protoIndex’: int – Rigid body protoIndex - if not point instancer 0xFFFFFFFF ‘material’: string – Hit collider material USD path.
- Return type:
Return a dictionary with sweep hit
- sweep_shape_all(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- meshPath0: int,
- meshPath1: int,
- dir: carb._carb.Float3,
- distance: float,
- reportFn: Callable[[omni.physx.bindings._physx.SweepHit], bool],
- bothSides: bool = False,
Sweep test of a UsdGeom.GPrim against objects in the physics scene. Sweep test will use convex mesh approximation if the input is a mesh. The first query will need to cook this approximation so if the results are not stored in a local cache, this query might be slow.
- Parameters:
gprim – UsdGeom.GPrim path encoded into two integers. Use PhysicsSchemaTools.encodeSdfPath to get those.
dir – Unit direction of the sweep.
distance – sweep distance.
reportFn – Report function where SweepHits will be reported, return True to continue traversal, False to stop traversal
bothSides – Boolean defining whether front and back side of a mesh triangle should be considered for hits.
- Returns:
Returns true if hit
- sweep_shape_any(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- meshPath0: int,
- meshPath1: int,
- dir: carb._carb.Float3,
- distance: float,
- bothSides: bool = False,
Sweep test of a UsdGeom.GPrim against objects in the physics scene for any collision, reporting only boolean. Sweep test will use convex mesh approximation if the input is a mesh. The first query will need to cook this approximation so if the results are not stored in a local cache, this query might be slow.
- Parameters:
gprim – UsdGeom.GPrim path encoded into two integers. Use PhysicsSchemaTools.encodeSdfPath to get those.
dir – Unit direction of the sweep.
distance – sweep distance.
bothSides – Boolean defining whether front and back side of a mesh triangle should be considered for hits.
- Returns:
Return a boolean if sweep hit.
- sweep_shape_closest(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- meshPath0: int,
- meshPath1: int,
- dir: carb._carb.Float3,
- distance: float,
- bothSides: bool = False,
Sweep test of a UsdGeom.GPrim against objects in the physics scene. Sweep test will use convex mesh approximation if the input is a mesh. The first query will need to cook this approximation so if the results are not stored in a local cache, this query might be slow.
- Parameters:
gprim – UsdGeom.GPrim path encoded into two integers. Use PhysicsSchemaTools.encodeSdfPath to get those.
dir – Unit direction of the sweep.
distance – sweep distance.
bothSides – Boolean defining whether front and back side of a mesh triangle should be considered for hits.
- Returns:
‘position’: float3 - hit position ‘normal’: float3 - hit normal ‘distance’: float - hit distance ‘faceIndex’: int - hit mesh face index ‘collision’: string - hit collision USD path ‘rigidBody’: string - hit rigid body USD path ‘protoIndex’: int – Rigid body protoIndex - if not point instancer 0xFFFFFFFF ‘material’: string – Hit collider material USD path.
- Return type:
Return a dictionary with sweep hit
- sweep_sphere_all(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- radius: float,
- origin: carb._carb.Float3,
- dir: carb._carb.Float3,
- distance: float,
- reportFn: Callable[[omni.physx.bindings._physx.SweepHit], bool],
- bothSides: bool = False,
Sphere sweep physics scene for all collisions.
- Parameters:
radius – Sphere radius
origin – Origin of the sweep.
dir – Unit direction of the sweep.
distance – sweep distance.
reportFn – Report function where SweepHits will be reported, return True to continue traversal, False to stop traversal
bothSides – Boolean defining whether front and back side of a mesh triangle should be considered for hits.
- Returns:
Returns true if hit
- sweep_sphere_any(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- radius: float,
- origin: carb._carb.Float3,
- dir: carb._carb.Float3,
- distance: float,
- bothSides: bool = False,
Sphere sweep physics scene for any collision, reporting only boolean.
- Parameters:
radius – Sphere radius.
origin – Origin of the sphere sweep.
dir – Unit direction of the sphere sweep.
distance – Sphere sweep distance.
bothSides – Boolean defining whether front and back side of a mesh triangle should be considered for hits.
- Returns:
Return a boolean if sphere sweep hit.
- sweep_sphere_closest(
- self: omni.physx.bindings._physx.PhysXSceneQuery,
- radius: float,
- origin: carb._carb.Float3,
- dir: carb._carb.Float3,
- distance: float,
- bothSides: bool = False,
Sphere sweep physics scene for the closest collision.
- Parameters:
radius – Sphere radius.
origin – Origin of the sphere cast.
dir – Unit direction of the sphere cast.
distance – Sphere cast distance.
bothSides – Boolean defining whether front and back side of a mesh triangle should be considered for hits.
- Returns:
‘position’: float3 - hit position ‘normal’: float3 - hit normal ‘distance’: float - hit distance ‘faceIndex’: int - hit mesh face index ‘collision’: string - hit collision USD path ‘rigidBody’: string - hit rigid body USD path ‘protoIndex’: int – Rigid body protoIndex - if not point instancer 0xFFFFFFFF ‘material’: string – Hit collider material USD path.
- Return type:
Return a dictionary with sweep hit
- class omni.physx.bindings._physx.PhysXVisualization#
This interface is the access point to PhysX SDK debug visualization.
- enable_visualization(
- self: omni.physx.bindings._physx.PhysXVisualization,
- enable: bool,
Enable/disable PhysX debug visualization.
- Parameters:
disable. (enable - Bool if enable or)
- get_nb_lines( ) int #
Get number of PhysX debug visualization lines. This serves mostly as a test function.
- set_visualization_parameter(
- self: omni.physx.bindings._physx.PhysXVisualization,
- debug_vis: str,
- enable: bool,
Toggle individual debug visualization features.
- Parameters:
identifier (debug_vis - Debug visualization feature string) – {‘WorldAxes’, ‘BodyAxes’, ‘BodyMassAxes’, ‘BodyLinearVel’, ‘BodyAngularVel’, ‘ContactPoint’, ‘ContactNormal’, ‘ContactError’, ‘ContactImpulse’, ‘FrictionPoint’, ‘FrictionNormal’, ‘FrictionImpulse’, ‘ActorAxes’, ‘CollisionAABBs’, ‘CollisionShapes’, ‘CollisionAxes’, ‘CollisionCompounds’, ‘CollisionEdges’, ‘CollisionStaticPruner’, ‘CollisionDynamicPruner’, ‘JointLocalFrames’, ‘JointLimits’, ‘CullBox’, ‘MBPRegions’}
following (can be one of the) – {‘WorldAxes’, ‘BodyAxes’, ‘BodyMassAxes’, ‘BodyLinearVel’, ‘BodyAngularVel’, ‘ContactPoint’, ‘ContactNormal’, ‘ContactError’, ‘ContactImpulse’, ‘FrictionPoint’, ‘FrictionNormal’, ‘FrictionImpulse’, ‘ActorAxes’, ‘CollisionAABBs’, ‘CollisionShapes’, ‘CollisionAxes’, ‘CollisionCompounds’, ‘CollisionEdges’, ‘CollisionStaticPruner’, ‘CollisionDynamicPruner’, ‘JointLocalFrames’, ‘JointLimits’, ‘CullBox’, ‘MBPRegions’}
feature. (enable - Bool to enable/disable the)
- set_visualization_scale(
- self: omni.physx.bindings._physx.PhysXVisualization,
- scale: float,
Set PhysX debug visualization scale.
- Parameters:
visualization. (scale - Float value for scaling debug)
- class omni.physx.bindings._physx.PhysicsInteractionEvent#
Physics interaction event
Members:
MOUSE_DRAG_BEGAN : Signals that a mouse drag has begun.
MOUSE_DRAG_CHANGED : Signals that the mouse is being dragged.
MOUSE_DRAG_ENDED : Signals that the mouse drag is being released.
MOUSE_LEFT_CLICK : Signals that the mouse left button is clicked.
MOUSE_LEFT_DOUBLE_CLICK : Signals that the mouse left button is being double-clicked.
- MOUSE_DRAG_BEGAN = <PhysicsInteractionEvent.MOUSE_DRAG_BEGAN: 0>#
- MOUSE_DRAG_CHANGED = <PhysicsInteractionEvent.MOUSE_DRAG_CHANGED: 1>#
- MOUSE_DRAG_ENDED = <PhysicsInteractionEvent.MOUSE_DRAG_ENDED: 2>#
- MOUSE_LEFT_CLICK = <PhysicsInteractionEvent.MOUSE_LEFT_CLICK: 3>#
- MOUSE_LEFT_DOUBLE_CLICK = <PhysicsInteractionEvent.MOUSE_LEFT_DOUBLE_CLICK: 4>#
- property name#
- property value#
- class omni.physx.bindings._physx.PhysicsProfileStats#
Physics profile data.
- property ms#
Time in miliseconds
- property zone_name#
Profile zone name
- class omni.physx.bindings._physx.PhysicsProfileStatsVector#
- append(
- self: List[omni.physx.bindings._physx.PhysicsProfileStats],
- x: omni.physx.bindings._physx.PhysicsProfileStats,
Add an item to the end of the list
- clear(
- self: List[omni.physx.bindings._physx.PhysicsProfileStats],
Clear the contents
- extend(*args, **kwargs)#
Overloaded function.
extend(self: List[omni.physx.bindings._physx.PhysicsProfileStats], L: List[omni.physx.bindings._physx.PhysicsProfileStats]) -> None
Extend the list by appending all the items in the given list
extend(self: List[omni.physx.bindings._physx.PhysicsProfileStats], L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(
- self: List[omni.physx.bindings._physx.PhysicsProfileStats],
- i: int,
- x: omni.physx.bindings._physx.PhysicsProfileStats,
Insert an item at a given position.
- pop(*args, **kwargs)#
Overloaded function.
pop(self: List[omni.physx.bindings._physx.PhysicsProfileStats]) -> omni.physx.bindings._physx.PhysicsProfileStats
Remove and return the last item
pop(self: List[omni.physx.bindings._physx.PhysicsProfileStats], i: int) -> omni.physx.bindings._physx.PhysicsProfileStats
Remove and return the item at index
i
- class omni.physx.bindings._physx.PhysicsSceneStats#
Physics scene statistics.
- property compressed_contact_size#
The size (in bytes) of the compressed contact stream in the current simulation step.
- property gpu_mem_collision_stack_size#
gpuCollisionStackSize
- Type:
Actual GPU device memory (bytes) needed for the collision stack of Gpu Collision Stack Size set with physxScene
- property gpu_mem_deformable_surface_contacts#
gpuMaxDeformableSurfaceContacts
- Type:
Actual number of deformable surface contacts needed of Gpu Max Deformable Surface Contacts set with physxScene
- property gpu_mem_deformable_surfaces#
GPU device memory in bytes allocated for deformable surface state accessible through API.
- property gpu_mem_deformable_volume_contacts#
gpuMaxSoftBodyContacts
- Type:
Actual number of deformable volume contacts needed of Gpu Max Softbody Contacts set with physxScene
- property gpu_mem_deformable_volumes#
GPU device memory in bytes allocated for deformable volume state accessible through API.
- property gpu_mem_found_lost_aggregate_pairs#
gpuFoundLostAggregatePairsCapacity
- Type:
Actual number of found/lost aggregate pairs needed of Gpu Found Lost Aggregate Pairs Capacity set with physxScene
- property gpu_mem_found_lost_pairs#
gpuFoundLostPairsCapacity
- Type:
Actual number of found/lost pairs needed of Gpu Found Lost Pairs Capacity set with physxScene
- property gpu_mem_heap#
gpuHeapCapacity.
- Type:
GPU device memory in bytes allocated for internal heap allocation based on initial Gpu Heap Capacity set with physxScene
- property gpu_mem_heap_articulation#
GPU device heap memory used for articulations in bytes.
- property gpu_mem_heap_broadphase#
GPU device heap memory used for broad phase in bytes.
- property gpu_mem_heap_deformable_surfaces#
GPU device heap memory used for shared buffers in the deformable surface pipeline in bytes.
- property gpu_mem_heap_deformable_volumes#
GPU device heap memory used for shared buffers in the deformable volume pipeline in bytes.
- property gpu_mem_heap_narrowphase#
GPU device heap memory used for narrow phase in bytes.
- property gpu_mem_heap_other#
GPU device heap memory not covered by other stats in bytes.
- property gpu_mem_heap_particles#
GPU device heap memory used for shared buffers in the particles pipeline in bytes.
- property gpu_mem_heap_simulation#
GPU device heap memory used for simulation pipeline in bytes.
- property gpu_mem_heap_simulation_articulation#
GPU device heap memory used for articulations in the simulation pipeline in bytes.
- property gpu_mem_heap_simulation_deformable_surface#
GPU device heap memory used for deformable surfaces in the simulation pipeline in bytes.
- property gpu_mem_heap_simulation_deformable_volume#
GPU device heap memory used for deformable volumes in the simulation pipeline in bytes.
- property gpu_mem_heap_simulation_particles#
GPU device heap memory used for particles in the simulation pipeline in bytes.
- property gpu_mem_heap_solver#
GPU device heap memory used for solver in bytes.
- property gpu_mem_particle_contacts#
gpuMaxParticleContacts
- Type:
Actual number of particle contacts needed of Gpu Max Particle Contact Count set with physxScene
- property gpu_mem_particles#
GPU device memory in bytes allocated for particle state accessible through API.
- property gpu_mem_rigid_contact_count#
gpuMaxRigidContactCount
- Type:
Actual number of rigid contacts needed of Gpu Max Rigid Contact Count set with physxScene
- property gpu_mem_rigid_patch_count#
gpuMaxRigidPatchCount
- Type:
Actual number of rigid contact patches needed of Gpu Max Rigid Patch Count set with physxScene
- property gpu_mem_temp_buffer_capacity#
gpuTempBufferCapacity
- Type:
Actual GPU device memory (bytes) used for Temp Buffer based on initial Gpu Temp Buffer Capacity set with physxScene
- property gpu_mem_total_aggregate_pairs#
gpuTotalAggregatePairsCapacity
- Type:
Actual number of aggregate pairs needed of Gpu Total Aggregate Pairs Capacity set with physxScene
- property nb_active_constraints#
The number of active constraints.
- property nb_active_dynamic_rigids#
The number of active dynamic rigid bodies.
- property nb_active_kinematic_rigids#
The number of active kinematic rigid bodies.
- property nb_aggregates#
The number of aggregates.
- property nb_articulations#
The number of articulations.
- property nb_axis_solver_constaints#
The number of 1D axis constraints(joints+contact) present in the current simulation step.
- property nb_box_shapes#
The number of box shapes.
- property nb_capsule_shapes#
The number of capsule shapes.
- property nb_cone_shapes#
The number of cone shapes.
- property nb_convex_shapes#
The number of convex shapes.
- property nb_cylinder_shapes#
The number of cylinder shapes.
- property nb_discrete_contact_pairs_total#
Total number of (non CCD) pairs reaching narrow phase.
- property nb_discrete_contact_pairs_with_cache_hits#
Total number of (non CCD) pairs for which contacts are successfully cached (<=nbDiscreteContactPairsTotal) note This includes pairs for which no contacts are generated, it still counts as a cache hit.
- property nb_discrete_contact_pairs_with_contacts#
Total number of (non CCD) pairs for which at least 1 contact was generated (<=nbDiscreteContactPairsTotal).
- property nb_dynamic_rigids#
The number of dynamic rigid bodies.
- property nb_kinematic_rigids#
The number of kinematic rigid bodies.
- property nb_lost_pairs#
Number of lost pairs from BP this frame.
- property nb_lost_touches#
Number of lost touches from NP this frame.
- property nb_new_pairs#
Number of new pairs found by BP this frame.
- property nb_new_touches#
Number of new touches found by NP this frame.
- property nb_partitions#
Number of partitions used by the solver this frame.
- property nb_plane_shapes#
The number of plane shapes.
- property nb_sphere_shapes#
The number of sphere shapes.
- property nb_static_rigids#
The number of static rigid bodies.
- property nb_trimesh_shapes#
The number of triangle mesh shapes.
- property peak_constraint_memory#
The peak amount of memory (in bytes) that was allocated for constraints (this includes joints) in the current simulation step.
- property required_contact_constraint_memory#
The total required size (in bytes) of the contact constraints in the current simulation step.
- class omni.physx.bindings._physx.PhysxCollisionRepresentationResult#
Collision representation result
Members:
RESULT_VALID
RESULT_ERROR_NOT_READY
RESULT_ERROR_INVALID_PARSING
RESULT_ERROR_COOKING_FAILED
RESULT_ERROR_UNSUPPORTED_APPROXIMATION
RESULT_ERROR_INVALID_RESULT
- RESULT_ERROR_COOKING_FAILED = <PhysxCollisionRepresentationResult.RESULT_ERROR_COOKING_FAILED: 3>#
- RESULT_ERROR_INVALID_PARSING = <PhysxCollisionRepresentationResult.RESULT_ERROR_INVALID_PARSING: 2>#
- RESULT_ERROR_INVALID_RESULT = <PhysxCollisionRepresentationResult.RESULT_ERROR_INVALID_RESULT: 5>#
- RESULT_ERROR_NOT_READY = <PhysxCollisionRepresentationResult.RESULT_ERROR_NOT_READY: 1>#
- RESULT_ERROR_UNSUPPORTED_APPROXIMATION = <PhysxCollisionRepresentationResult.RESULT_ERROR_UNSUPPORTED_APPROXIMATION: 4>#
- RESULT_VALID = <PhysxCollisionRepresentationResult.RESULT_VALID: 0>#
- property name#
- property value#
- class omni.physx.bindings._physx.PhysxCollisionRepresentationTask#
Task returned by request_convex_collision_representation
- property task#
Task handle
- class omni.physx.bindings._physx.PhysxConvexMeshData#
A convex mesh made of vertices, indices and polygons
- property indices#
- property polygons#
- property vertices#
- class omni.physx.bindings._physx.PhysxConvexMeshPolygon#
A polygon of a convex mesh
- property index_base#
- property num_vertices#
- property plane#
- class omni.physx.bindings._physx.PhysxCookingStatistics#
A convex mesh made of vertices, indices and polygons
- property total_finished_cache_hit_tasks#
- property total_finished_cache_miss_tasks#
- property total_finished_tasks#
- property total_scheduled_tasks#
- property total_warnings_convex_polygon_limits_reached#
- property total_warnings_failed_gpu_compatibility#
- class omni.physx.bindings._physx.PhysxPropertyQueryArticulationLink#
Articulation query response.
- property joint#
Joint name as int
- property joint_dof#
Joint DOF
- property joint_name#
Joint name as string.
- property rigid_body#
Rigid body name as int
- property rigid_body_name#
Rigid Body name as string.
- class omni.physx.bindings._physx.PhysxPropertyQueryArticulationLinkVector#
- append(
- self: omni.physx.bindings._physx.PhysxPropertyQueryArticulationLinkVector,
- x: omni.physx.bindings._physx.PhysxPropertyQueryArticulationLink,
Add an item to the end of the list
- clear( ) None #
Clear the contents
- extend(*args, **kwargs)#
Overloaded function.
extend(self: omni.physx.bindings._physx.PhysxPropertyQueryArticulationLinkVector, L: omni.physx.bindings._physx.PhysxPropertyQueryArticulationLinkVector) -> None
Extend the list by appending all the items in the given list
extend(self: omni.physx.bindings._physx.PhysxPropertyQueryArticulationLinkVector, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(
- self: omni.physx.bindings._physx.PhysxPropertyQueryArticulationLinkVector,
- i: int,
- x: omni.physx.bindings._physx.PhysxPropertyQueryArticulationLink,
Insert an item at a given position.
- pop(*args, **kwargs)#
Overloaded function.
pop(self: omni.physx.bindings._physx.PhysxPropertyQueryArticulationLinkVector) -> omni.physx.bindings._physx.PhysxPropertyQueryArticulationLink
Remove and return the last item
pop(self: omni.physx.bindings._physx.PhysxPropertyQueryArticulationLinkVector, i: int) -> omni.physx.bindings._physx.PhysxPropertyQueryArticulationLink
Remove and return the item at index
i
- class omni.physx.bindings._physx.PhysxPropertyQueryArticulationResponse#
Articulation query response.
- property links#
Articulation links that belong to the articulation
- property path_id#
USD Path
- property result#
Result
- property stage_id#
USD Stage
- class omni.physx.bindings._physx.PhysxPropertyQueryColliderResponse#
Collider query response.
- property aabb_local_max#
AABB Max Local Bound
- property aabb_local_min#
AABB Min Local Bound
- property local_pos#
Local position
- property local_rot#
Local rotation
- property path_id#
USD Path
- property result#
Result
- property stage_id#
USD Stage
- property volume#
Volume of the collider
- class omni.physx.bindings._physx.PhysxPropertyQueryMode#
Query mode.
Members:
QUERY_RIGID_BODY_WITH_COLLIDERS : Query rigid body and its colliders
QUERY_ARTICULATION : Query articulation
- QUERY_ARTICULATION = <PhysxPropertyQueryMode.QUERY_ARTICULATION: 1>#
- QUERY_RIGID_BODY_WITH_COLLIDERS = <PhysxPropertyQueryMode.QUERY_RIGID_BODY_WITH_COLLIDERS: 0>#
- property name#
- property value#
- class omni.physx.bindings._physx.PhysxPropertyQueryResult#
Query result enumeration.
Members:
VALID : Result is valid
ERROR_UNKNOWN_QUERY_MODE : The requested query mode is unknown
ERROR_INVALID_USD_PATH : Result invalid because of an invalid USD path
ERROR_INVALID_USD_STAGE : Result invalid because of an invalid or expired USD stage
ERROR_INVALID_USD_PRIM : Result invalid because of an invalid or deleted USD prim
ERROR_PARSING : Result invalid because parsing USD failed
ERROR_TIMEOUT : Result invalid because async operation exceeds timeout
ERROR_RUNTIME : Result invalid because PhysX runtime is in invalid state
- ERROR_INVALID_USD_PATH = <PhysxPropertyQueryResult.ERROR_INVALID_USD_PATH: 2>#
- ERROR_INVALID_USD_PRIM = <PhysxPropertyQueryResult.ERROR_INVALID_USD_PRIM: 4>#
- ERROR_INVALID_USD_STAGE = <PhysxPropertyQueryResult.ERROR_INVALID_USD_STAGE: 3>#
- ERROR_PARSING = <PhysxPropertyQueryResult.ERROR_PARSING: 5>#
- ERROR_RUNTIME = <PhysxPropertyQueryResult.ERROR_RUNTIME: 7>#
- ERROR_TIMEOUT = <PhysxPropertyQueryResult.ERROR_TIMEOUT: 6>#
- ERROR_UNKNOWN_QUERY_MODE = <PhysxPropertyQueryResult.ERROR_UNKNOWN_QUERY_MODE: 1>#
- VALID = <PhysxPropertyQueryResult.VALID: 0>#
- property name#
- property value#
- class omni.physx.bindings._physx.PhysxPropertyQueryRigidBodyResponse#
Rigid body query response.
- property center_of_mass#
Center of Mass
- property inertia#
Inertia
- property mass#
Mass
- property path_id#
USD Path
- property principal_axes#
Principal Axes Quaternion
- property result#
Result
- property stage_id#
USD Stage
- property type#
Type
- class omni.physx.bindings._physx.PhysxPropertyQueryRigidBodyResponseType#
Query result.
Members:
RIGID_DYNAMIC : Body is a rigid dynamic
- RIGID_DYNAMIC = <PhysxPropertyQueryRigidBodyResponseType.RIGID_DYNAMIC: 0>#
- property name#
- property value#
- class omni.physx.bindings._physx.RaycastHit#
Raycast hit results structure.
- property collision#
Path string to the collision that was hit.
- property collision_encoded#
Encoded SdfPath to the collision that was hit. PhysicsSchemaTools.decodeSdfPath will return SdfPath.
- property distance#
Hit location distance.
- property face_index#
Hit location face index.
- property material#
Path string to the collider material that was hit.
- property material_encoded#
Encoded SdfPath to the collider material that was hit. PhysicsSchemaTools.decodeSdfPath will return SdfPath.
- property normal#
Hit location normal.
- property position#
Hit location position.
- property protoIndex#
ProtoIndex, filled for pointInstancers otherwise 0xFFFFFFFF.
- property rigid_body#
Path string to the rigid body that was hit.
- property rigid_body_encoded#
Encoded SdfPath to the rigid body that was hit. PhysicsSchemaTools.decodeSdfPath will return SdfPath.
- class omni.physx.bindings._physx.SceneQueryHitLocation#
Scene query hit location results structure.
- property collision#
Path string to the collision that was hit.
- property collision_encoded#
Encoded SdfPath to the collision that was hit. PhysicsSchemaTools.decodeSdfPath will return SdfPath.
- property distance#
Hit location distance.
- property face_index#
Hit location face index.
- property material#
Path string to the collider material that was hit.
- property material_encoded#
Encoded SdfPath to the collider material that was hit. PhysicsSchemaTools.decodeSdfPath will return SdfPath.
- property normal#
Hit location normal.
- property position#
Hit location position.
- property protoIndex#
ProtoIndex, filled for pointInstancers otherwise 0xFFFFFFFF.
- property rigid_body#
Path string to the rigid body that was hit.
- property rigid_body_encoded#
Encoded SdfPath to the rigid body that was hit. PhysicsSchemaTools.decodeSdfPath will return SdfPath.
- class omni.physx.bindings._physx.SceneQueryHitObject#
Scene query hit results structure.
- property collision#
Path string to the collision that was hit.
- property collision_encoded#
Encoded SdfPath to the collision that was hit. PhysicsSchemaTools.decodeSdfPath will return SdfPath.
- property protoIndex#
ProtoIndex, filled for pointInstancers otherwise 0xFFFFFFFF.
- property rigid_body#
Path string to the rigid body that was hit.
- property rigid_body_encoded#
Encoded SdfPath to the rigid body that was hit. PhysicsSchemaTools.decodeSdfPath will return SdfPath.
- class omni.physx.bindings._physx.SimulationEvent#
Simulation events used by simulation event stream.
Members:
RESUMED : Simulation resumed, no additional data are send in the event
PAUSED : Simulation paused, no additional data are send in the event
STOPPED : Simulation stopped, no additional data are send in the event
CONTACT_FOUND : Contact found event header: sends header information regarding which colliders started to collide; contains the following in a dictionary:
'actor0':int2 - Usd path to rigid body actor 0 decoded into two ints. PhysicsSchemaTools.decodeSdfPath will return SdfPath. 'actor1':int2 - Usd path to rigid body actor 1 decoded into two ints. PhysicsSchemaTools.decodeSdfPath will return SdfPath. 'collider0':int2 - Usd path to collider 0 decoded into two ints. PhysicsSchemaTools.decodeSdfPath will return SdfPath. 'collider1':int2 - Usd path to collider 1 decoded into two ints. PhysicsSchemaTools.decodeSdfPath will return SdfPath. 'numContactData':int - Num contact data sent after the header is sent. 'stageId':long1 - Current USD stage id, long array with one item.
CONTACT_LOST : Contact lost event header: sends header information regarding which colliders lost contact; contains the following in a dictionary:
'actor0':int2 - Usd path to rigid body actor 0 decoded into two ints. PhysicsSchemaTools.decodeSdfPath will return SdfPath. 'actor1':int2 - Usd path to rigid body actor 1 decoded into two ints. PhysicsSchemaTools.decodeSdfPath will return SdfPath. 'collider0':int2 - Usd path to collider 0 decoded into two ints. PhysicsSchemaTools.decodeSdfPath will return SdfPath. 'collider1':int2 - Usd path to collider 1 decoded into two ints. PhysicsSchemaTools.decodeSdfPath will return SdfPath. 'numContactData':int - Num contact data sent after the header is sent. 'stageId':long1 - Current USD stage id, long array with one item.
CONTACT_PERSISTS : Contact persists event header: sends header information regarding which colliders are still in contact; contains the following in a dictionary:
'actor0':int2 - Usd path to rigid body actor 0 decoded into two ints. PhysicsSchemaTools.decodeSdfPath will return SdfPath. 'actor1':int2 - Usd path to rigid body actor 1 decoded into two ints. PhysicsSchemaTools.decodeSdfPath will return SdfPath. 'collider0':int2 - Usd path to collider 0 decoded into two ints. PhysicsSchemaTools.decodeSdfPath will return SdfPath. 'collider1':int2 - Usd path to collider 1 decoded into two ints. PhysicsSchemaTools.decodeSdfPath will return SdfPath. 'numContactData':int - Num contact data sent after the header is sent. 'stageId':long1 - Current USD stage id, long array with one item.
CONTACT_DATA : Contact data sent after each header contact information is sent; contains the following in a dictionary:
'position':float3 - Contact position 'normal':float3 - Contact normal 'impulse':float3 - Contact impulse 'separation':float - Separation value for collisions. 'faceIndex0':int - USD face index 0. 'faceIndex1':int - USD face index 0. 'material0':int2 - Usd path to material 0 decoded into two ints. PhysicsSchemaTools.decodeSdfPath will return SdfPath. 'material1':int2 - Usd path to material 0 decoded into two ints. PhysicsSchemaTools.decodeSdfPath will return SdfPath.
JOINT_BREAK : Joint break event; contains the following in a dictionary:
'jointPath':int2 - Usd path to joint that did break decoded into two ints. PhysicsSchemaTools.decodeSdfPath will return SdfPath.
POINT_GRABBED : Point grabbed; contains the following in a dictionary:
'grabbed_position':float3 - Current world position of grabbed point. 'grab_force_position':float3 - Current world position of the position being grabbed towards.
POINT_RELEASED : Point released.
POINT_PUSHED : Point pushed; contains the following in a dictionary:
'pushed_position':float3 - World position of point pushed.
ATTACHED_TO_STAGE : When physx stage attachment (initialization) finished.
DETACHED_FROM_STAGE : When physx stage detachment (deinitialization) finished.
- ATTACHED_TO_STAGE = <SimulationEvent.ATTACHED_TO_STAGE: 10>#
- CONTACT_DATA = <SimulationEvent.CONTACT_DATA: 6>#
- CONTACT_FOUND = <SimulationEvent.CONTACT_FOUND: 3>#
- CONTACT_LOST = <SimulationEvent.CONTACT_LOST: 4>#
- CONTACT_PERSISTS = <SimulationEvent.CONTACT_PERSISTS: 5>#
- DETACHED_FROM_STAGE = <SimulationEvent.DETACHED_FROM_STAGE: 11>#
- JOINT_BREAK = <SimulationEvent.JOINT_BREAK: 7>#
- PAUSED = <SimulationEvent.PAUSED: 1>#
- POINT_GRABBED = <SimulationEvent.POINT_GRABBED: 8>#
- POINT_PUSHED = <SimulationEvent.POINT_PUSHED: 12>#
- POINT_RELEASED = <SimulationEvent.POINT_RELEASED: 9>#
- RESUMED = <SimulationEvent.RESUMED: 0>#
- STOPPED = <SimulationEvent.STOPPED: 2>#
- property name#
- property value#
- class omni.physx.bindings._physx.SweepHit#
Sweep hit results structure.
- property collision#
Path string to the collision that was hit.
- property collision_encoded#
Encoded SdfPath to the collision that was hit. PhysicsSchemaTools.decodeSdfPath will return SdfPath.
- property distance#
Hit location distance.
- property face_index#
Hit location face index.
- property material#
Path string to the collider material that was hit.
- property material_encoded#
Encoded SdfPath to the collider material that was hit. PhysicsSchemaTools.decodeSdfPath will return SdfPath.
- property normal#
Hit location normal.
- property position#
Hit location position.
- property protoIndex#
ProtoIndex, filled for pointInstancers otherwise 0xFFFFFFFF.
- property rigid_body#
Path string to the rigid body that was hit.
- property rigid_body_encoded#
Encoded SdfPath to the rigid body that was hit. PhysicsSchemaTools.decodeSdfPath will return SdfPath.
- class omni.physx.bindings._physx.TriggerEventData#
Parameters for trigger event callback.
- property event_type#
Event Type (enter or leave)
- property other_body_prim_id#
USD Path of the body containgint the other collider prim entering trigger
- property other_collider_prim_id#
USD Path of other prim entering trigger
- property stage_id#
USD Stage
- property subscription_id#
Id of the subscription returned by subscribe_physics_trigger_report_events
- property trigger_body_prim_id#
USD Path of the body containg the collider prim representing the trigger
- property trigger_collider_prim_id#
USD Path of prim representing the trigger
- class omni.physx.bindings._physx.TriggerEventType#
Trigger Event type.
Members:
TRIGGER_ON_ENTER : The collider has entered trigger volume
TRIGGER_ON_LEAVE : The collider has left trigger volume
- TRIGGER_ON_ENTER = <TriggerEventType.TRIGGER_ON_ENTER: 0>#
- TRIGGER_ON_LEAVE = <TriggerEventType.TRIGGER_ON_LEAVE: 1>#
- property name#
- property value#
- class omni.physx.bindings._physx.VisualizerMode#
Visualization mode for collider, particles, deformables, etc. object types.
- ALL = 2#
- NONE = 0#
- SELECTED = 1#
- omni.physx.bindings._physx.acquire_physx_benchmarks_interface(
- plugin_name: str = None,
- library_path: str = None,
- omni.physx.bindings._physx.acquire_physx_cooking_interface(
- plugin_name: str = None,
- library_path: str = None,
- omni.physx.bindings._physx.acquire_physx_interface(
- plugin_name: str = None,
- library_path: str = None,
- omni.physx.bindings._physx.acquire_physx_property_query_interface(
- plugin_name: str = None,
- library_path: str = None,
- omni.physx.bindings._physx.acquire_physx_replicator_interface(
- plugin_name: str = None,
- library_path: str = None,
- omni.physx.bindings._physx.acquire_physx_scene_query_interface(
- plugin_name: str = None,
- library_path: str = None,
- omni.physx.bindings._physx.acquire_physx_simulation_interface(
- plugin_name: str = None,
- library_path: str = None,
- omni.physx.bindings._physx.acquire_physx_stage_update_interface(
- plugin_name: str = None,
- library_path: str = None,
- omni.physx.bindings._physx.acquire_physx_statistics_interface(
- plugin_name: str = None,
- library_path: str = None,
- omni.physx.bindings._physx.acquire_physx_visualization_interface(
- plugin_name: str = None,
- library_path: str = None,
- omni.physx.bindings._physx.hasconflictingapis_ArticulationRoot_WRet(
- prim: UsdPrim,
- check_itself: bool = False,
- check_prim: bool = True,
- omni.physx.bindings._physx.hasconflictingapis_CollisionAPI_WRet(
- prim: UsdPrim,
- check_itself: bool = False,
- check_prim: bool = True,
- omni.physx.bindings._physx.hasconflictingapis_DeformableBodyAPI(
- arg0: UsdPrim,
- arg1: bool,
- omni.physx.bindings._physx.hasconflictingapis_RigidBodyAPI_WRet(
- prim: UsdPrim,
- check_itself: bool = False,
- check_prim: bool = True,
- omni.physx.bindings._physx.release_physx_benchmarks_interface( ) None #
- omni.physx.bindings._physx.release_physx_cooking_interface( ) None #
- omni.physx.bindings._physx.release_physx_interface( ) None #
- omni.physx.bindings._physx.release_physx_interface_scripting( ) None #
- omni.physx.bindings._physx.release_physx_property_query_interface( ) None #
- omni.physx.bindings._physx.release_physx_replicator_interface( ) None #
- omni.physx.bindings._physx.release_physx_replicator_interface_scripting( ) None #
- omni.physx.bindings._physx.release_physx_scene_query_interface( ) None #
- omni.physx.bindings._physx.release_physx_simulation_interface( ) None #
- omni.physx.bindings._physx.release_physx_stage_update_interface( ) None #
- omni.physx.bindings._physx.release_physx_stage_update_interface_scripting( ) None #
- omni.physx.bindings._physx.release_physx_statistics_interface( ) None #
- omni.physx.bindings._physx.release_physx_statistics_interface_scripting( ) None #
- omni.physx.bindings._physx.release_physx_visualization_interface( ) None #
- omni.physx.scripts.utils.get_spatial_tendon_attachment_candidates(
- prim: Prim,
Returns a list of PhysxTendonAttachment(Root)API instance names on the provided prim that are candidates for creating a parent relationship to. Notably, this list will exclude leaf attachments that are not suitable targets for a parent relationship.
- Parameters:
prim – the Usd.Prim to parse for suitable attachment candidates
- Returns:
A str list of attachment instance names
- omni.physx.scripts.utils.safe_import_tests(source_module_name, submodules_list=None)#
Tries to import tests if the tests ext is present. The tests ext is expected to be loaded as follows:
1) use when the tests need to be visible in the test runner UI and the tests ext needs to be explicitly loaded by another ext or is included in the kit file
[dependencies] “omni.physx.tests” = {optional=true}
2) this will include the dependency only when running tests in the separate kit process, like when run using the generated batch files and the tests would then likely not be visible in the test runner UI
[[test]] dependencies = [“omni.physx.tests”]
- omni.physx.scripts.physicsUtils.add_box(
- stage: Stage,
- path: str | Path,
- size: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Cube to the stage.
- Parameters:
stage – The Usd.Stage to add cube.
path – The desired cube path.
size – The size of the cube.
position – The position where the cube should be placed in stage.
orientation – The cube orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_capsule(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- height: float = 1.0,
- axis: str = 'Y',
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Capsule to the stage.
- Parameters:
stage – The Usd.Stage to add capsule.
path – The desired capsule path.
radius – The radius of the capsule.
height – The height of the capsule.
axis – The axis of the capsule.
position – The position where the capsule should be placed in stage.
orientation – The capsule orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_collider_box(
- stage: Stage,
- path: str | Path,
- size: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Cube to the stage and add physics collider API to it.
- Parameters:
stage – The Usd.Stage to add cube.
path – The desired cube path.
size – The size of the cube.
position – The position where the cube should be placed in stage.
orientation – The cube orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_collider_capsule(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- height: float = 1.0,
- axis: str = 'Y',
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Capsule to the stage and add physics collider API to it.
- Parameters:
stage – The Usd.Stage to add capsule.
path – The desired capsule path.
radius – The radius of the capsule.
height – The height of the capsule.
axis – The axis of the capsule.
position – The position where the capsule should be placed in stage.
orientation – The capsule orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_collider_cone(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- height: float = 1.0,
- axis: str = 'Y',
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Cone to the stage and add physics collider API to it.
- Parameters:
stage – The Usd.Stage to add cone.
path – The desired cone path.
radius – The radius of the cone.
height – The height of the cone.
axis – The axis of the cone.
position – The position where the cone should be placed in stage.
orientation – The cone orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_collider_cube(
- stage: Stage,
- path: str | Path,
- size: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Cube to the stage and add physics collider API to it.
- Parameters:
stage – The Usd.Stage to add cube.
path – The desired cube path.
size – The size of the cube.
position – The position where the cube should be placed in stage.
orientation – The cube orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_collider_cylinder(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- height: float = 1.0,
- axis: str = 'Y',
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Cylinder to the stage and add physics collider API to it.
- Parameters:
stage – The Usd.Stage to add cylinder.
path – The desired cylinder path.
radius – The radius of the cylinder.
height – The height of the cylinder.
axis – The axis of the cylinder.
position – The position where the cylinder should be placed in stage.
orientation – The cylinder orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_collider_sphere(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Sphere to the stage and add physics collider API to it.
- Parameters:
stage – The Usd.Stage to add sphere.
path – The desired sphere path.
radius – The radius of the sphere.
position – The position where the sphere should be placed in stage.
orientation – The sphere orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_collision_to_collision_group(
- stage: Stage,
- collisionPath: str | Path,
- collisionGroupPath: str | Path,
Add collision path to a collision group include rel.
- Parameters:
stage – The Usd.Stage to add path.
collisionPath – Collision path to add.
collisionGroupPath – Collision group prim path.
- omni.physx.scripts.physicsUtils.add_cone(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- height: float = 1.0,
- axis: str = 'Y',
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Cone to the stage.
- Parameters:
stage – The Usd.Stage to add cone.
path – The desired cone path.
radius – The radius of the cone.
height – The height of the cone.
axis – The axis of the cone.
position – The position where the cone should be placed in stage.
orientation – The cone orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_cube(
- stage: Stage,
- path: str | Path,
- size: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Cube to the stage.
- Parameters:
stage – The Usd.Stage to add cube.
path – The desired cube path.
size – The size of the cube.
position – The position where the cube should be placed in stage.
orientation – The cube orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_cube_ground_plane(
- stage: Stage,
- cubePath: str | Path,
- axis: str,
- size: float,
- position: Vec3f | Vec3d,
- color: Vec3f,
Add UsdGeom.Cube to the stage to act as a sized plane with thickness. The cube is scaled by a vector Gf.Vec3f(0.01, 1.0, 1.0) depending on the up Axis
- Parameters:
stage – The Usd.Stage to add path.
cubePath – The desired ground plane path.
axis – The up axis - “Y”, “Z”
size – The half size of the mesh.
position – The position where the mesh should be placed in stage.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_cylinder(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- height: float = 1.0,
- axis: str = 'Y',
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Cylinder to the stage.
- Parameters:
stage – The Usd.Stage to add cylinder.
path – The desired cylinder path.
radius – The radius of the cylinder.
height – The height of the cylinder.
axis – The axis of the cylinder.
position – The position where the cylinder should be placed in stage.
orientation – The cylinder orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_density(
- stage: Stage,
- path: str | Path,
- value: float,
Add density to given prim. Note that his will apply MassAPI on the prim.
- Parameters:
stage – The Usd.Stage to add path.
path – The desired path to create.
value – The desired density.
- omni.physx.scripts.physicsUtils.add_force_torque(
- stage: Stage,
- path: str | Path,
- force: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- torque: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- mode: str = 'acceleration',
- isEnabled: bool = True,
- isWorldSpace: bool = False,
Add force/torque to given prim. Note that his will apply PhysxForceAPI on the prim.
- Parameters:
stage – The Usd.Stage to add path.
path – The desired path to create.
force – The desired force.
torque – The desired torque.
mode – The force/torque mode.
isEnabled – Bool defining whether force is enabled or not.
isWorldSpace – Bool defining whether force is applied in world space or body local space.
- omni.physx.scripts.physicsUtils.add_ground_plane(
- stage: Stage,
- planePath: str | Path,
- axis: str,
- size: float,
- position: Vec3f | Vec3d,
- color: Vec3f,
Add ground plane to the stage. Note that it will add a mesh for rendering purpose and UsdPhysics.Plane for collision purpose.
- Parameters:
stage – The Usd.Stage to add path.
planePath – The desired ground plane path.
axis – The up axis - “Y”, “Z”
size – The half size of the mesh.
position – The position where the mesh should be placed in stage.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_joint_fixed(
- stage: Stage,
- jointPath: str | Path,
- actor0: str | Path,
- actor1: str | Path,
- localPos0: Vec3f,
- localRot0: Quatf,
- localPos1: Vec3f,
- localRot1: Quatf,
- breakForce: float,
- breakTorque: float,
Add fixed joint to the stage.
- Parameters:
stage – The Usd.Stage to add the joint.
jointPath – The desired joint path.
actor0 – The actor0 for the joint.
actor1 – The actor1 for the joint.
localPos0 – The joint local position offset from the actor0
localRot0 – The joint local rotation offset from the actor0
localPos1 – The joint local position offset from the actor1
localRot1 – The joint local rotation offset from the actor1
breakForce – The joint break force.
breakTorque – The joint break torque.
- omni.physx.scripts.physicsUtils.add_mass(
- stage: Stage,
- path: str | Path,
- mass: float = 1.0,
Add mass to given prim. Note that his will apply MassAPI on the prim.
- Parameters:
stage – The Usd.Stage to add path.
path – The desired path to create.
value – The desired mass.
- omni.physx.scripts.physicsUtils.add_physics_material_to_prim(
- stage: Stage,
- prim: Prim,
- materialPath: str | Path,
Bind physics material to a given prim.
- Parameters:
stage – The Usd.Stage to add path.
prim – The Usd.Prim where material should have the binding to.
materialPath – The path of the material.
- omni.physx.scripts.physicsUtils.add_quad_plane(
- stage: Stage,
- quadPath: str | Path,
- axis: str,
- size: float,
- position: Vec3f | Vec3d,
- color: Vec3f,
Add quad mesh to the stage to act as a sized plane.
- Parameters:
stage – The Usd.Stage to add path.
quadPath – The desired ground plane path.
axis – The up axis - “Y”, “Z”
size – The half size of the mesh.
position – The position where the mesh should be placed in stage.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_rigid_box(
- stage: Stage,
- path: str | Path,
- size: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- density: float = 1.0,
- lin_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- ang_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
Add UsdGeom.Cube to the stage and add physics rigid body and collider API to it.
- Parameters:
stage – The Usd.Stage to add cube.
path – The desired cube path.
size – The size of the cube.
position – The position where the cube should be placed in stage.
orientation – The cube orientation.
color – The color of the mesh.
lin_velocity – The initial linear velocity of the rigid body.
ang_velocity – The initial angular velocity of the rigid body.
- omni.physx.scripts.physicsUtils.add_rigid_capsule(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- height: float = 1.0,
- axis: str = 'Y',
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- density: float = 1.0,
- lin_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- ang_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
Add UsdGeom.Capsule to the stage and add physics rigid body and collider API to it.
- Parameters:
stage – The Usd.Stage to add capsule.
path – The desired capsule path.
radius – The radius of the capsule.
height – The height of the capsule.
axis – The axis of the capsule.
position – The position where the capsule should be placed in stage.
orientation – The capsule orientation.
color – The color of the mesh.
lin_velocity – The initial linear velocity of the rigid body.
ang_velocity – The initial angular velocity of the rigid body.
- omni.physx.scripts.physicsUtils.add_rigid_cone(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- height: float = 1.0,
- axis: str = 'Y',
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- density: float = 1.0,
- lin_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- ang_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
Add UsdGeom.Cone to the stage and add physics rigid body and collider API to it.
- Parameters:
stage – The Usd.Stage to add cone.
path – The desired cone path.
radius – The radius of the cone.
height – The height of the cone.
axis – The axis of the cone.
position – The position where the cone should be placed in stage.
orientation – The cone orientation.
color – The color of the mesh.
lin_velocity – The initial linear velocity of the rigid body.
ang_velocity – The initial angular velocity of the rigid body.
- omni.physx.scripts.physicsUtils.add_rigid_cube(
- stage: Stage,
- path: str | Path,
- size: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- density: float = 1.0,
- lin_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- ang_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
Add UsdGeom.Cube to the stage and add physics rigid body and collider API to it.
- Parameters:
stage – The Usd.Stage to add cube.
path – The desired cube path.
size – The size of the cube.
position – The position where the cube should be placed in stage.
orientation – The cube orientation.
color – The color of the mesh.
lin_velocity – The initial linear velocity of the rigid body.
ang_velocity – The initial angular velocity of the rigid body.
- omni.physx.scripts.physicsUtils.add_rigid_cylinder(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- height: float = 1.0,
- axis: str = 'Y',
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- density: float = 1.0,
- lin_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- ang_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
Add UsdGeom.Cylinder to the stage and add physics rigid body and collider API to it.
- Parameters:
stage – The Usd.Stage to add cylinder.
path – The desired cylinder path.
radius – The radius of the cylinder.
height – The height of the cylinder.
axis – The axis of the cylinder.
position – The position where the cylinder should be placed in stage.
orientation – The cylinder orientation.
color – The color of the mesh.
lin_velocity – The initial linear velocity of the rigid body.
ang_velocity – The initial angular velocity of the rigid body.
- omni.physx.scripts.physicsUtils.add_rigid_sphere(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- density: float = 1.0,
- lin_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- ang_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
Add UsdGeom.Sphere to the stage and add physics rigid body and collider API to it.
- Parameters:
stage – The Usd.Stage to add sphere.
path – The desired sphere path.
radius – The radius of the sphere.
position – The position where the sphere should be placed in stage.
orientation – The sphere orientation.
color – The color of the mesh.
lin_velocity – The initial linear velocity of the rigid body.
ang_velocity – The initial angular velocity of the rigid body.
- omni.physx.scripts.physicsUtils.add_rigid_xform(
- stage: Stage,
- path: str | Path,
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- scale: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add xform to the stage with given transformation and add rigid body API to it.
- Parameters:
stage – The Usd.Stage to add cone.
path – The desired xform path.
position – The position where the xform should be placed in stage.
orientation – The xform orientation.
scale – The xform scale.
- omni.physx.scripts.physicsUtils.add_sphere(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Sphere to the stage.
- Parameters:
stage – The Usd.Stage to add sphere.
path – The desired sphere path.
radius – The radius of the sphere.
position – The position where the sphere should be placed in stage.
orientation – The sphere orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_xform(
- stage: Stage,
- path: str | Path,
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- scale: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add xform to the stage with given transformation.
- Parameters:
stage – The Usd.Stage to add cone.
path – The desired xform path.
position – The position where the xform should be placed in stage.
orientation – The xform orientation.
scale – The xform scale.
- omni.physx.scripts.physicsUtils.compute_bounding_box_diagonal(
- points: List[Float3],
Gets diagonal length of given point bounds.
- Parameters:
points – The input points.
- omni.physx.scripts.physicsUtils.copy_transform_as_scale_orient_translate(
- src: Xformable,
- dst: Xformable,
Copies the local transforms from one Xformable to another as a default scale->orient->translate stack.
- Note that:
Any skew in the src transform will be lost.
A resetXformStack is preserved, but not the XformOps that are ignored due to the reset.
The transform attribute precision of added XformOps is set to UsdGeom.XformOp.PrecisionFloat.
Obsolete xformOp: namespace attributes in dst are not removed (and cannot be for layers)
- Parameters:
src – The source Xformable.
dst – The destination Xformable.
- omni.physx.scripts.physicsUtils.create_mesh(
- stage: Stage,
- path: str | Path,
- points: List[Vec3f] | List[Vec3d],
- normals: List[Vec3f] | List[Vec3d],
- indices: List[int],
- vertexCounts: List[Vec3f],
Create UsdGeom.Mesh from given points, normals, indices and face counts.
- Parameters:
stage – The Usd.Stage to add path.
path – The desired path to create.
points – The input points.
normals – The input normals.
indices – The indices for faces.
vertexCounts – Face counts.
- omni.physx.scripts.physicsUtils.create_mesh_concave(
- stage: Stage,
- path: str | Path,
- halfSize: float,
Create UsdGeom.Mesh that represents a concave mesh.
- Parameters:
stage – The Usd.Stage to add path.
path – The desired path to create.
halfSize – The half size of the mesh.
- omni.physx.scripts.physicsUtils.create_mesh_cone(
- stage: Stage,
- path: str | Path,
- height: float,
- radius: float,
- tesselation: int = 32,
Create UsdGeom.Mesh that represents a cone mesh.
- Parameters:
stage – The Usd.Stage to add path.
path – The desired path to create.
height – The height of the cone.
radius – The radius of the cone.
tesselation – The tesselation of the cone mesh.
- omni.physx.scripts.physicsUtils.create_mesh_cube(
- stage: Stage,
- path: str | Path,
- halfSize: float,
Create UsdGeom.Mesh that represents a cube mesh.
- Parameters:
stage – The Usd.Stage to add path.
path – The desired path to create.
halfSize – The half size of the cube.
- omni.physx.scripts.physicsUtils.create_mesh_cylinder(
- stage: Stage,
- path: str | Path,
- height: float,
- radius: float,
- tesselation: int = 32,
Create UsdGeom.Mesh that represents a cylinder mesh.
- Parameters:
stage – The Usd.Stage to add path.
path – The desired path to create.
height – The height of the cylinder.
radius – The radius of the cylinder.
tesselation – The tesselation of the cylinder mesh.
- omni.physx.scripts.physicsUtils.create_mesh_square_axis(
- stage: Stage,
- path: str | Path,
- axis: str,
- halfSize: float,
Create UsdGeom.Mesh that represents a square.
- Parameters:
stage – The Usd.Stage to add path.
path – The desired path to create.
axis – The up axis “Y”, “Z”.
halfSize – The half size of the square.
- omni.physx.scripts.physicsUtils.get_translation(prim: Prim) Vec3f | Vec3d #
Return translate attribute value from the given prim.
- Parameters:
prim – The Usd.Prim to check.
- omni.physx.scripts.physicsUtils.is_in_collision_group(
- stage: Stage,
- collisionPath: str | Path,
- collisionGroupPath: str | Path,
Checks if a collision path belongs to a collision group include rel.
- Parameters:
stage – The Usd.Stage to add path.
collisionPath – Collision path to add.
collisionGroupPath – Collision group prim path.
- omni.physx.scripts.physicsUtils.remove_collision_from_collision_group(
- stage: Stage,
- collisionPath: str | Path,
- collisionGroupPath: str | Path,
Remove collision path to a collision group include rel.
- Parameters:
stage – The Usd.Stage to add path.
collisionPath – Collision path to add.
collisionGroupPath – Collision group prim path.
- omni.physx.scripts.physicsUtils.set_or_add_orient_op(
- xformable: Xformable,
- orient: Quatf | Quatd | Quath,
Sets or adds the orient XformOp on the input Xformable to provided orient value.
- Note that:
The precision of an added attribute is UsdGeom.XformOp.PrecisionFloat.
- Parameters:
xformable – The Xformable to modify.
orient – The orient quaternion
- Returns:
The set or added XformOp
- omni.physx.scripts.physicsUtils.set_or_add_scale_op(
- xformable: Xformable,
- scale: Vec3f | Vec3d | Vec3h,
Sets or adds the scale XformOp on the input Xformable to provided scale value.
- Note that:
The precision of an added attribute is UsdGeom.XformOp.PrecisionFloat.
- Parameters:
xformable – The Xformable to modify.
scale – The scale vector
- Returns:
The set or added XformOp
- omni.physx.scripts.physicsUtils.set_or_add_scale_orient_translate(
- xformable: Xformable,
- scale: Vec3f | Vec3d | Vec3h,
- orient: Quatf | Quatd | Quath,
- translate: Vec3f | Vec3d | Vec3h,
Sets or adds scale, orient, and translate XformOps of xformable.
- Note that:
The precision of created attributes is UsdGeom.XformOp.PrecisionFloat.
- Parameters:
xformable – The Xformable to modify.
scale – The scale vector
orient – The orientation quaternion
translate – The translation vector
- Returns:
List of set and created xform ops that will be [translate, orient, scale]
- omni.physx.scripts.physicsUtils.set_or_add_translate_op(
- xformable: Xformable,
- translate: Vec3f | Vec3d | Vec3h,
Sets or adds the translate XformOp on the input Xformable to provided translate value.
- Note that:
The precision of an added attribute is UsdGeom.XformOp.PrecisionFloat.
- Parameters:
xformable – The Xformable to modify.
translate – The translate vector
- Returns:
The set or added XformOp
- omni.physx.scripts.physicsUtils.setup_transform_as_scale_orient_translate(
- xformable: Xformable,
Changes the local transform (ops) to the physics default scale->orient->translate stack.
- Note that:
Any skew in the transform will be lost.
A resetXformStack is preserved, but not the XformOps that are ignored due to the reset.
The transform attribute precision is set to UsdGeom.XformOp.PrecisionFloat.
Obsolete xformOp: namespace attributes are not removed (and cannot be for layers)
- Parameters:
xformable – The Xformable to modify.
- omni.physx.scripts.deformableUtils.add_auto_deformable_mesh_simplification(
- stage,
- prim_path: Path,
- Add a simplification collision mesh on a prim with PhysxSchema.PhysxAutoDeformableBodyAPI, and setup the deformable
body correspondingly.
- Parameters:
stage – The stage
prim_path – Path to UsdGeom.Scope/UsdGeom.Xform to which the PhysxSchema.PhysxAutoDeformableBodyAPI is applied to.
- Returns:
True / False that indicates success of schema application
- omni.physx.scripts.deformableUtils.add_deformable_body_material(
- stage,
- path,
- damping_scale=None,
- density=None,
- dynamic_friction=None,
- elasticity_damping=None,
- poissons_ratio=None,
- youngs_modulus=None,
DEPRECATED: Will be replaced by new deformable implementation in future release. Applies the PhysxSchema.PhysxDeformableSurfaceMaterialAPI to the prim at path on stage.
- Parameters:
stage – The stage
path – Path to UsdShade.Material to which the material API should be applied to.
attributes (... schema) – See USD schema for documentation
- Returns:
True if the API apply succeeded.
- omni.physx.scripts.deformableUtils.add_deformable_material(
- stage: Stage,
- path,
- density=None,
- static_friction=None,
- dynamic_friction=None,
- youngs_modulus=None,
- poissons_ratio=None,
Applies the UsdPhysics.DeformableMaterialAPI to the prim at path on stage.
- Parameters:
stage – The stage
path – Path to UsdShade.Material to which the material API should be applied to.
attributes (... schema) – See USD schema for documentation
- Returns:
True if the API apply succeeded.
- omni.physx.scripts.deformableUtils.add_deformable_surface_material(
- stage,
- path,
- density=None,
- dynamic_friction=None,
- poissons_ratio=None,
- thickness=None,
- youngs_modulus=None,
DEPRECATED: Will be replaced by new deformable implementation in future release. Applies the PhysxSchema.PhysxDeformableSurfaceMaterialAPI to the prim at path on stage.
- Parameters:
stage – The stage
path – Path to UsdShade.Material to which the material API should be applied to.
attributes (... schema) – See USD schema for documentation
- Returns:
True if the API apply succeeded.
- omni.physx.scripts.deformableUtils.add_physx_deformable_body(
- stage,
- prim_path: Path,
- collision_rest_points: List[Vec3f] = None,
- collision_indices: List[int] = None,
- kinematic_enabled: bool = False,
- collision_simplification: bool = True,
- collision_simplification_remeshing: bool = True,
- collision_simplification_remeshing_resolution: int = 0,
- collision_simplification_target_triangle_count: int = 0,
- collision_simplification_force_conforming: bool = False,
- simulation_rest_points: List[Vec3f] = None,
- simulation_indices: List[int] = None,
- embedding: List[int] = None,
- simulation_hexahedral_resolution: int = 10,
- solver_position_iteration_count: int = None,
- vertex_velocity_damping: float = None,
- sleep_damping: float = None,
- sleep_threshold: float = None,
- settling_threshold: float = None,
- self_collision: bool = None,
- self_collision_filter_distance: float = None,
DEPRECATED: Will be replaced by new deformable implementation in future release. Applies the deformable body API to an Xform at prim_path on stage.
- Parameters:
stage – The stage
prim_path – Path to UsdGeom.Mesh ‘skin mesh’ to which the PhysxSchema.PhysXDeformableBodyAPI is applied to.
collision_rest_points – List of vertices of the collision tetrahedral mesh at rest. If a collision mesh is provided, the simulation mesh needs to be provided too. If no collision mesh is provided, it will be computed implicitly based on the simplification parameter.
collision_indices – List of indices of the collision tetrahedral mesh.
kinematic_enabled – Enables kinematic body.
collision_simplification – Boolean flag indicating if simplification should be applied to the mesh before creating a softbody out of it. Is ignored if simulation mesh has been provided.
collision_simplification_remeshing – Boolean flag indicating if the simplification should be based on remeshing. Ignored if collision_simplification equals False.
collision_simplification_remeshing_resolution – The resolution used for remeshing. A value of 0 indicates that a heuristic is used to determine the resolution. Ignored if collision_simplification_remeshing is False.
collision_simplification_target_triangle_count – The target triangle count used for the simplification. A value of 0 indicates that a heuristic based on the simulation_hexahedral_resolution is to determine the target count. Ignored if collision_simplification equals False.
collision_simplification_force_conforming – Boolean flag indicating that the tretrahedralizer used to generate the collision mesh should produce tetrahedra that conform to the triangle mesh. If False the implementation chooses the tretrahedralizer used.
simulation_rest_points – List of vertices of the simulation tetrahedral mesh at rest. If a simulation mesh is provided, the collision mesh needs to be provided too. If no simulation mesh is provided it will be computed implicitly based on simulation_hexahedral_resolution.
simulation_indices – List of indices of the simulation tetrahedral mesh.
embedding – Optional embedding information mapping collision points to containing simulation tetrahedra.
simulation_hexahedral_resolution – Target resolution of voxel simulation mesh. Is ignored if simulation mesh has been provided.
... – See USD schema for documentation
- Returns:
True / False that indicates success of schema application
- omni.physx.scripts.deformableUtils.add_physx_deformable_surface(
- stage,
- prim_path: Path,
- simulation_rest_points: List[Vec3f] = None,
- simulation_indices: List[int] = None,
- bending_stiffness_scale: float = None,
- solver_position_iteration_count: int = None,
- vertex_velocity_damping: float = None,
- sleep_damping: float = None,
- sleep_threshold: float = None,
- settling_threshold: float = None,
- self_collision: bool = None,
- self_collision_filter_distance: float = None,
DEPRECATED: Will be replaced by new deformable implementation in future release. Applies the deformable surface API to an Xform at prim_path on stage.
- Parameters:
stage – The stage
prim_path – Path to UsdGeom.Mesh ‘skin mesh’ to which the PhysxSchema.PhysXDeformableBodyAPI is applied to.
simulation_rest_points – List of vertices of the simulation mesh at rest.
simulation_indices – List of indices of the simulation mesh.
... – See USD schema for documentation
- Returns:
True / False that indicates success of schema application
- omni.physx.scripts.deformableUtils.add_surface_deformable_material(
- stage: Stage,
- path,
- density=None,
- static_friction=None,
- dynamic_friction=None,
- youngs_modulus=None,
- poissons_ratio=None,
- surface_thickness=None,
- surface_stretch_stiffness=None,
- surface_shear_stiffness=None,
- surface_bend_stiffness=None,
Applies the UsdPhysics.SurfaceDeformableMaterialAPI to the prim at path on stage.
- Parameters:
stage – The stage
path – Path to UsdShade.Material to which the material API should be applied to.
attributes (... schema) – See USD schema for documentation
- Returns:
True if the API apply succeeded.
- omni.physx.scripts.deformableUtils.create_auto_surface_deformable_hierarchy(
- stage: Stage,
- root_prim_path: str | Path,
- simulation_mesh_path: str | Path,
- cooking_src_mesh_path: str | Path,
- cooking_src_simplification_enabled: bool,
- set_visibility_with_guide_purpose: bool = False,
Creates a surface deformable body from a stage hierachy and adds necessary prims and APIs. For single prim deformable bodies, use set_physics_surface_deformable_body on a UsdGeom.Mesh.
- Parameters:
stage – The stage
root_prim_path – Path to valid a UsdGeom.Imageable which cannot be a UsdGeom.Gprim. The UsdPhysics.DeformableBodyAPI is applied to this prim.
simulation_mesh_path – Path to where simulation mesh should be created or a valid UsdGeom.Mesh.
cooking_src_mesh_path – Path to valid UsdGeom.Mesh that is used in cooking to generate the simulation mesh. May be outside of root_prim_path sub-hierarchy.
cooking_src_simplification_enabled – If True, PhysxAutoDeformableMeshSimplificationAPI is applied.
set_visibility_with_guide_purpose – If True, the simulation mesh is assigned the guide purpose to hide it from rendering - but only if other GPrims are present under root_prim_path to provide visible geometry.
- Returns:
True / False that indicates success of creation.
- omni.physx.scripts.deformableUtils.create_auto_volume_deformable_hierarchy(
- stage: Stage,
- root_prim_path: str | Path,
- simulation_tetmesh_path: str | Path,
- collision_tetmesh_path: str | Path,
- cooking_src_mesh_path: str | Path,
- simulation_hex_mesh_enabled: bool,
- cooking_src_simplification_enabled: bool,
- set_visibility_with_guide_purpose: bool = False,
Creates a volume deformable body from a stage hierachy and adds necessary prims and APIs. For single prim deformable bodies, use set_physics_volume_deformable_body on a UsdGeom.TetMesh.
- Parameters:
stage – The stage
root_prim_path – Path to valid a UsdGeom.Imageable which cannot be a UsdGeom.Gprim. The UsdPhysics.DeformableBodyAPI is applied to this prim.
simulation_tetmesh_path – Path to where simulation mesh should be created or a valid UsdGeom.TetMesh.
collision_tetmesh_path – Path to where collision mesh should be created or a valid UsdGeom.TetMesh. CollisionAPI is applied to the collision mesh. May be identical to simulation_tetmesh_path.
cooking_src_mesh_path – Path to valid UsdGeom.Mesh that is used in cooking to generate the simulation and collision mesh. May be outside of root_prim_path sub-hierarchy.
simulation_hex_mesh_enabled – If True, simulation mesh is generated as a hexahedral mesh.
cooking_src_simplification_enabled – If True, PhysxAutoDeformableMeshSimplificationAPI is applied.
set_visibility_with_guide_purpose – If True, the simulation and collision meshes are assigned the guide purpose to hide them from rendering - but only if other GPrims are present under root_prim_path to provide visible geometry. If the simulation and collision meshes are the only geometry present and are distinct, then only the simulation mesh is assigned the guide purpose, leaving the collision mesh for visual representation.
- Returns:
True / False that indicates success of creation.
- omni.physx.scripts.deformableUtils.create_skin_mesh_from_tetrahedral_mesh(
- target_path: Path,
- stage: Stage,
- source_tetrahedal_mesh_path: Path,
DEPRECATED: Will be replaced by new deformable implementation in future release.
- omni.physx.scripts.deformableUtils.create_triangle_mesh_square(dimx: int, dimy: int, scale: float = 1.0)#
Creates points and vertex data for a regular-grid flat triangle mesh square.
- Parameters:
dimx – Mesh-vertex resolution in X
dimy – Mesh-vertex resolution in Y
scale – Uniform scale applied to vertices
- Returns:
The vertex and index data
- Return type:
points, indices
- omni.physx.scripts.deformableUtils.set_physics_surface_deformable_body(
- stage,
- prim_path: Path,
Setup a surface deformable body based on a UsdGeom.Mesh at prim_path on stage and add necessary prims and APIs. For hierarchical setups use create_auto_surface_deformable_hierarchy.
- Parameters:
stage – The stage
prim_path – Path to UsdGeom.Mesh ‘sim mesh’ to which the UsdPhysics.DeformableBodyAPI is applied to.
- Returns:
True / False that indicates success of schema application
- omni.physx.scripts.deformableUtils.set_physics_volume_deformable_body(
- stage,
- prim_path: Path,
Setup a volume deformable body based on a UsdGeom.TetMesh at prim_path on stage and add necessary prims and APIs. For hierarchical setups use create_auto_volume_deformable_hierarchy.
- Parameters:
stage – The stage
prim_path – Path to UsdGeom.TetMesh ‘sim mesh’ to which the UsdPhysics.DeformableBodyAPI is applied to.
- Returns:
True / False that indicates success of schema application