C API Reference#
The full C API is defined in these headers:
include/ovphysx/ovphysx.h– API functionsinclude/ovphysx/ovphysx_types.h– types and enumsinclude/ovphysx/ovphysx_config.h– typed config entry builders
C++ convenience wrappers (experimental, C++17):
include/ovphysx/experimental/ovphysx.hpp– RAII instance wrapperinclude/ovphysx/experimental/Helpers.hpp– RAII helpers, includingWaitResultinclude/ovphysx/experimental/TensorBinding.hpp– RAII tensor binding wrapper (deprecated; useovphysx_read/ovphysx_write)
For rendered documentation with full descriptions, refer to the built HTML docs.
C API Functions#
Articulation Kinematic Update#
Use ovphysx_update_articulations_kinematic() after writing articulation DOF
positions when link-pose tensors must reflect the new joint positions before
the next simulation step. The Python method is
PhysX.update_articulations_kinematic(), and the experimental C++ wrapper is
PhysX::updateArticulationsKinematic(). The operation is synchronous and
updates articulation forward kinematics only; after any required first GPU
warmup, it does not run a normal simulation step or collision/contact
processing.
Functions
-
ovphysx_result_t ovphysx_initialize(void)#
Initialize process-global ovphysx lifecycle state.
- Returns:
OVPHYSX_API_SUCCESS if lifecycle state was initialized.
OVPHYSX_API_ERROR if lifecycle state is already initialized, or on x86_64 if the host CPU or OS does not expose AVX (required by pre-built x86_64 binaries).
- ovphysx_result_t ovphysx_create_instance(
- const ovphysx_create_args *create_args,
- ovphysx_handle_t *out_handle,
Create a new ovphysx instance.
Initialize create_args with OVPHYSX_CREATE_ARGS_DEFAULT for sensible defaults:
#include <ovphysx/ovphysx.h> int main(void) { ovphysx_create_args args = OVPHYSX_CREATE_ARGS_DEFAULT; ovphysx_handle_t handle = OVPHYSX_INVALID_HANDLE; if (ovphysx_set_log_level(OVPHYSX_LOG_VERBOSE).status != OVPHYSX_API_SUCCESS || ovphysx_initialize().status != OVPHYSX_API_SUCCESS) return 1; ovphysx_result_t result = ovphysx_create_instance(&args, &handle); if (result.status == OVPHYSX_API_SUCCESS) result = ovphysx_destroy_instance(handle); if (ovphysx_shutdown().status != OVPHYSX_API_SUCCESS) return 1; return result.status == OVPHYSX_API_SUCCESS ? 0 : 1; }
- Side Effects
Loads runtime components and initializes process-level state.
- Threading
Safe to call from any thread. The resulting handle is not thread-safe for concurrent use.
- Ownership
Caller owns the instance handle and must destroy it.
- Errors
OVPHYSX_API_INVALID_ARGUMENT on null required pointers, inconsistent config_entries / config_entry_count, or invalid active_cuda_gpus
OVPHYSX_API_ERROR if ovphysx_initialize() is not active, if an explicit OmniPVD creation setting is supplied while another instance exists, or for other initialization failures
Note
A non-empty active_cuda_gpus request is retained by this handle and applied to the shared process physics backend when this handle attaches a stage. A different deterministic ordinal after the first GPU scene requires a new process. Per-scene device selection (CPU vs GPU dynamics) is owned by PhysX via physxScene:enableGPUDynamics in the USD stage. Use ovphysx_set_cpu_mode() before creating any instance to force process-wide CPU-only mode.
- Parameters:
create_args – Configuration for the ovphysx instance (must not be NULL). If config_entry_count is nonzero, config_entries must not be NULL.
out_handle – [out] ovphysx handle (must not be NULL).
- Returns:
ovphysx_result_t with status and error info.
- Pre:
create_args != NULL, out_handle != NULL.
- Post:
On success, *out_handle is a valid handle that must be destroyed with ovphysx_destroy_instance().
- Post:
With an active lifecycle, if config_entries is NULL and config_entry_count is nonzero, *out_handle is unchanged.
-
ovphysx_result_t ovphysx_set_cpu_mode(bool cpu_only)#
Force process-wide CPU-only mode.
To keep ovphysx itself from touching the CUDA driver for the lifetime of the process, set this to true before the first instance is ever created. All subsequent PhysX scenes use CPU dynamics regardless of their USD physxScene:enableGPUDynamics setting. Other libraries in the process may still open the driver. Loading an ovstage-backed Stage currently does.
The Python frontend has one further dependency: read() and write() expose warp.array tensors, and building the first array initializes the Warp runtime, which opens the CUDA driver when the installed Warp was built with CUDA. Warp has no runtime switch for this. A CPU-only Warp keeps the read and write paths driverless:
conda install -c conda-forge "warp-lang=*=*cpu*", or a Warp built from source with no CUDA toolkit configured (WP_ENABLE_CUDA=0). The wheel’s ownwarp-langdependency resolves to the CUDA-enabled PyPI build, so this is an opt-in for deployments that need the guarantee. The Python frontend detects a CUDA-enabled Warp under CPU-only mode and warns once, naming the remedy. For per-scene CPU control without this flag, author each scene explicitly (physxScene:enableGPUDynamics=false + physxScene:broadphaseType=”MBP”).Requires that no instances are active. Returns OVPHYSX_API_ERROR if any instances currently exist, or if attempting to set false after true has been applied. The CPU-only request is sticky as soon as a call setting it to true succeeds. A call after an earlier instance was destroyed may succeed, but cannot provide the ovphysx no-CUDA-touch guarantee or retarget an already-bootstrapped runtime. For CPU-only deployments, setting OVPHYSX_DISABLE_GPU before ovphysx initialization provides the equivalent process-wide policy.
-
ovphysx_result_t ovphysx_get_cpu_mode(bool *out_cpu_only)#
Query whether process-wide hard CPU-only mode is in effect.
Reports the effective hard CPU-only policy: true when ovphysx_set_cpu_mode has succeeded with true, or when
OVPHYSX_DISABLE_GPUis active. The environment variable is read live before ovphysx_initialize (and again after ovphysx_shutdown until the next initialize); ovphysx_initialize latches the value for that initialized interval. This is not a query of per-scene USDphysxScene:enableGPUDynamics, and it does not report a CUDA ordinal (active_cuda_gpus) or attach-time resolved dynamics/device outcome.Callable at any time. No instance and no prior ovphysx_initialize() are required.
- Parameters:
out_cpu_only – [out] Receives true when hard CPU-only mode is active. Must not be NULL.
- Returns:
OVPHYSX_API_SUCCESS on success.
- Returns:
OVPHYSX_API_INVALID_ARGUMENT if out_cpu_only is NULL.
- ovphysx_result_t ovphysx_get_codeless_schema_root(
- ovphysx_string_t *out_root,
Locate the codeless PhysX USD schemas shipped with ovphysx.
ovphysx ships its PhysX schema definitions (
PhysxSchemaandOmniUsdPhysicsDeformableSchema) as codeless USD plugins: a rootplugInfo.jsonplus one<Module>/resources/directory per schema module. ovphysx does not load, link, or configure OpenUSD and never registers these schemas itself. The application owns its USD runtime(s) and registers the schemas explicitly:With ovstage, pass the returned path to
ovstage_population_register_usd_schemas()before the first population call in the process.With a stock OpenUSD runtime, add the path to
PXR_PLUGINPATH_NAMEbefore the process starts, or pass it toPlugRegistry::RegisterPlugins()before the first schema-registry access.
The path is derived from the location of the ovphysx shared library, or from
OVPHYSX_LIBwhen it is set:<library directory>/schemas/physx(a runtime copied beside an application) is checked first, then<library directory>/../schemas/physx(the SDK and wheel layouts,<sdk>/schemas/physx).Notes:
Safe to call at any time, including before ovphysx_create_instance().
Does not initialize ovphysx, load USD, acquire Carbonite, or modify the environment.
The returned string is NUL-terminated and owned by ovphysx. It stays valid until the calling thread calls this function again.
- Parameters:
out_root – Receives the schema root directory. Set to an empty string on failure.
- Returns:
OVPHYSX_API_SUCCESS if the schema root was found.
OVPHYSX_API_INVALID_ARGUMENT if
out_rootis NULL.OVPHYSX_API_ERROR if no
schemas/physx/plugInfo.jsonexists next to the library. Use ovphysx_get_last_error() for details.
-
ovphysx_result_t ovphysx_destroy_instance(ovphysx_handle_t handle)#
Destroy an ovphysx instance and release per-instance resources.
Per-instance destruction leaves the process lifecycle active. Call ovphysx_shutdown after destroying the final handle to drain the direct PhysX runtime and clear that lifecycle token.
#include <ovphysx/ovphysx.h> static ovphysx_result_t destroy_owned_instance(ovphysx_handle_t handle) { return ovphysx_destroy_instance(handle); }
- Side Effects
Releases internal resources, plugins, and cached data for this instance.
- Threading
Do not destroy an instance while it is in use on other threads.
- Ownership
After destruction, any bindings created by this instance are invalid.
- Errors
OVPHYSX_API_ERROR if the handle is not registered or destruction fails. An unregistered handle is rejected before teardown and does not affect registered instances or process-global asynchronous state. No error string is returned. Consult logs for other destruction failures.
- Parameters:
handle – ovphysx handle to destroy.
- Returns:
ovphysx_result_t with status and error info.
- Post:
On success, the handle is unregistered and its resources are released. A repeated call for that already-unregistered value returns OVPHYSX_API_ERROR before teardown and has no effect on registered instances or process-global asynchronous state.
-
ovphysx_result_t ovphysx_shutdown(void)#
Clear the ovphysx process-lifecycle token.
Clears the process-global initialized state set by ovphysx_initialize. It does not destroy live handles and does not balance ovphysx_create_instance. Callers must destroy every handle explicitly with ovphysx_destroy_instance.
Must be paired with a prior ovphysx_initialize call. Call once when the application is done with the current process-lifecycle scope. After shutdown, callers must invoke ovphysx_initialize again before creating another instance.
On every successful return, including when live handles remain, shutdown flushes Carbonite’s buffered records, stops accepting application-callback delivery, and drains accepted callbacks. When runtime teardown occurs, the barrier includes its final log producer. The callback and its user-data resources may then be released. Accepted callbacks must not wait indefinitely on the thread performing shutdown.
- Static runtime mode
With no live handles, shutdown drains the direct PhysX runtime while the Carbonite framework remains resident for its process-exit hook. If live handles remain, callers still own them and the direct runtime remains available only for their explicit destruction. Continued stepping or other instance work after shutdown is unsupported, and destruction-time records are not delivered to the application callback disabled by shutdown.
- Returns:
OVPHYSX_API_SUCCESS on success.
OVPHYSX_API_ERROR if called without a matching ovphysx_initialize.
OVPHYSX_API_ERROR if called from the application log callback. Use ovphysx_get_last_error() for details.
- void ovphysx_get_version(
- uint32_t *out_major,
- uint32_t *out_minor,
- uint32_t *out_patch,
Get runtime version of the library.
Useful for checking ABI compatibility between headers and shared library. For compile-time version macros, include
ovphysx/version.h.- Parameters:
out_major – [out] Major version (must not be NULL)
out_minor – [out] Minor version (must not be NULL)
out_patch – [out] Patch version (must not be NULL)
-
const char *ovphysx_get_version_string(void)#
Get version as string (e.g., “0.1.0”).
- Returns:
Version string with static storage duration (valid for lifetime of process, do not free).
- ovphysx_result_t ovphysx_set_global_config(
- ovphysx_config_entry_t entry,
Set a typed global config entry at runtime (process-global).
IMPORTANT: Config is PROCESS-GLOBAL. Changes affect all ovphysx instances in the current process. Configure before creating instances or loading USD for predictable behavior. OmniPVD output, recording capability, directory, transport, address, port, and timeout settings are create-only and return OVPHYSX_API_ERROR while an instance exists.
Use the builder functions in ovphysx_config.h for convenient construction:
#include <ovphysx/ovphysx.h> #include <ovphysx/ovphysx_config.h> static ovphysx_result_t configure_runtime(void) { ovphysx_result_t result = ovphysx_set_global_config(ovphysx_config_entry_num_threads(4)); if (result.status != OVPHYSX_API_SUCCESS) return result; result = ovphysx_set_global_config( ovphysx_config_entry_disable_contact_processing(true)); if (result.status != OVPHYSX_API_SUCCESS) return result; return ovphysx_set_global_config(ovphysx_config_entry_carbonite( OVPHYSX_LITERAL("/physics/updateToUsd"), OVPHYSX_LITERAL("false"))); }
- Parameters:
entry – Typed config entry to apply.
- Returns:
ovphysx_result_t with status and error info.
- ovphysx_result_t ovphysx_get_global_config_bool(
- ovphysx_config_bool_t key,
- bool *out_value,
Get a boolean config value.
- Parameters:
key – Boolean config key.
out_value – [out] Current value.
- Returns:
ovphysx_result_t with status and error info.
- ovphysx_result_t ovphysx_get_global_config_int32(
- ovphysx_config_int32_t key,
- int32_t *out_value,
Get an int32 config value.
- Parameters:
key – Int32 config key.
out_value – [out] Current value.
- Returns:
ovphysx_result_t with status and error info.
- ovphysx_result_t ovphysx_get_global_config_float(
- ovphysx_config_float_t key,
- float *out_value,
Get a float config value.
- Parameters:
key – Float config key.
out_value – [out] Current value.
- Returns:
ovphysx_result_t with status and error info.
- ovphysx_result_t ovphysx_get_global_config_string(
- ovphysx_config_string_t key,
- ovphysx_string_t *value_out,
- size_t *out_required_size,
Get a string config value into a user-provided buffer.
- Parameters:
key – String config key.
value_out – [in/out] String with a pre-allocated writable, non-NULL buffer. length is the buffer capacity and must be in the range 1 through UINT32_MAX.
out_required_size – [out] Required buffer size including null terminator.
- Returns:
OVPHYSX_API_SUCCESS on success, OVPHYSX_API_BUFFER_TOO_SMALL when the buffer holds only a truncated value, OVPHYSX_API_NOT_FOUND when the config value is absent, OVPHYSX_API_INVALID_ARGUMENT for an invalid key, pointer, or capacity, or OVPHYSX_API_ERROR when settings are unavailable.
- Post:
On success, value_out->length is the content length and value_out->ptr[value_out->length] is ‘\0’.
- Post:
On OVPHYSX_API_BUFFER_TOO_SMALL, value_out->length remains the input buffer capacity, value_out->ptr[value_out->length - 1] is ‘\0’, and out_required_size reports the required capacity including the NUL.
- ovphysx_result_t ovphysx_start_recording(
- ovphysx_handle_t handle,
- const ovphysx_omnipvd_destination_t *destination,
Start an OmniPVD recording session.
The call is synchronous. A FILE destination is an exact path. A TCP destination connects to a ready listener. Validation and stream-open failures may be retried. Only one recording may be active in the shared runtime: another start returns OVPHYSX_API_INVALID_STATE without replacing its destination. After a successful stop, another FILE or TCP session may be started. Late start requires a live physics stage in the shared runtime. Before its first attach and between detach and reattach it returns OVPHYSX_API_INVALID_STATE.
Late start requires process-wide recording capability to be selected before the first instance is created, either with OVPHYSX_CONFIG_OMNIPVD_RECORDING_CAPABLE or by enabling startup output. A default, incapable instance returns OVPHYSX_API_INVALID_STATE and an error naming omnipvd_recording_capable. Unsupported platforms retain OVPHYSX_API_NOT_IMPLEMENTED.
After reattach, a capability-only runtime is dormant and can start late recording immediately. A runtime with startup output configured instead starts a new startup session owned by the reattaching handle. That handle must stop the session before any late destination can start.
- Parameters:
handle – Instance requesting the recording session.
destination – FILE or TCP destination borrowed for this call.
- Returns:
OVPHYSX_API_SUCCESS, OVPHYSX_API_INVALID_ARGUMENT for an invalid destination, OVPHYSX_API_INVALID_STATE when the runtime is not recording-capable, the shared runtime has no live physics stage, or recording is active, OVPHYSX_API_NOT_IMPLEMENTED on an unsupported platform, or OVPHYSX_API_ERROR when the destination cannot be opened or sampling cannot start.
-
ovphysx_result_t ovphysx_stop_recording(ovphysx_handle_t handle)#
Stop and finalize the active recording.
The handle that started a late session owns it. The handle whose creation started startup output owns that startup session. A peer handle is inactive and cannot stop the owner’s session. A successful owner stop permits a later recording session to start.
- Returns:
OVPHYSX_API_SUCCESS, OVPHYSX_API_INVALID_STATE when this handle owns no active recording (including while a peer owns the globally active session), or OVPHYSX_API_ERROR when stop/finalization fails.
- ovphysx_result_t ovphysx_is_recording(
- ovphysx_handle_t handle,
- bool *out_is_recording,
Query whether this instance’s startup or late recording is active.
A peer reports false while another instance owns the shared runtime’s active recording.
- Parameters:
handle – Valid instance handle.
out_is_recording – [out] Receives true only while sampling is active.
-
ovphysx_enqueue_result_t ovphysx_reset_stage(ovphysx_handle_t handle)#
- ovphysx_result_t ovphysx_attach_ovstage(
- ovphysx_handle_t handle,
- ovstage_instance_t *stage,
- ovstage_ordinal_t read_ordinal,
Attach an ovstage Stage as the orchestration data surface.
Once attached, the orchestration contract is explicit and application-owned in both directions (the application owns ordinal advancement):
Application to physics (control in): the application authors dirty control attributes into ovstage (drive:force, drive:velocity, drive:position_target, physics:mass, physics:gravityMagnitude, physics:gravityDirection, and so on) at ordinals it chooses, then calls ovphysx_update_from_ovstage to drain that ordinal range into the running simulation. ovphysx_step then integrates.
Physics to application (output out): ovphysx_step does not author simulation output back into the Stage on its own. The application reads the step’s output with ovphysx_read / ovphysx_fetch_read_next and writes it back into ovstage at a separate, higher (physics-output) ordinal. That ordinal is never covered by update_from_ovstage, so physics never reprocesses its own writes. See the ordinal-coupling section on ovphysx_query.
This is one consistent model: initial parse at attach, explicit control updates via update_from_ovstage, and application-owned output writeback via the read API. For direct control without going through ovstage, use the session write API (ovphysx_write). The legacy tensor bindings remain available for the same purpose but are deprecated.
The attachment is init-style. Call it once per instance, before any ovphysx_step(). Replacing the attached Stage requires ovphysx_detach_ovstage() first.
#include <ovphysx/ovphysx.h> static ovphysx_result_t attach_caller_owned_stage( ovphysx_handle_t handle, ovstage_instance_t* stage, ovstage_ordinal_t read_ordinal) { return ovphysx_attach_ovstage(handle, stage, read_ordinal); }
- Errors
OVPHYSX_API_INVALID_ARGUMENT if stage is null or read_ordinal is 0
OVPHYSX_API_ERROR if already attached or the runtime attach fails, including unreadable articulation/joint schema data during initial scan
OVPHYSX_API_ERROR if another instance already owns the live process-wide PhysX attach
OVPHYSX_API_ERROR if the PhysX USD schemas were not registered with ovstage before the first population in the process (see below), or the codeless schema tree next to the library is missing
Note
Not thread-safe per instance. Like the rest of the per-instance API, the caller must serialize ovphysx_attach_ovstage() against any other call on the same handle. The already-attached check and the attach are not internally locked against concurrent foreground callers.
Note
The underlying PhysX simulation attach is a process-wide resource: only one instance may hold a live ovstage attach at a time across the whole process. A second instance’s attempt to attach while another instance’s attach is live is rejected with OVPHYSX_API_ERROR rather than silently displacing it. Call ovphysx_detach_ovstage() on the owning instance first.
Note
The application owns schema registration: pass the directory returned by ovphysx_get_codeless_schema_root to
ovstage_population_register_usd_schemas()before the first population in the process, together with the Newton USD schema (https://github.com/newton-physics/newton-usd-schemas) when scenes authornewton:*attributes; ovphysx reads those as fallbacks for the PhysX spellings, does not ship that schema, and this call cannot verify its registration. Population drops every Physx* API it cannot resolve, so an unregistered stage carries none of the asset’s PhysX settings (self-collision, joint velocity limits, solver iterations, deformable and particle fallbacks). This call verifies the registration by re-registering the same root, which ovstage treats as a no-op when it was done in time and rejects when population already ran without it; the attach then fails with an error naming the missing call, and so does every later attach in the process, since the schema registry USD built without them cannot be rebuilt. ovstage keys the registration on the plugin family, so schemas discovered throughOV_PXR_PLUGINPATH_2511or registered from another copy of the tree pass the check. A registration another USD consumer made unobservable to ovstage cannot be detected; the create-time config entry/ovphysx/schemas/requireRegistration = falsedowngrades the refusal to a warning for such a host.- Parameters:
handle – ovphysx instance handle.
stage – Caller-owned ovstage Stage (
ovstage_instance_t*).read_ordinal – Caller-owned ordinal at which the initial scan’s required physics data is sealed. Must be non-zero: 0 is reserved as the runtime’s internal “use payload attach-time ordinal” sentinel. The application owns ordinal advancement. Subsequent edits are drained via ovphysx_update_from_ovstage().
- Pre:
handle is valid, ovphysx is not already attached to a Stage, stage is non-null, and read_ordinal is non-zero.
- Pre:
stage outlives the attachment. ovphysx captures this pointer and dereferences it on every ovphysx_update_from_ovstage() until ovphysx_detach_ovstage(); destroying the Stage between attach and detach is undefined behavior, not a recoverable error.
- Post:
On success, subsequent ovphysx_update_from_ovstage() calls observe committed Stage writes through the runtime ovstage backend.
- ovphysx_result_t ovphysx_update_from_ovstage(
- ovphysx_handle_t handle,
- ovstage_ordinal_range_t range,
Pull and apply committed ovstage edits over an explicit ordinal range.
The caller is the producer that advanced ovstage ordinals and therefore owns the range boundaries, passed as ovstage’s own
ovstage_ordinal_range_t. Withhas_start_ordinal == truethe closed range[start_ordinal, end_ordinal]is drained. Withhas_start_ordinal == falseonlyend_ordinalis drained (the single-ordinal form). The selected changes are drained through the active ovstage change feed and applied to the running simulation.Ordinals at or below the latest successfully consumed ordinal are skipped. A range containing only consumed ordinals is a successful no-op. An overlapping range applies only its unread suffix. The initial
read_ordinalis consumed by ovphysx_attach_ovstage(), so replaying it does not recreate the attach population or emit object-change notifications. Population authored and sealed at later ordinals is applied normally.- Errors
OVPHYSX_API_INVALID_ARGUMENT for an invalid range or handle
OVPHYSX_API_ERROR if no ovstage is attached or the range drain fails
- Parameters:
handle – ovphysx instance handle.
range – ovstage ordinal range to drain (see ovstage_ordinal_range_t).
- Pre:
handleis valid and ovphysx_attach_ovstage succeeded.- Pre:
when
range.has_start_ordinal,range.start_ordinal <= range.end_ordinal.- Pre:
All selected writes are sealed by a completed write-floor operation covering
range.end_ordinal. Waiting forovstage_population_apply_usd_changes()only completes population. It does not advance the write floor.
-
ovphysx_result_t ovphysx_detach_ovstage(ovphysx_handle_t handle)#
Detach the currently-attached ovstage Stage.
Idempotent: calling on an unattached instance is a no-op success. Clears registered interests and any output-buffer registrations, so a subsequent ovphysx_attach_ovstage() to a different Stage starts clean. After detach, stage-dependent calls such as ovphysx_update_from_ovstage() and ovphysx_step() fail until a Stage is attached again. Detach invalidates the stage’s tensor and contact views. Do not read or write existing bindings. Destroy them and create replacements after attaching and realizing a stage again. If the attached stage has an active OmniPVD recording, detach stops and finalizes it, including when a peer instance started the recording. After reattach, capability-only recording is dormant and can start immediately. Configured startup output instead starts a new startup session owned by the reattaching handle. Stop it before starting a late destination.
- Errors
OVPHYSX_API_ERROR for internal failures
- Parameters:
handle – ovphysx instance handle.
- Pre:
handle is valid.
- Post:
On success, ovphysx is unattached.
- ovphysx_result_t ovphysx_get_attach_handle(
- ovphysx_handle_t instance_handle,
- uint64_t *out_attach_handle,
Get the handle identifying this instance’s current attach.
An attach handle is an attach identity
, not a USD stage id. It is nonzero for every live attach, including an ovstage attach whose source has no backing USD stage, and a fresh handle is minted per attach. A consumer that stores the handle when it binds can therefore distinguish “still the
attach it bound to” from “detached” and from “a different attach that reuses
the same stage id”, none of which a stage id can express. See ADR-0016.
This is the only route by which a handle crosses the C boundary. Contact events report the attach they came from as this same value, so a consumer can match a reported event against the attach it holds.
- Errors
OVPHYSX_API_INVALID_ARGUMENT if out_attach_handle is NULL or instance_handle is invalid
Note
An instance attaches at most once at a time, so a caller that does not need to detect detach/reattach need not track the value at all.
- Parameters:
instance_handle – ovphysx instance handle.
out_attach_handle – [out] Receives the current attach handle, or 0 (no attach) when nothing is attached. Also set to 0 on failure.
- ovphysx_result_t ovphysx_query(
- ovphysx_handle_t handle,
- ovphysx_sim_object_type_t object_type,
- ovphysx_object_scope_t scope,
- ovphysx_query_handle_t *out_query,
Open a query over the simulation’s output objects of one simulated type.
Mirrors the ovstage read idiom: the query is a handle (not a list). The matched prims come back per group at read time as the interned ovstage_read_group_t::prims.list (resolve via ovphysx_query_shared_dictionary or feed straight into the ovstage write path). Discover the produced attributes / total prim count with ovphysx_fetch_query_result. Pair every successful query with ovphysx_release_query.
This read is ovstage-native and only meaningful when an ovstage Stage is attached (ovphysx_attach_ovstage). Under any other attach it returns 0 objects.
- ovphysx_result_t ovphysx_fetch_query_result(
- ovphysx_handle_t handle,
- ovphysx_query_handle_t query,
- ovstage_query_result_t *out_result,
Fetch a query’s discovery summary (attributes + total prim count).
Fills ovstage’s own
ovstage_query_result_t. Itsattributesarray lists the interned attribute tokens the matched objects produce (resolve via ovphysx_query_shared_dictionary, or feed straight back into ovphysx_read asovx_string_or_token_ttokens). The array is owned by the query and valid until ovphysx_release_query.total_prim_count == 0is the empty-match case.- Errors
OVPHYSX_API_INVALID_ARGUMENT if out_result is null
OVPHYSX_API_ERROR for a bad query handle / no ovstage attached
- Parameters:
handle – ovphysx instance handle.
query – Query handle from ovphysx_query.
out_result – [out] Receives the discovery summary.
- Returns:
ovphysx_result_t.
- ovphysx_handle_t handle,
- ovphysx_query_handle_t query,
- void **out_dictionary,
Get the shared ovstage path dictionary backing a query.
This is NOT an ovphysx-owned dictionary. The returned pointer is the attached ovstage source’s own
path_dictionary_instance_t*, the dictionary that interned this query’sprim_listhandles andattributetokens, AND the dictionary the ovstage write path interns into. Because read and write share it, a group’sattributetoken /prim_listhandle can be fed straight back into the ovstage write path with no rebuild and no string round-trip. This accessor is only needed to resolve a token to a human-readable string or to intern a derived name (e.g. renaming output to “sim:<name>”).The pointer is declared in
<ovx/path_dictionary/path_dictionary.h>and surfaced here as an opaquevoid*(that header defines C++-only inline helpers, so it is deliberately not pulled into this C surface). Owned by the runtime. Do not free. Returns NULL for a non-ovstage backend.- Errors
OVPHYSX_API_INVALID_ARGUMENT if out_dictionary is null
OVPHYSX_API_ERROR for a bad query handle / no ovstage attached
- Parameters:
handle – ovphysx instance handle.
query – Query handle from ovphysx_query.
out_dictionary – [out] Receives the opaque dictionary pointer (NULL if none).
- Returns:
ovphysx_result_t.
- ovphysx_result_t ovphysx_read(
- ovphysx_handle_t handle,
- ovphysx_query_handle_t query,
- const ovx_string_or_token_t *attributes,
- size_t attribute_count,
- ovphysx_read_handle_t *out_read,
Read named output attributes for a query into typed column groups.
Opens a read session over
queryfor the requested attributes, each given as anovx_string_or_token_t: a string name (see OVPHYSX_ATTR_*) OR an interned token (e.g. from ovphysx_fetch_query_result, fed straight back with no token-to-string round-trip). Iterate the result with ovphysx_fetch_read_next, release each consumed group with ovphysx_release_group, and release the session with ovphysx_release_read. Names not produced by the queried type are skipped.
- ovphysx_result_t ovphysx_fetch_read_next(
- ovphysx_handle_t handle,
- ovphysx_read_handle_t read,
- const ovstage_read_group_t **out_group,
Fetch the next output column group from a read session.
On success points
*out_groupat the nextovstage_read_group_tand returns OVPHYSX_API_SUCCESS. Returns OVPHYSX_API_END_OF_ITERATION (NOT an error) once all groups have been consumed, with*out_groupset to NULL. Any other status is a real error (*out_groupNULL).The group is producer-owned (the caller does not allocate it): the returned
ovstage_read_group_tpointer is a borrow valid until ovphysx_release_group is called for that group’sread_group_id, or the session is released.Group lifetime (authoritative): the returned group struct and its stage-derived
prims.liststay valid until ovphysx_release_group for thatread_group_id(or ovphysx_release_read, which releases all). The numeric storage is owned by the read session instead:data.tensors, every tensor’s shape and data,prims.index_map,data.index_map,data.mask, anddata.cuda_sync.wait_eventstay valid until ovphysx_release_read. Fetching further groups and an intervening ovphysx_step do NOT invalidate either lifetime (the runtime gathers each column into session-owned storage at read time).A device (
kDLCUDA) column additionally has a readiness contract: it is handed over before its producing work has necessarily completed. Wait ongroup.data.cuda_sync.wait_eventbefore reading it from a non-default stream (ovphysx_cuda_stream_wait_event issues that wait). See ovphysx_read for the full rule. Validity and readiness are separate: the borrow above means the memory may still be read, the event means the values in it are final.END_OF_ITERATION means every group that was produced has been consumed. It does NOT by itself mean the read was complete: a backend build or gather that failed omits its columns and ends the drain with an error status instead, so a caller that needs to distinguish a short answer from the whole one must check for that rather than treat any non-SUCCESS as “done”. Groups already fetched stay valid and must still be released either way.
- Errors
OVPHYSX_API_INVALID_ARGUMENT if out_group is null
OVPHYSX_API_ERROR for a bad read handle
- Parameters:
handle – ovphysx instance handle.
read – Read-session handle from ovphysx_read.
out_group – [out] Receives a borrowed
ovstage_read_group_t*for the next group (NULL at end of iteration or on error).
- Returns:
ovphysx_result_t: SUCCESS (group filled), END_OF_ITERATION (done), else error.
- Pre:
handle and read are valid and out_group is non-null.
- ovphysx_result_t ovphysx_release_group(
- ovphysx_handle_t handle,
- ovphysx_read_handle_t read,
- ovstage_read_group_id_t group_id,
Release one fetched group’s borrowed storage.
Releases the stage-derived prim-list storage pinned by ovphysx_fetch_read_next for
group_id(anovstage_read_group_t::read_group_id). After this the group struct andprims.listmust not be dereferenced. Tensor, prim-index-map, data-index-map, mask, and CUDA-event storage belongs to the read session and remains valid until ovphysx_release_read.- Parameters:
handle – ovphysx instance handle.
read – Read-session handle the group came from.
group_id – The group’s
ovstage_read_group_t::read_group_id.
- Returns:
ovphysx_result_t. Idempotent for an already-released / unknown id.
- ovphysx_result_t ovphysx_release_read(
- ovphysx_handle_t handle,
- ovphysx_read_handle_t read,
Release a read session (and every borrowed group it still owns).
- Parameters:
handle – ovphysx instance handle.
read – Read-session handle from ovphysx_read.
- Returns:
ovphysx_result_t. Idempotent for an already-released / unknown handle.
- ovphysx_result_t ovphysx_write(
- ovphysx_handle_t handle,
- ovphysx_query_handle_t query,
- const ovx_string_or_token_t *attribute,
- ovphysx_write_handle_t *out_write,
Open a write session pushing ONE named attribute into the simulation.
The application-to-physics direction, the mirror of ovphysx_read. It reuses that query verbatim and adds no selection of its own: the session reaches exactly the set
querymatched, and there is no index, mask or prim-list parameter anywhere on this surface.
- ovphysx_result_t ovphysx_fetch_write_next(
- ovphysx_handle_t handle,
- ovphysx_write_handle_t write,
- const ovstage_map_group_t **out_group,
Fetch the next writable group from a write session.
On success points
*out_groupat the nextovstage_map_group_tand returns OVPHYSX_API_SUCCESS. Returns OVPHYSX_API_END_OF_ITERATION (NOT an error) once all groups have been consumed, with*out_groupset to NULL. Any other status is a real error (*out_groupNULL).The group is producer-owned (the caller does not allocate it) and handed back as a
constborrow.constis correct even on the write path: the group is a DESCRIPTOR the caller reads, describing BUFFERS the caller fills throughdata.tensors[i].data, whichconstpermits since it does not propagate through pointer members. No field of the struct is the caller’s to assign, and tensor shape, dtype and device are dictated by the implementation.Group storage stays valid until that group is committed, independent of further fetches. An intervening ovphysx_step does not invalidate a live group.
- Errors
OVPHYSX_API_INVALID_ARGUMENT if out_group is null
OVPHYSX_API_ERROR for a write handle that is not live
- Parameters:
handle – ovphysx instance handle.
write – Write-session handle from ovphysx_write.
out_group – [out] Receives a borrowed
const ovstage_map_group_t*(NULL at end of iteration or on error).
- Returns:
ovphysx_result_t: SUCCESS (group filled), END_OF_ITERATION (done), else error.
- Pre:
handle and write are valid and out_group is non-null.
- ovphysx_result_t ovphysx_commit_group(
- ovphysx_handle_t handle,
- ovphysx_write_handle_t write,
- const ovstage_map_group_t *group,
- ovstage_cuda_sync_t write_done_sync,
Commit a filled group, transferring ownership of its data to physics.
The caller must have filled EVERY mapped entry. There is no fill-mask, so a partially filled group publishes whatever its unfilled entries contain. To write fewer prims, query fewer. After this call the mapped pointers belong to physics. Dereferencing them is undefined behavior rather than a checked error, since a raw
data.tensors[i].dataaccess makes no API call the runtime could reject.
- ovphysx_result_t ovphysx_release_write(
- ovphysx_handle_t handle,
- ovphysx_write_handle_t write,
Release a write session, discarding anything uncommitted.
Every group that was never committed is discarded, not published, which is why this takes no sync token. There is nothing left to order against. A caller that fails or throws mid-fill therefore publishes nothing from the group it was filling, and forgetting to commit is a silent no-op rather than uninitialized data reaching the solver. Committed groups are NOT rolled back.
- Parameters:
handle – ovphysx instance handle.
write – Write-session handle from ovphysx_write.
- Returns:
ovphysx_result_t. Idempotent for an already-released / unknown handle, matching ovphysx_release_read, so teardown is always safe.
- ovphysx_result_t ovphysx_writability(
- ovphysx_sim_object_type_t object_type,
- const ovx_string_or_token_t *attribute,
- ovphysx_writability_t *out_writability,
Ask whether an attribute can be written on an object type, and how.
The programmatic answer to a question that is otherwise only documented in prose, keyed on the SAME (object type, attribute) the write path takes (ovphysx_write resolves the object type through its query and names the attribute). This reports the classification the write API itself uses, derived from the same write and read attribute tables, so a caller and the implementation cannot disagree.
Scene-independent: writability is a property of the write API, not of any live scene, so this needs no instance, query or step. A name the object type does not accept comes back OVPHYSX_WRITABILITY_UNCLASSIFIED, and ovphysx_write rejects it. Such a name is a gap to close, never an invitation to try the write anyway.
- Errors
OVPHYSX_API_INVALID_ARGUMENT if out_writability or attribute is null, if attribute carries no string name (a token-only key), or if object_type is outside ovphysx_sim_object_type_t (so an unknown type is distinguishable from a valid type that does not accept the name, which returns OVPHYSX_WRITABILITY_UNCLASSIFIED)
- Parameters:
object_type – Object type the attribute would be written on (ovphysx_query’s selector), e.g. OVPHYSX_OBJECT_RIGID_BODY.
attribute – Attribute name (see the OVPHYSX_ATTR_* macros), as the string field of an
ovx_string_or_token_t. STRING-ONLY: an interned-token-only key is rejected, because resolving a token needs a path dictionary this scene-free query does not have.out_writability – [out] Receives the classification.
- Returns:
ovphysx_result_t.
- ovphysx_result_t ovphysx_release_query(
- ovphysx_handle_t handle,
- ovphysx_query_handle_t query,
Release an output query.
- Parameters:
handle – ovphysx instance handle.
query – Query handle from ovphysx_query.
- Returns:
ovphysx_result_t. Idempotent for an already-released / unknown handle.
- ovphysx_result_t ovphysx_cuda_stream_wait_event(
- uintptr_t stream,
- uintptr_t event,
Order
streamafterevent, so work queued on it observes a finished column.The readiness contract on a device (
kDLCUDA) read column says a consumer using its own stream must wait ongroup.data.cuda_sync.wait_eventbefore reading (see ovphysx_read). This is that singlecuStreamWaitEvent, routed through the CUDA driver shim ovphysx already loads, so honouring the contract costs the consumer no direct CUDA dependency.Asynchronous: it enqueues the dependency and returns. It does not synchronize the host, and it does not block
streamagainst anything except work precedingevent.Note
The event belongs to the read session and stays valid until the session is released. This call does not take ownership of either argument.
Note
Context. The call is issued in whatever CUDA context is current on the calling thread. ovphysx’s own context is deliberately not pushed. The sentinels 1 and 2 are context-relative, so they resolve against the consumer’s context, the one that queued the work being ordered. An explicit
CUstreamhandle carries its own context and is unaffected. Callers on a non-current context should pass one rather than a sentinel.- Parameters:
stream – CUDA stream to order, as
uintptr_t. Follows the CUDA driver’s stream handles, which coincide with the DLPack sentinels: 0 is the NULL stream, 1 is the legacy default stream, 2 is the per-thread default stream, and any other value is aCUstream.event – CUDA event to wait on, as
uintptr_t, normally a group’scuda_sync.wait_event. 0 is a no-op success: a column with no producer work to await is already readable, and callers do not have to special-case it.
- Returns:
OVPHYSX_API_SUCCESS once the wait is enqueued (or was not needed). OVPHYSX_API_ERROR if CUDA is unavailable in this process or the driver rejected the call. Use ovphysx_get_last_error for details. A CPU-only process never reaches CUDA through this entry point unless it passes a non-zero
event.
- ovphysx_enqueue_result_t ovphysx_clone(
- ovphysx_handle_t handle,
- ovphysx_string_t source_path_in_usd,
- ovphysx_string_t *target_paths,
- uint32_t num_target_paths,
- const float *anchor_transforms,
- const uint32_t *env_ids,
Clone the subtree under the source path to one or more target paths in the internal physics representation (USD untouched).
The source path must exist in the stage. The target paths must not already exist in the stage.
Clones are created in the internal representation only (the USD file is not modified) and immediately participate in physics simulation. Backed by the PhysX SDK replicator, so cloned articulations are real articulations. Optimized for RL mass replication (1000s of instances). This is the clone entrypoint for both standalone callers and callers using an ovstage Stage (ovphysx_attach_ovstage).
#include <ovphysx/ovphysx.h> static ovphysx_enqueue_result_t clone_two_environments(ovphysx_handle_t handle) { ovphysx_string_t targets[2] = { ovphysx_cstr("/World/env1"), ovphysx_cstr("/World/env2"), }; return ovphysx_clone( handle, ovphysx_cstr("/World/env0"), targets, 2, NULL, NULL); } // To assemble one environment from several calls (heterogeneous ClonePlan), pass the same // env_ids in each call so its objects share a runtime environment.
- Side Effects
Adds live PhysX objects keyed by each target path. No USD or runtime-stage prims are authored.
- Ownership
The target_paths array is read during the call. The caller retains ownership.
- Errors
OVPHYSX_API_INVALID_ARGUMENT for invalid or duplicate targets, or a call after warmup / the first step
OVPHYSX_API_ERROR if no ovstage is attached or the clone fails
Note
Cross-environment collision isolation uses PhysX environment ids under GPU dynamics + GPU broadphase, controlled by
/ovphysx/clone/useEnvIds(default on, per-process). The source holds env id 0 and clones get 1..N, so co-located clones (NULL anchor_transforms) are isolated from the source too. Environment ids do not isolate clones in CPU mode: co-located CPU clones share one collision space, so use spatially disjoint anchor_transforms. The runtime emits a warning through the Carbonite log stream when env ids are requested but GPU dynamics or GPU broadphase is unavailable. Register ovphysx_set_log_callback() to receive it programmatically. USD collision groups/filtering authored before cloning still work for finer control. Passenv_idswhen one logical environment is assembled from several clone calls, so its objects share an id.Note
Replication executes inline. On success, the returned operation index is already complete. ovphysx_wait_op() remains valid and returns immediately.
- Parameters:
handle – PhysX instance handle
source_path_in_usd – Path to the source subtree to clone (must exist)
target_paths – Array of target paths to clone to (must not exist)
num_target_paths – Number of target paths to clone to
anchor_transforms – Absolute world pose of each target subtree root. Entry i anchors the exact subtree at target_paths[i]. Flat [num_target_paths x 7] floats: (px, py, pz, qx, qy, qz, qw), quaternion imaginary-first (OVPHYSX_TENSOR_RIGID_BODY_POSE_F32, identity = (0,0,0,1)). Descendants keep their poses relative to the source subtree root (target_object_world = anchor_transforms[i] * inverse(source_root_world) * source_object_world). Pass NULL to co-locate every copy on the source. Co-location is collision-isolated only under GPU dynamics + GPU broadphase. Use spatially disjoint transforms in CPU mode.
env_ids – Optional logical environment id per target ([num_target_paths] uint32). Stable across calls: a shared id maps to one runtime environment (clones sharing it collide, isolated from others). Ids must be < 0x00FFFFFF (runtime id is env_ids[i] + 1). Pass NULL for automatic per-call numbering.
- Returns:
ovphysx_enqueue_result_t with status and operation index for the clone. On failure, call ovphysx_get_last_error() on the same thread for the error message.
- Pre:
handle must be valid.
- Pre:
source_path_in_usd must exist and target_paths must be valid and unique.
- Pre:
Must be called before ovphysx_warmup() or the first simulation step. Multiple ovphysx_clone() calls per attach are allowed in CPU and GPU mode while all of them precede warmup / first step. To clone after that point, use ovphysx_reset_stage() and reattach the source stage first. On GPU, cloning later would reallocate DirectGPU buffers and corrupt initialized state.
- Post:
Cloned physics objects are live when this call returns successfully.
- ovphysx_enqueue_result_t ovphysx_step(
- ovphysx_handle_t handle,
- float step_dt,
- ovphysx_result_t ovphysx_step_sync(
- ovphysx_handle_t handle,
- float step_dt,
Synchronous step: simulate one physics timestep and wait for completion in a single call.
Functionally equivalent to ovphysx_step() followed by ovphysx_wait_op() on the returned operation index, but bypasses the async event machinery entirely (mutex acquisitions, operation map insert/lookup/cleanup). In IsaacLab RL training at 4096 environments this saves about 0.2 ms per substep compared to step() + wait_op(), roughly 5-6% of total throughput.
Use this whenever the caller steps and immediately waits for results, that is, does not overlap GPU simulation with CPU work between dispatch and fetch.
The simulation time is tracked internally. Each step advances it by step_dt.
- Parameters:
handle – Physics instance handle.
step_dt – Timestep [s].
- Returns:
ovphysx_result_t with OVPHYSX_API_SUCCESS on success.
- ovphysx_result_t ovphysx_step_n_sync(
- ovphysx_handle_t handle,
- int32_t n_steps,
- float step_dt,
Run n_steps consecutive physics steps in a single C call.
Step i is executed with duration step_dt at the internally-tracked simulation time + i * step_dt. This saves (n_steps-1) ctypes round-trips for workloads that use decimation (one RL step = multiple physics steps). The internal counter advances by n_steps * step_dt.
- Parameters:
handle – Physics instance handle.
n_steps – Number of steps to run (must be > 0).
step_dt – Duration of each step [s].
- Returns:
ovphysx_result_t with OVPHYSX_API_SUCCESS on success.
- ovphysx_result_t ovphysx_update_articulations_kinematic(
- ovphysx_handle_t handle,
Recompute articulation link transforms from the current articulation generalized coordinates without running a normal simulation step.
This is a synchronous kinematic forward-kinematics update. It is useful after writing articulation DOF positions (through the session write API, ovphysx_write, or the deprecated tensor bindings) and before reading link pose tensors in the same frame.
NOTE: On the first GPU kinematic update after loading USD, an automatic warmup simulation step may be performed to initialize PhysX structures. See tensor auto-warmup note.
Once GPU warmup is complete, the FK refresh itself does not run collision detection, integration, solver work, or contact generation.
- Parameters:
handle – Physics instance handle.
- Returns:
ovphysx_result_t with OVPHYSX_API_SUCCESS on success.
- ovphysx_result_t ovphysx_create_tensor_binding(
- ovphysx_handle_t handle,
- const ovphysx_tensor_binding_desc_t *desc,
- ovphysx_tensor_binding_handle_t *out_binding_handle,
Create a tensor binding for bulk data access (synchronous).
A tensor binding connects a physics-object path pattern (e.g., “/World/robot*”) to a tensor type (e.g., OVPHYSX_TENSOR_RIGID_BODY_POSE_F32), enabling efficient bulk read/write of physics data for all matching objects. Runtime-only clone paths are eligible even when no USD prim is authored at the path.
If the pattern matches zero physics objects, the binding is still created successfully with element_count = 0. This lets callers treat optional scene content as an empty current result instead of an error. Empty bindings do not update when matching physics objects are added or recreated. Destroy the old binding and create a new one after topology changes.
Binding lifetime is tied to the currently realized physics objects. The application owns the stage lifecycle: if it will call ovphysx_reset_stage(), remove USD data containing bound objects, or otherwise replace/reparse the stage so those objects are destroyed and recreated, cached bindings should be destroyed before the lifecycle operation when practical. If a stale binding survives, only destroy it. Do not read or write through it. Create replacement bindings after the operation completes. ovphysx_step(), ovphysx_step_sync(), and ovphysx_step_n_sync() do not invalidate bindings.
#include <ovphysx/ovphysx.h> static ovphysx_result_t create_pose_binding( ovphysx_handle_t handle, ovphysx_tensor_binding_handle_t* out_binding) { ovphysx_tensor_binding_desc_t desc = { .pattern = OVPHYSX_LITERAL("/World/robot*"), .tensor_type = OVPHYSX_TENSOR_RIGID_BODY_POSE_F32, }; return ovphysx_create_tensor_binding(handle, &desc, out_binding); }
- Diagnostics
Pattern bindings quiet expected TensorAPI no-match diagnostics on the simulation view used to create that binding. Explicit prim_paths keep the default error-level no-match diagnostics for typo detection. For programmatic partial-miss checks with explicit prim_paths, compare the requested paths with ovphysx_tensor_binding_get_prim_paths().
- Threading
Do not create bindings concurrently with stage mutation.
- Side Effects
Allocates internal binding resources.
- Errors
OVPHYSX_API_INVALID_ARGUMENT for invalid inputs
OVPHYSX_API_ERROR for internal failures
- Deprecated:
The tensor-binding API is deprecated. Use ovphysx_read (reads) and ovphysx_write (writes) instead.
- Parameters:
handle – Instance handle
desc – Binding descriptor with pattern and tensor_type
out_binding_handle – [out] Binding handle on success
- Returns:
ovphysx_result_t (synchronous - completes before returning)
- Pre:
handle, desc, and out_binding_handle must be valid.
- Post:
Binding handle owns native resources until explicitly destroyed via ovphysx_destroy_tensor_binding(), or until the parent instance is destroyed. Stage reset or bound-object removal invalidates the underlying TensorAPI view. Destroy stale bindings and create replacements after the lifecycle operation completes.
- ovphysx_result_t ovphysx_destroy_tensor_binding(
- ovphysx_handle_t handle,
- ovphysx_tensor_binding_handle_t binding_handle,
Destroy a tensor binding and release associated resources (synchronous).
#include <ovphysx/ovphysx.h> static ovphysx_result_t destroy_binding( ovphysx_handle_t handle, ovphysx_tensor_binding_handle_t binding) { return ovphysx_destroy_tensor_binding(handle, binding); }
- Side Effects
Releases internal resources.
- Errors
OVPHYSX_API_NOT_FOUND if binding handle is unknown
OVPHYSX_API_ERROR for internal failures
- Deprecated:
The tensor-binding API is deprecated. Use ovphysx_read (reads) and ovphysx_write (writes) instead.
- Parameters:
handle – Instance handle
binding_handle – Binding to destroy
- Returns:
ovphysx_result_t
- Pre:
handle and binding_handle must be valid.
- Post:
Binding handle is invalid after call.
- ovphysx_result_t ovphysx_get_tensor_binding_spec(
- ovphysx_handle_t handle,
- ovphysx_tensor_binding_handle_t binding_handle,
- ovphysx_tensor_spec_t *out_spec,
Get the tensor layout specification for a binding.
Returns dtype, ndim, and shape needed to allocate a compatible DLTensor. This is the preferred API for constructing DLTensors correctly.
NOTE: ovphysx_tensor_spec_t stores shape in a fixed-size int64[4] for a stable C ABI. Only the first ndim entries are meaningful. The remaining entries are always set to 0.
See ovphysx_tensor_type_t documentation for shapes, dtype, and layouts per tensor type. Layout is always row-major contiguous (C-order). Most bindings are float32. OVPHYSX_TENSOR_DEFORMABLE_SIM_ELEMENT_INDICES_S32 is int32.
#include <ovphysx/ovphysx.h> static ovphysx_result_t query_binding_spec( ovphysx_handle_t handle, ovphysx_tensor_binding_handle_t binding, ovphysx_tensor_spec_t* out_spec) { return ovphysx_get_tensor_binding_spec(handle, binding, out_spec); }
- Side Effects
None.
- Errors
OVPHYSX_API_NOT_FOUND if binding handle is unknown
OVPHYSX_API_ERROR for internal failures
- Deprecated:
The tensor-binding API is deprecated. Use ovphysx_read (reads) and ovphysx_write (writes) instead.
Note
The returned specification does not include memory residency. Call ovphysx_get_tensor_binding_native_device() to query the binding’s native device.
- Parameters:
handle – Instance handle
binding_handle – Tensor binding
out_spec – [out] Tensor dtype, rank, and shape
- Returns:
ovphysx_result_t
- Pre:
handle, binding_handle, and out_spec must be valid.
- Post:
out_spec is populated with dtype/shape for the binding.
- ovphysx_result_t ovphysx_get_tensor_binding_native_device(
- ovphysx_handle_t handle,
- ovphysx_tensor_binding_handle_t binding_handle,
- DLDevice *out_device,
Get the native device used by a tensor binding.
Returns the device used by the binding’s native TensorAPI read/write path:
DLDevice{kDLCPU, 0}for host-resident bindings, orDLDevice{kDLCUDA, device_ordinal}for CUDA-resident bindings. CPU-only property tensors report CPU even when the simulation runs on CUDA. For kDLCUDA, device_id is the process-visible CUDA runtime ordinal used with cudaSetDevice() or a framework device such ascuda:N, not a physical PCI bus index.This reports native residency, not every device accepted by read/write. Using the native device avoids staging when another accepted placement would require it. The value remains stable for the lifetime of a live binding. Unlike the layout-only spec getter, this is a live mapping query and rejects an invalidated simulation view.
#include <ovphysx/ovphysx.h> static ovphysx_result_t query_binding_device( ovphysx_handle_t handle, ovphysx_tensor_binding_handle_t binding, DLDevice* out_device) { return ovphysx_get_tensor_binding_native_device(handle, binding, out_device); }
- Side Effects
None.
- Synchronization
Waits for pending operations on the instance before inspecting the binding.
- Errors
OVPHYSX_API_INVALID_ARGUMENT if out_device is NULL
OVPHYSX_API_NOT_FOUND if binding_handle is unknown or stale
OVPHYSX_API_ERROR if handle is invalid
- Deprecated:
The tensor-binding API is deprecated. Use ovphysx_read / ovphysx_write instead.
- Parameters:
handle – Instance handle
binding_handle – Tensor binding
out_device – [out] Native DLPack device for the binding
- Returns:
ovphysx_result_t
- Pre:
handle, binding_handle, and out_device must be valid.
- Post:
out_device is populated with the binding’s native device.
- ovphysx_result_t ovphysx_read_tensor_binding(
- ovphysx_handle_t handle,
- ovphysx_tensor_binding_handle_t binding_handle,
- DLTensor *dst_tensor,
The warmup is a real physics step that advances simulation time by a minimal timestep (~1ns). Physics state may change infinitesimally. This is not a dry run.
- Tensor auto-warmup note
The first tensor read or write after loading USD may perform an automatic warmup simulation step to initialize PhysX lazy structures. In GPU mode this also initializes DirectGPU buffers.
For deterministic behavior, explicitly control warmup timing by loading USD, waiting for completion, then calling ovphysx_warmup() before the first tensor read or write. To have the first observed state change happen under a chosen timestep instead, call ovphysx_step() explicitly with that dt.
Because warmup is a real simulation step, a true “pre-warmup” tensor state cannot be observed. Calling ovphysx_warmup() explicitly only makes the timing of that unavoidable step predictable. Read data from simulation into a user-provided DLTensor (synchronous).
NOTE: On the first tensor read after loading USD, an automatic warmup simulation step may be performed. See tensor auto-warmup note.
DLTensor requirements:
MUST be pre-allocated with correct shape (use ovphysx_get_tensor_binding_spec())
dtype must match ovphysx_get_tensor_binding_spec()
when CUDA is available, CPU/CUDA mismatches are staged for binding types whose storage follows the simulation device
CPU-only property bindings require a host-resident kDLCPU or kDLCUDAHost destination. kDLCUDA and kDLCUDAManaged destinations return OVPHYSX_API_DEVICE_MISMATCH and are not staged
cross-GPU ordinal mismatches and CUDA tensors in process-wide CPU-only mode return OVPHYSX_API_DEVICE_MISMATCH
layout must be contiguous row-major (C-order)
This is a blocking call that completes before returning.
#include <ovphysx/ovphysx.h> static ovphysx_result_t read_binding( ovphysx_handle_t handle, ovphysx_tensor_binding_handle_t binding, DLTensor* destination) { return ovphysx_read_tensor_binding(handle, binding, destination); }
- Side Effects
May trigger warmup on first read.
- Ownership
Caller owns dst_tensor memory.
- Errors
OVPHYSX_API_DEVICE_MISMATCH if tensor device is incompatible
OVPHYSX_API_INVALID_ARGUMENT for invalid inputs
OVPHYSX_API_NOT_FOUND if the binding is unknown or was invalidated by a stage change
OVPHYSX_API_ERROR for internal failures
- Deprecated:
The tensor-binding API is deprecated. Use ovphysx_read instead.
- Parameters:
handle – Instance handle
binding_handle – Tensor binding
dst_tensor – Pre-allocated DLTensor with shape from ovphysx_get_tensor_binding_spec()
- Returns:
ovphysx_result_t
- Pre:
handle and binding_handle must be valid.
- Pre:
dst_tensor must be pre-allocated, match the spec’s dtype/shape, and use a supported device.
- Post:
dst_tensor is filled with simulation data on success.
-
ovphysx_result_t ovphysx_warmup(ovphysx_handle_t handle)#
Explicitly run the warmup step (optional, synchronous).
On first use, a real simulation step with a minimal timestep (~1ns) is run to initialize PhysX structures and disable per-step Fabric sync overhead. This is normally done automatically on the first tensor read (auto-warmup), but calling it explicitly controls when the latency occurs.
Works in both CPU and GPU mode. In GPU mode, this also populates DirectGPU buffers.
IMPORTANT: The warmup advances simulation state (positions may change infinitesimally). It is NOT a “dry run”. For deterministic initial conditions, call this before reading initial tensor state.
This function is idempotent. Calling it multiple times has no effect after the first successful call (per stage). Warmup state resets when the stage changes (e.g., after reset() or loading a new USD file).
#include <ovphysx/ovphysx.h> static ovphysx_result_t warm_up_instance(ovphysx_handle_t handle) { return ovphysx_warmup(handle); }
- Side Effects
Advances simulation by a minimal timestep on first call. Disables per-step Fabric sync (enabling direct TensorAPI mode).
- Errors
OVPHYSX_API_ERROR for internal failures
- Parameters:
handle – Instance handle
- Returns:
ovphysx_result_t
- Pre:
handle must be valid.
- Post:
Warmup completed for the active stage.
- ovphysx_result_t ovphysx_write_tensor_binding(
- ovphysx_handle_t handle,
- ovphysx_tensor_binding_handle_t binding_handle,
- const DLTensor *src_tensor,
- const DLTensor *index_tensor,
Write data from a user-provided DLTensor into the simulation (synchronous).
Not all tensor types are writable:
RIGID_BODY_FORCE_F32, RIGID_BODY_WRENCH_F32, ARTICULATION_LINK_WRENCH_F32 are WRITE-ONLY (external control inputs applied each step, so reading them returns an error).
RIGID_BODY_ACCELERATION_F32, RIGID_BODY_INV_MASS_F32, RIGID_BODY_INV_INERTIA_F32 are READ-ONLY.
ARTICULATION_LINK_POSE_F32, ARTICULATION_LINK_VELOCITY_F32, ARTICULATION_LINK_ACCELERATION_F32 are READ-ONLY (no setter for individual link state).
Inverse dynamics query tensors (JACOBIAN, MASS_MATRIX, CORIOLIS_AND_CENTRIFUGAL_FORCE, GRAVITY_FORCE, LINK_INCOMING_JOINT_FORCE, DOF_PROJECTED_JOINT_FORCE, BODY_INV_MASS, BODY_INV_INERTIA) are READ-ONLY.
DEFORMABLE_REST_NODAL_POSITION_F32 and DEFORMABLE_SIM_ELEMENT_INDICES_S32 are READ-ONLY.
DOF_ACTUATION_FORCE_F32 is read-write (not write-only). See ovphysx_tensor_type_t documentation for shapes, layouts, and read/write semantics.
NOTE: On the first tensor write after loading USD, an automatic warmup simulation step may be performed to initialize PhysX structures. See tensor auto-warmup note.
This is a blocking call that completes before returning.
#include <ovphysx/ovphysx.h> static ovphysx_result_t write_binding( ovphysx_handle_t handle, ovphysx_tensor_binding_handle_t binding, const DLTensor* source) { return ovphysx_write_tensor_binding(handle, binding, source, NULL); }
- Side Effects
Writes control or state data into the simulation.
- Ownership
Caller owns src_tensor and index_tensor memory.
- Errors
OVPHYSX_API_DEVICE_MISMATCH if tensor device is incompatible
OVPHYSX_API_INVALID_ARGUMENT for invalid inputs
OVPHYSX_API_NOT_FOUND if the binding is unknown or was invalidated by a stage change
OVPHYSX_API_ERROR for internal failures
- Deprecated:
The tensor-binding API is deprecated. Use ovphysx_write instead.
- Parameters:
handle – Instance handle
binding_handle – Tensor binding
src_tensor – User tensor with data to write (must match ovphysx_get_tensor_binding_spec())
index_tensor – Optional int32[K] indices for subset write. NULL = write all.
When index_tensor != NULL: src_tensor must still have full shape [N, …] matching the binding spec. Only the rows specified by index_tensor are written. Other rows in src_tensor are ignored.
Indices are 0-based into the first dimension N of the binding, and must satisfy 0 <= idx < N.
K (index count) must satisfy K <= N.
- Returns:
ovphysx_result_t
- Pre:
handle and binding_handle must be valid.
- Pre:
src_tensor must match the spec’s dtype/shape and use a supported device. When CUDA is available, CPU/CUDA mismatches are staged for binding types whose storage follows the simulation device.
- Pre:
For CPU-only property bindings, src_tensor and any index_tensor must use kDLCPU or kDLCUDAHost. Otherwise-valid kDLCUDA and kDLCUDAManaged tensors return OVPHYSX_API_DEVICE_MISMATCH and are not staged.
- Pre:
Cross-GPU ordinal mismatches and CUDA tensors in process-wide CPU-only mode return OVPHYSX_API_DEVICE_MISMATCH.
- Post:
Simulation state is updated with new values.
- ovphysx_result_t ovphysx_write_tensor_binding_masked(
- ovphysx_handle_t handle,
- ovphysx_tensor_binding_handle_t binding_handle,
- const DLTensor *src_tensor,
- const DLTensor *mask_tensor,
Write data from a user-provided DLTensor into the simulation using a binary mask (synchronous).
Only elements where mask[i] != 0 are written. Other elements are left unchanged. This is the mask-based alternative to indexed writes via ovphysx_write_tensor_binding.
NOTE: On the first tensor write after loading USD, an automatic warmup simulation step may be performed to initialize PhysX structures. See tensor auto-warmup note.
This is a blocking call that completes before returning.
#include <ovphysx/ovphysx.h> static ovphysx_result_t write_masked_binding( ovphysx_handle_t handle, ovphysx_tensor_binding_handle_t binding, const DLTensor* source, const DLTensor* mask) { return ovphysx_write_tensor_binding_masked( handle, binding, source, mask); }
- Side Effects
Writes control or state data into the simulation for selected elements.
- Ownership
Caller owns src_tensor and mask_tensor memory.
- Errors
OVPHYSX_API_DEVICE_MISMATCH if tensor device is incompatible
OVPHYSX_API_INVALID_ARGUMENT for invalid inputs
OVPHYSX_API_NOT_FOUND if the binding is unknown or was invalidated by a stage change
OVPHYSX_API_ERROR for internal failures
- Deprecated:
The tensor-binding API is deprecated. Use ovphysx_write instead.
Note
There is intentionally no corresponding read_masked function. Reads always return the full [N,…] tensor via ovphysx_read_tensor_binding(). Callers that need a subset can index the result on the host/device side. This write-only mask design matches other reinforcement-learning physics APIs (e.g. Newton’s selectionAPI) where masks are used to selectively apply actions but observations are always returned in full.
- Parameters:
handle – Instance handle
binding_handle – Tensor binding
src_tensor – User tensor with data to write. Must be full shape [N, …] matching the dtype and shape from ovphysx_get_tensor_binding_spec().
mask_tensor – Binary mask selecting which elements to update. Must be 1D with shape [N] where N matches the binding’s first dimension. Dtype must be bool (kDLBool, bits=8) or uint8 (kDLUInt, bits=8).
- Returns:
ovphysx_result_t
- Pre:
handle and binding_handle must be valid.
- Pre:
src_tensor must match the dtype/shape of the binding spec and use a supported device.
- Pre:
mask_tensor must be 1D uint8/bool with length N on a supported device. When CUDA is available, CPU/CUDA mismatches are staged for binding types whose storage follows the simulation device.
- Pre:
For CPU-only property bindings, src_tensor and mask_tensor must use kDLCPU or kDLCUDAHost. Otherwise-valid kDLCUDA and kDLCUDAManaged tensors return OVPHYSX_API_DEVICE_MISMATCH and are not staged.
- Pre:
Cross-GPU ordinal mismatches and CUDA tensors in process-wide CPU-only mode return OVPHYSX_API_DEVICE_MISMATCH.
- Post:
Simulation state is updated for masked elements only.
- ovphysx_result_t ovphysx_get_articulation_metadata(
- ovphysx_handle_t handle,
- ovphysx_tensor_binding_handle_t binding_handle,
- ovphysx_articulation_metadata_t *out_metadata,
Get all scalar topology metadata for an articulation binding in one call.
Fills out_metadata with dof_count, body_count, joint_count, fixed_tendon_count, spatial_tendon_count, and is_fixed_base. All values are stable for the binding lifetime, so the result can be cached.
Homogeneous topology requirement: all articulations covered by this binding must have the same topology (same dof_count, body_count, joint_count, etc.). This is a constraint of the native tensor backend, whose tensor shapes are fixed at binding creation time. Articulations of different sizes (e.g. a 7-DOF arm and a 30-DOF humanoid) need a separate binding each.
For name arrays (DOF names, body names, joint names) use the corresponding ovphysx_articulation_get_*_names functions.
#include <ovphysx/ovphysx.h> #include <stdio.h> static ovphysx_result_t print_articulation_size( ovphysx_handle_t handle, ovphysx_tensor_binding_handle_t binding) { ovphysx_articulation_metadata_t metadata = {0}; ovphysx_result_t result = ovphysx_get_articulation_metadata(handle, binding, &metadata); if (result.status == OVPHYSX_API_SUCCESS) printf("DOFs: %d Links: %d\n", metadata.dof_count, metadata.body_count); return result; }
- Deprecated:
Part of the tensor-binding surface. It requires a binding handle and is removed with the binding. No non-binding successor exists yet: a read-API topology/names path is a removal-blocker, so use this only to maintain existing code.
- Parameters:
handle – Instance handle
binding_handle – Tensor binding (must be an articulation binding)
out_metadata – [out] Caller-allocated struct to fill
- Returns:
ovphysx_result_t
- ovphysx_result_t ovphysx_articulation_get_dof_names(
- ovphysx_handle_t handle,
- ovphysx_tensor_binding_handle_t binding_handle,
- ovphysx_string_t *out_names,
- uint32_t max_names,
- uint32_t *out_count,
Get DOF names for the articulation.
String pointers remain valid until the binding is destroyed.
- Deprecated:
Binding-coupled (requires a tensor-binding handle) and removed with the tensor binding. No non-binding successor yet. See ovphysx_get_articulation_metadata.
- Parameters:
handle – Instance handle
binding_handle – Tensor binding (must be an articulation binding)
out_names – [out] Array of ovphysx_string_t to fill
max_names – Capacity of out_names array. Set to metadata.dof_count (from ovphysx_get_articulation_metadata()) to receive all names.
out_count – [out] Actual number of names written
- Returns:
ovphysx_result_t
- ovphysx_result_t ovphysx_articulation_get_body_names(
- ovphysx_handle_t handle,
- ovphysx_tensor_binding_handle_t binding_handle,
- ovphysx_string_t *out_names,
- uint32_t max_names,
- uint32_t *out_count,
Get body (link) names for the articulation.
String pointers remain valid until the binding is destroyed.
- Deprecated:
Binding-coupled (requires a tensor-binding handle) and removed with the tensor binding. No non-binding successor yet. See ovphysx_get_articulation_metadata.
- Parameters:
handle – Instance handle
binding_handle – Tensor binding (must be an articulation binding)
out_names – [out] Array of ovphysx_string_t to fill
max_names – Capacity of out_names array. Set to metadata.body_count (from ovphysx_get_articulation_metadata()) to receive all names.
out_count – [out] Actual number of names written
- Returns:
ovphysx_result_t
- ovphysx_result_t ovphysx_articulation_get_joint_names(
- ovphysx_handle_t handle,
- ovphysx_tensor_binding_handle_t binding_handle,
- ovphysx_string_t *out_names,
- uint32_t max_names,
- uint32_t *out_count,
Get joint names for the articulation.
String pointers remain valid until the binding is destroyed.
- Deprecated:
Binding-coupled (requires a tensor-binding handle) and removed with the tensor binding. No non-binding successor yet. See ovphysx_get_articulation_metadata.
- Parameters:
handle – Instance handle
binding_handle – Tensor binding (must be an articulation binding)
out_names – [out] Array of ovphysx_string_t to fill
max_names – Capacity of out_names array. Set to metadata.joint_count (from ovphysx_get_articulation_metadata()) to receive all names.
out_count – [out] Actual number of names written
- Returns:
ovphysx_result_t
- ovphysx_result_t ovphysx_tensor_binding_get_prim_paths(
- ovphysx_handle_t handle,
- ovphysx_tensor_binding_handle_t binding_handle,
- ovphysx_string_t *out_paths,
- uint32_t max_paths,
- uint32_t *out_count,
Get resolved physics-object paths for a tensor binding.
The returned array order matches row order for every
RIGID_BODY_*tensor read/write on the same binding. ForARTICULATION_*tensor bindings, the returned paths are articulation root object paths in the binding’s first-dimension row order. ovphysx owns the returned string storage. String pointers remain valid until the binding is destroyed.- Deprecated:
The tensor-binding API is deprecated. Use ovphysx_read (reads) and ovphysx_write (writes) instead.
- Parameters:
handle – Instance handle
binding_handle – Tensor binding
out_paths – [out] Array of ovphysx_string_t to fill
max_paths – Capacity of out_paths array. Must be at least the binding count to receive all paths.
out_count – [out] Actual number of paths written
- Returns:
ovphysx_result_t
- ovphysx_result_t ovphysx_create_contact_binding(
- ovphysx_handle_t handle,
- const ovphysx_string_t *sensor_patterns,
- uint32_t sensor_patterns_count,
- const ovphysx_string_t *filter_patterns,
- uint32_t filters_per_sensor,
- uint32_t max_contact_data_count,
- ovphysx_contact_binding_handle_t *out_handle,
Create a contact binding for reading net contact forces and force matrices.
#include <ovphysx/ovphysx.h> static ovphysx_result_t create_filtered_contact_binding( ovphysx_handle_t handle, ovphysx_contact_binding_handle_t* out_binding) { ovphysx_string_t sensors[] = { ovphysx_cstr("/World/robot_0/ee"), }; ovphysx_string_t filters[] = { ovphysx_cstr("/World/obstacles/box"), }; return ovphysx_create_contact_binding( handle, sensors, 1, filters, 1, 256, out_binding); }
- Parameters:
handle – Instance handle
sensor_patterns – Array of physics-object path patterns matching sensor bodies. A single path component longer than 4096 characters (here or in filter_patterns) is rejected with OVPHYSX_API_INVALID_ARGUMENT.
sensor_patterns_count – Number of sensor patterns
filter_patterns – Flat array of filter object-path patterns. All sensors must have the same number of filters. Total length = sensor_patterns_count * filters_per_sensor. Pass NULL with filters_per_sensor=0 for unfiltered contacts.
filters_per_sensor – Number of filter patterns per sensor (same for all sensors)
max_contact_data_count – Max detailed contact/friction entries to track. Set this to a positive value before using ovphysx_read_contact_data() or ovphysx_read_friction_data(). Detailed reads also require filters_per_sensor > 0. Aggregate net-force reads do not need detailed contact capacity or filters.
out_handle – [out] Contact binding handle
- Returns:
ovphysx_result_t
- Post:
Binding handle is valid until explicitly destroyed via ovphysx_destroy_contact_binding(), or until the parent instance is destroyed.
- ovphysx_result_t ovphysx_destroy_contact_binding(
- ovphysx_handle_t handle,
- ovphysx_contact_binding_handle_t contact_handle,
Destroy a contact binding.
- Parameters:
handle – Instance handle
contact_handle – Contact binding to destroy
- Returns:
ovphysx_result_t
- ovphysx_result_t ovphysx_get_contact_binding_spec(
- ovphysx_handle_t handle,
- ovphysx_contact_binding_handle_t contact_handle,
- int32_t *out_sensor_count,
- int32_t *out_filter_count,
Query contact view dimensions.
- Parameters:
handle – Instance handle
contact_handle – Contact binding
out_sensor_count – [out] Number of sensor bodies matched
out_filter_count – [out] Number of filter bodies per sensor
- Returns:
ovphysx_result_t
- ovphysx_result_t ovphysx_contact_binding_get_sensor_paths(
- ovphysx_handle_t handle,
- ovphysx_contact_binding_handle_t contact_handle,
- ovphysx_string_t *out_paths,
- uint32_t max_paths,
- uint32_t *out_count,
Get resolved sensor physics-object paths for a contact binding.
The returned array order matches row order for contact binding reads. ovphysx owns the returned string storage. String pointers remain valid until the binding is destroyed.
- Parameters:
handle – Instance handle
contact_handle – Contact binding
out_paths – [out] Array of ovphysx_string_t to fill
max_paths – Capacity of out_paths array. Must be at least sensor_count to receive all sensor paths.
out_count – [out] Actual number of paths written
- Returns:
ovphysx_result_t
- ovphysx_result_t ovphysx_contact_binding_get_filter_paths(
- ovphysx_handle_t handle,
- ovphysx_contact_binding_handle_t contact_handle,
- ovphysx_string_t *out_paths,
- uint32_t max_paths,
- uint32_t *out_count,
Get resolved filter physics-object paths for a contact binding.
Paths are returned in row-major
[sensor, filter]order with total countsensor_count * filter_count. ovphysx owns the returned string storage. String pointers remain valid until the binding is destroyed.- Parameters:
handle – Instance handle
contact_handle – Contact binding
out_paths – [out] Array of ovphysx_string_t to fill
max_paths – Capacity of out_paths array. Must be at least sensor_count * filter_count to receive all filter paths.
out_count – [out] Actual number of paths written
- Returns:
ovphysx_result_t
- ovphysx_result_t ovphysx_get_contact_binding_capacity(
- ovphysx_handle_t handle,
- ovphysx_contact_binding_handle_t contact_handle,
- uint32_t *out_max_contact_data_count,
Query detailed contact/friction flat-buffer capacity.
This is the C dimension for
ovphysx_read_contact_data()andovphysx_read_friction_data()flat buffers. Allocate force/separation buffers as[C, 1], point/normal/friction buffers as[C, 3], and count/start-index buffers as[S, F], whereCis this value andS,Fcome fromovphysx_get_contact_binding_spec().- Parameters:
handle – Instance handle
contact_handle – Contact binding
out_max_contact_data_count – [out] Max detailed contact/friction entries
- Returns:
ovphysx_result_t
- ovphysx_result_t ovphysx_read_contact_net_forces(
- ovphysx_handle_t handle,
- ovphysx_contact_binding_handle_t contact_handle,
- DLTensor *dst_tensor,
Read net contact forces.
dst shape: [S, 3] where S = sensor_count.
The dt for impulse-to-force conversion is taken automatically from the last successful ovphysx_step(), ovphysx_step_sync(), or ovphysx_step_n_sync() call.
- Parameters:
handle – Instance handle
contact_handle – Contact binding
dst_tensor – Pre-allocated DLTensor with shape [S, 3]
- Returns:
ovphysx_result_t
- ovphysx_result_t ovphysx_read_contact_force_matrix(
- ovphysx_handle_t handle,
- ovphysx_contact_binding_handle_t contact_handle,
- DLTensor *dst_tensor,
Read contact force matrix.
dst shape: [S, F, 3].
The dt for impulse-to-force conversion is taken automatically from the last successful ovphysx_step(), ovphysx_step_sync(), or ovphysx_step_n_sync() call.
- Parameters:
handle – Instance handle
contact_handle – Contact binding
dst_tensor – Pre-allocated DLTensor with shape [S, F, 3]
- Returns:
ovphysx_result_t
- ovphysx_result_t ovphysx_read_contact_data(
- ovphysx_handle_t handle,
- ovphysx_contact_binding_handle_t contact_handle,
- DLTensor *contact_force_tensor,
- DLTensor *contact_point_tensor,
- DLTensor *contact_normal_tensor,
- DLTensor *contact_separation_tensor,
- DLTensor *contact_count_tensor,
- DLTensor *contact_start_indices_tensor,
Read detailed contact data into flat buffers.
Required shapes:
contact_force_tensor:
[C, 1]float32contact_point_tensor:
[C, 3]float32contact_normal_tensor:
[C, 3]float32contact_separation_tensor:
[C, 1]float32contact_count_tensor:
[S, F]int32 or uint32contact_start_indices_tensor:
[S, F]int32 or uint32
Cisovphysx_get_contact_binding_capacity(),Sis sensor_count, andFis filter_count. For each(sensor, filter)pair, the valid detailed contact slice is:start = start_indices[s, f],count = counts[s, f],data[start : start + count].CandFmust be positive. Pass a positive max_contact_data_count and filters_per_sensor > 0 when creating the binding. Count and start-index tensors may be int32 or uint32. Contact force magnitudes use the timestep from the last successful ovphysx_step(), ovphysx_step_sync(), or ovphysx_step_n_sync() call.- Parameters:
handle – Instance handle
contact_handle – Contact binding
contact_force_tensor – Pre-allocated contact normal force magnitudes
contact_point_tensor – Pre-allocated world-frame contact points
contact_normal_tensor – Pre-allocated world-frame contact normals
contact_separation_tensor – Pre-allocated contact separations
contact_count_tensor – Pre-allocated count matrix
contact_start_indices_tensor – Pre-allocated start-index matrix
- Returns:
ovphysx_result_t
- ovphysx_result_t ovphysx_read_friction_data(
- ovphysx_handle_t handle,
- ovphysx_contact_binding_handle_t contact_handle,
- DLTensor *friction_force_tensor,
- DLTensor *friction_point_tensor,
- DLTensor *contact_count_tensor,
- DLTensor *contact_start_indices_tensor,
Read detailed friction data into flat buffers.
Required shapes:
friction_force_tensor:
[C, 3]float32friction_point_tensor:
[C, 3]float32contact_count_tensor:
[S, F]int32 or uint32contact_start_indices_tensor:
[S, F]int32 or uint32
C,S, andFhave the same meanings as inovphysx_read_contact_data(). For each(sensor, filter)pair, use the count/start-index tensors to index valid entries in the flat friction buffers.CandFmust be positive. Pass a positive max_contact_data_count and filters_per_sensor > 0 when creating the binding. Count and start-index tensors may be int32 or uint32. Friction forces use the timestep from the last successful ovphysx_step(), ovphysx_step_sync(), or ovphysx_step_n_sync() call.- Parameters:
handle – Instance handle
contact_handle – Contact binding
friction_force_tensor – Pre-allocated world-frame friction forces
friction_point_tensor – Pre-allocated world-frame friction points
contact_count_tensor – Pre-allocated count matrix
contact_start_indices_tensor – Pre-allocated start-index matrix
- Returns:
ovphysx_result_t
- ovphysx_result_t ovphysx_read_raw_contact_data(
- ovphysx_handle_t handle,
- ovphysx_contact_binding_handle_t contact_handle,
- DLTensor *contact_force_tensor,
- DLTensor *contact_point_tensor,
- DLTensor *contact_normal_tensor,
- DLTensor *contact_separation_tensor,
- DLTensor *sensor_layout_tensor,
- DLTensor *actor_ids_tensor,
Read raw (unfiltered) contact data for a contact binding.
Filter-less variant of ovphysx_read_contact_data : returns every contact involving each sensor body regardless of which other actor it collided with, plus per-contact actor-identity tensors so callers can identify both the sensor and the contacting body via ovphysx_contact_binding_get_other_actor_paths_from_ids.
Required shapes (C = max_contact_data_count, S = sensor_count):
contact_force_tensor:
[C, 1]float32, contact normal force magnitudecontact_point_tensor:
[C, 3]float32, contact point in world framecontact_normal_tensor:
[C, 3]float32, contact normal in world framecontact_separation_tensor:
[C, 1]float32, signed separationsensor_layout_tensor:
[S, 2]int32/uint32, per sensor, column 0 is the contact count and column 1 is its start index into the flat buffersactor_ids_tensor:
[C, 2]int64/uint64, per contact, column 0 is the reporting sensor’s own actor id and column 1 is the actor it contacted
The two pairs that are only meaningful together are single tensors rather than separate buffers the caller has to keep in step. The four per-contact value tensors stay separate, matching ovphysx_read_contact_data().
The contact binding must be created with
max_contact_data_count > 0. No filter dimension is required, sofilters_per_sensormay be zero. The dt for impulse-to-force conversion is taken automatically from the last successful ovphysx_step(), ovphysx_step_sync(), or ovphysx_step_n_sync() call.Truncation: when the total contact count for a step exceeds max_contact_data_count, the runtime fills the flat buffers with as many contacts as fit and emits a logged warning. A sensor’s count reports only the contacts actually written, and its start index is clamped to max_contact_data_count, so
[start, start + count)is always an in-range (possibly empty) slice. Callers that need every contact must pass a larger max_contact_data_count.Token lifetime: the uint64 tokens in actor_ids_tensor are opaque runtime actor handles, not encoded paths. Do not decode one. Resolve it with ovphysx_contact_binding_get_other_actor_paths_from_ids. They are stable for as long as the corresponding actor is alive on the attached stage, and become stale once it is removed or the stage is detached or replaced.
- Parameters:
handle – Instance handle
contact_handle – Contact binding
- Returns:
ovphysx_result_t
- ovphysx_result_t ovphysx_contact_binding_get_other_actor_paths_from_ids(
- ovphysx_handle_t handle,
- ovphysx_contact_binding_handle_t contact_handle,
- DLTensor *ids_tensor,
- ovphysx_string_t *out_paths,
- uint32_t max_paths,
- uint32_t *out_count,
Resolve actor IDs from ovphysx_read_raw_contact_data to physics-object paths.
Given a tensor of opaque actor IDs (a column of the
actor_ids_tensor[C, 2]returned by ovphysx_read_raw_contact_data, either column, since both use the same namespace), fillsout_pathswith the corresponding physics-object paths in the same order. An ID of0yields an empty path, as does an ID that is not known to the attached stage at all.ids_tensormust be CPU-resident (path resolution is a host operation) and C-contiguous: a column ofactor_ids_tensoris a strided view, so make the slice contiguous (e.g.np.ascontiguousarray(actor_ids[:, 1])) before passing it. This is the diagnostic path. The per-contact read itself takes the whole contiguous tensor and pays no copy.Stale IDs report as empty, not as their old path. Every non-zero ID is checked against the attached stage before it is resolved, so an actor that has since been removed comes back as an empty path rather than the path it used to name. Because the caller holds the IDs, this makes the failure explicit: for a non-zero ID an empty path means “not resolvable now”, and only ID
0yields an empty path for a live read.The check is as precise as the attached backend’s notion of existence. On an ovstage attach a removed prim reports stale. On a USD stage a merely deactivated prim still resolves, because existence there follows prim validity and USD hands back a valid prim for an inactive one.
- Parameters:
handle – Instance handle
contact_handle – Contact binding
ids_tensor – Input tensor of actor IDs (
[N]int64/uint64)out_paths – [out] Array of ovphysx_string_t to fill. ovphysx owns the returned string storage. Pointers remain valid until the next call to this function on the same binding (which replaces the cache) or until the binding is destroyed.
max_paths – Capacity of
out_pathsarray.out_count – [out] Actual number of paths written.
- Returns:
ovphysx_result_t
- ovphysx_result_t ovphysx_get_contact_report(
- ovphysx_handle_t handle,
- const ovphysx_contact_event_header_t **out_event_headers,
- uint32_t *out_num_event_headers,
- const ovphysx_contact_point_t **out_contact_data,
- uint32_t *out_num_contact_data,
- const ovphysx_friction_anchor_t **out_friction_anchors,
- uint32_t *out_num_friction_anchors,
Get raw contact report data for the current simulation step.
Returns per-contact-point event data: position, normal, impulse, and separation for every contact point this step. Use this for custom contact sensors, collision debugging, or per-point force analysis.
For aggregate force tensors (net forces or force matrices between sensor/filter body sets, delivered as DLPack tensors), see the Contact Binding API: ovphysx_create_contact_binding().
The header array describes contact pairs (which actors/colliders are in contact). Each header references a slice of the contact data array containing per-contact-point information (position, normal, impulse, separation).
Prims involved in contacts must have
PhysxContactReportAPIapplied in the USD stage for contacts to be reported.Ownership: The caller does NOT own the returned arrays. They are read-only views into internal simulation buffers. Copy any data that must be kept beyond the current step.
Pointer lifetime / invalidation: The returned pointers are valid only until the next call that advances or tears down the simulation. The following operations invalidate both arrays:
ovphysx_step() (the next simulation step overwrites the buffers)
ovphysx_reset_stage()
ovphysx_destroy_instance()
- Parameters:
handle – Instance handle.
out_event_headers – [out] Receives a pointer to the contact event header array (read-only, valid until next step).
out_num_event_headers – [out] Number of headers in the array.
out_contact_data – [out] Receives a pointer to the contact point array (read-only, valid until next step).
out_num_contact_data – [out] Number of contact point entries.
out_friction_anchors – [out] Optional. If non-NULL, receives a pointer to the friction anchor array. Each anchor has position[3] and impulse[3] in world space. Pass NULL to skip.
out_num_friction_anchors – [out] Optional. If non-NULL, receives the friction anchor count. Pass NULL to skip.
- Returns:
ovphysx_result_t
- ovphysx_result_t ovphysx_get_physx_ptr(
- ovphysx_handle_t handle,
- ovphysx_string_t prim_path,
- ovphysx_physx_type_t physx_type,
- void **out_ptr,
Get a raw PhysX SDK object pointer by selector and type.
Returns the underlying PhysX object as an opaque
void*. The caller must cast to the appropriate PhysX C++ type (see ovphysx_physx_type_t).A single function covers all PhysX object types. No per-type variants are needed.
Pointer lifetime: Returned pointers are borrowed. Treat them as invalid after stage reset or detachment, or after ovphysx_destroy_instance(). Reacquire them after attaching and initializing another stage. Calls to ovphysx_step() do NOT invalidate existing pointers. Do not call
release()on returned pointers. ovphysx owns them. This applies to the process-global PxPhysics pointer as well as path-bound objects. Objects that callers explicitly create through a returned factory pointer follow the PhysX SDK’s ownership rules. The no-release rule applies to the borrowed pointer returned by this function.Thread safety: PhysX APIs on returned pointers must only be called between simulation steps, specifically after wait_op() completes for the preceding step and before the next ovphysx_step() call. Calling PhysX APIs while a step is in-flight is a data race.
Do not toggle simulation disable through actor pointers. Setting or clearing
PxActorFlag::eDISABLE_SIMULATIONon aPxRigidDynamic*from this API is unsupported. ovphysx does not observe that change, and on DirectGPU scenes the next read or write may address the wrong body with no error. Use the ovstagedisableSimulationattribute (ovphysx_write()/OVPHYSX_ATTR_DISABLE_SIMULATION) instead. That disables a standalone rigid body; a point-instancer instance cannot be disabled individually in this release (disableSimulationis not an instancer-writable column and there is no per-instance tensor route), so disabling one instance is unsupported.Shapes: PxShape objects are reachable from a PxRigidActor pointer via
PxRigidActor::getShapes(). They can also be queried directly withOVPHYSX_PHYSX_TYPE_SHAPE.PhysX SDK headers: Casting the returned pointer requires the PhysX SDK C++ headers (e.g.
PxScene.h,PxRigidDynamic.h). The ovphysx SDK ships these headers underinclude/physx/, andfind_package(ovphysx)setsovphysx_PHYSX_INCLUDE_DIRto point there. Consumers must use those exact shipped headers for the ovphysx build. Do not substitute external PhysX headers. No PhysX library linking is needed.#include <ovphysx/ovphysx.h> static ovphysx_result_t get_scene_and_physics( ovphysx_handle_t handle, void** out_scene, void** out_physics) { ovphysx_result_t result = ovphysx_get_physx_ptr( handle, OVPHYSX_LITERAL("/World/physicsScene"), OVPHYSX_PHYSX_TYPE_SCENE, out_scene); if (result.status != OVPHYSX_API_SUCCESS) { return result; } ovphysx_string_t no_path = { NULL, 0 }; return ovphysx_get_physx_ptr( handle, no_path, OVPHYSX_PHYSX_TYPE_PHYSICS, out_physics); }
- Parameters:
handle – ovphysx instance handle.
prim_path – Physics-object path (ovphysx_string_t, e.g. “/World/physicsScene”, “/World/Cube”, “/World/articulation”). For OVPHYSX_PHYSX_TYPE_PHYSICS, pass a zero-length string view: either
{ NULL, 0 }or{ "", 0 }. Embedded NUL bytes are rejected.physx_type – Which PhysX object type to look up. Path-bound types are looked up at prim_path. See ovphysx_physx_type_t for the mapping to PhysX C++ types.
out_ptr – [out] Receives the PhysX pointer on success. Set to NULL on failure when out_ptr itself is valid.
- Returns:
ovphysx_result_t with status and error info.
- Pre:
A stage must be attached and initialized by at least one completed simulation step (so PhysX objects exist). prim_path must be a valid, non-empty physics-object path except for OVPHYSX_PHYSX_TYPE_PHYSICS, which requires a zero-length selector.
- ovphysx_result_t ovphysx_get_object_type(
- ovphysx_handle_t handle,
- ovphysx_string_t prim_path,
- ovphysx_object_type_t *out_type,
Classify an authored USD prim by its high-level TensorAPI object type.
Returns the umbrella’s view of what kind of simulation object lives at
prim_path— see ovphysx_object_type_t for the taxonomy, which distinguishes standalone (OVPHYSX_OBJECT_TYPE_JOINT), custom (OVPHYSX_OBJECT_TYPE_CUSTOM_JOINT), and articulation (OVPHYSX_OBJECT_TYPE_ARTICULATION_JOINT) joints.Pair object types with the matching ovphysx_get_physx_ptr selector:
OVPHYSX_OBJECT_TYPE_JOINTwithOVPHYSX_PHYSX_TYPE_JOINT,OVPHYSX_OBJECT_TYPE_CUSTOM_JOINTwithOVPHYSX_PHYSX_TYPE_CUSTOM_JOINT, andOVPHYSX_OBJECT_TYPE_ARTICULATION_JOINTwithOVPHYSX_PHYSX_TYPE_LINK_JOINT.Paths with no classified simulation object yield
OVPHYSX_OBJECT_TYPE_INVALIDwithOVPHYSX_API_SUCCESS(the call itself didn’t fail; for example the prim is absent or has no matching TensorAPI object type). Live standalone, custom, and articulation joints at their authored prim paths must not report INVALID.- Parameters:
handle – Instance handle (must have a stage attached)
prim_path – Authored USD prim path (embedded NUL bytes are rejected)
out_type – [out] Receives the object type
- Returns:
OVPHYSX_API_SUCCESS on success (including the INVALID classification above), OVPHYSX_API_INVALID_ARGUMENT if
out_typeis NULL orprim_pathis NULL, empty, or contains an embedded NUL byte, or OVPHYSX_API_ERROR if no stage is attached or the TensorAPI simulation view cannot be created.
- ovphysx_result_t ovphysx_articulation_update_kinematic(
- ovphysx_handle_t handle,
- ovphysx_tensor_binding_handle_t binding_handle,
- uint32_t flags,
Force kinematic propagation of root + DOF state into link buffers for every articulation in the binding, without running a sim step.
Mirrors PhysX SDK’s
physx::PxArticulationReducedCoordinate::updateKinematic. The umbrella’sSimulationView.update_articulations_kinematic()calls this after writing dof-positions / root-transforms to flush the new state into the link buffer so the next read-back of link transforms reflects the writes without simulating.- Deprecated:
Binding-coupled (requires a tensor-binding handle) and removed with the tensor binding. ovphysx_update_articulations_kinematic is NOT a drop-in replacement: it updates every articulation in the instance (this call is scoped to the binding’s subset), does not honor the POSITION / VELOCITY
flags, and is a no-op on CPU. A subset, flag-selective, or CPU caller has no equivalent yet. Closing that gap is a removal-blocker.
- Parameters:
handle – Instance handle
binding_handle – Articulation tensor binding identifying the set of articulations to update.
flags – Bitwise OR of ovphysx_articulation_kinematic_flag_t values. Pass
OVPHYSX_ARTICULATION_KINEMATIC_POSITIONto propagate positions only, OR with VELOCITY to propagate both.
- Returns:
OVPHYSX_API_SUCCESS on success, OVPHYSX_API_INVALID_ARGUMENT if the binding is not an articulation binding, OVPHYSX_API_ERROR on engine failure or if one or more articulations in the binding could not be resolved (e.g. removed from the live stage).
- ovphysx_result_t ovphysx_rigid_body_view_wake_up(
- ovphysx_handle_t handle,
- ovphysx_tensor_binding_handle_t binding_handle,
- const DLTensor *indices,
Wake rigid bodies in a binding.
Mirrors PhysX SDK’s
physx::PxRigidDynamic::wakeUp. Bodies that still havephysx::PxActorFlag::eDISABLE_SIMULATIONset are silently skipped (the engine refuses to wake disabled actors).Typical pair: clear the actor’s
eDISABLE_SIMULATIONflag through the ovstagedisableSimulationwrite (re-add to simulation), then call this to bring the actor active for the next simulate — otherwise it sits in the sleep state PhysX placed it in when the flag was first set.- Deprecated:
Binding-coupled (requires a tensor-binding handle) and removed with the tensor binding. No non-binding successor yet (a session wake/sleep control is a removal-blocker).
- Parameters:
handle – Instance handle
binding_handle – Rigid body tensor binding identifying the set of bodies in scope.
indices – Optional int32 DLTensor of indices into the binding, or NULL to wake every body in the binding.
- Returns:
OVPHYSX_API_SUCCESS, OVPHYSX_API_INVALID_ARGUMENT if the binding is not a rigid-body binding, OVPHYSX_API_NOT_FOUND if the binding has been invalidated by a stage change, OVPHYSX_API_ERROR on engine failure.
- ovphysx_result_t ovphysx_rigid_body_view_sleep(
- ovphysx_handle_t handle,
- ovphysx_tensor_binding_handle_t binding_handle,
- const DLTensor *indices,
Force rigid bodies in a binding to sleep.
Mirrors PhysX SDK’s
physx::PxRigidDynamic::putToSleep. Sets the sleep state on each body so it is excluded from the next solve unless woken by a contact or an explicit ovphysx_rigid_body_view_wake_up call. Bodies that havephysx::PxActorFlag::eDISABLE_SIMULATIONset are silently skipped.- Deprecated:
Binding-coupled (requires a tensor-binding handle) and removed with the tensor binding. No non-binding successor yet (a session wake/sleep control is a removal-blocker).
- Parameters:
handle – Instance handle
binding_handle – Rigid body tensor binding identifying the set of bodies in scope.
indices – Optional int32 DLTensor of indices into the binding, or NULL to put every body in the binding to sleep.
- Returns:
OVPHYSX_API_SUCCESS, OVPHYSX_API_INVALID_ARGUMENT if the binding is not a rigid-body binding, OVPHYSX_API_NOT_FOUND if the binding has been invalidated by a stage change, OVPHYSX_API_ERROR on engine failure.
- ovphysx_result_t ovphysx_subscribe_object_changes(
- const ovphysx_object_change_callbacks_t *callbacks,
- ovphysx_subscription_id_t *out_subscription,
Subscribe to PhysX object create/destroy notifications.
Pair with ovphysx_get_physx_ptr() to manage the lifetime of cached PhysX SDK pointers. On a destruction notification the caller MUST drop the cached pointer before returning from the callback. On a creation notification the caller should mark the prim path as dirty in its own cache and call ovphysx_get_physx_ptr() to fetch the new pointer ONLY after the triggering synchronous call returns, or after ovphysx_wait_op() returns for async work, never from inside the callback itself (see Threading below).
Subscriptions are PROCESS-GLOBAL, not per-instance. A single subscription receives events from every ovphysx instance in the process. Multi-instance callers that need to filter by stage must do so on their side. The prim_path delivered to the callback is the only identifier available. The handle parameter is intentionally absent.
Lifecycle: callbacks fire for changes that occur during simulation and ovphysx_reset_stage()’s bulk teardown. The initial object population from ovstage attach/update is NOT notified, since the caller already has that state from setup.
Known limitation: ovphysx_clone() does NOT currently fire object_created notifications. Pointer caches that need to track cloned objects must be refreshed after ovphysx_wait_op() returns on the clone operation, not via this subscription. ovphysx_reset_stage() (and the all-objects-destroyed callback) is the supported path for bulk pointer invalidation.
Threading: callbacks may fire from internal worker threads. Do NOT call other ovphysx APIs from inside a callback. Defer that until the triggering synchronous call returns, or until ovphysx_wait_op() returns for async work. See the docstring on ovphysx_object_change_callbacks_t for the full contract.
Failure modes:
OVPHYSX_API_INVALID_ARGUMENT if callbacks or out_subscription is NULL, or if every callback function pointer in the struct is NULL.
OVPHYSX_API_ERROR if the physics runtime is not available (e.g. no ovphysx instance has been created yet).
On failure, *out_subscription is set to OVPHYSX_INVALID_SUBSCRIPTION_ID.
- Parameters:
callbacks – [in] Pointer to the callback set. The struct is copied internally, so the caller does not need to keep it alive after this call returns.
out_subscription – [out] Receives the subscription ID on success. Pass this to ovphysx_unsubscribe_object_changes() to stop receiving notifications.
- Returns:
OVPHYSX_API_SUCCESS on success, or an error status.
- ovphysx_result_t ovphysx_unsubscribe_object_changes(
- ovphysx_subscription_id_t subscription,
Unsubscribe from PhysX object change notifications.
Stops delivery of further notifications for the given subscription ID. After this call returns the subscription ID is consumed and must not be reused.
Idempotency: passing an already-unsubscribed or unknown subscription ID returns OVPHYSX_API_NOT_FOUND. OVPHYSX_INVALID_SUBSCRIPTION_ID is rejected with OVPHYSX_API_INVALID_ARGUMENT.
- Parameters:
subscription – Subscription ID returned from ovphysx_subscribe_object_changes().
- Returns:
OVPHYSX_API_SUCCESS on success, or an error status.
- ovphysx_result_t ovphysx_raycast(
- ovphysx_handle_t handle,
- const float origin[3],
- const float direction[3],
- float distance,
- bool both_sides,
- ovphysx_scene_query_mode_t mode,
- const ovphysx_scene_query_hit_t **out_hits,
- uint32_t *out_count,
Cast a ray and return hits.
#include <ovphysx/ovphysx.h> #include <stdio.h> static ovphysx_result_t print_closest_hit(ovphysx_handle_t handle) { const ovphysx_scene_query_hit_t* hits = NULL; uint32_t count = 0; const float origin[3] = {0.0f, 10.0f, 0.0f}; const float direction[3] = {0.0f, -1.0f, 0.0f}; ovphysx_result_t result = ovphysx_raycast( handle, origin, direction, 100.0f, false, OVPHYSX_SCENE_QUERY_MODE_CLOSEST, &hits, &count); if (result.status == OVPHYSX_API_SUCCESS && count > 0) printf("Hit at distance %f\n", hits[0].distance); return result; }
- Parameters:
handle – Instance handle.
origin – Ray origin (world space, 3 floats).
direction – Normalized ray direction (3 floats).
distance – Maximum ray distance. Must be >= 0.
both_sides – If true, test both sides of mesh triangles.
mode – CLOSEST (0 or 1 hit), ANY (0 or 1), or ALL.
out_hits – [out] Receives pointer to internal hit array.
out_count – [out] Number of hits in the array.
- Returns:
ovphysx_result_t
- ovphysx_result_t ovphysx_sweep(
- ovphysx_handle_t handle,
- const ovphysx_scene_query_geometry_desc_t *geometry,
- const float direction[3],
- float distance,
- bool both_sides,
- ovphysx_scene_query_mode_t mode,
- const ovphysx_scene_query_hit_t **out_hits,
- uint32_t *out_count,
Sweep a geometry shape along a direction and return hits.
- Parameters:
handle – Instance handle.
geometry – Geometry descriptor (sphere, box, or arbitrary shape).
direction – Normalized sweep direction (3 floats).
distance – Maximum sweep distance. Must be >= 0.
both_sides – If true, test both sides of mesh triangles.
mode – CLOSEST (0 or 1 hit), ANY (0 or 1), or ALL.
out_hits – [out] Receives pointer to internal hit array.
out_count – [out] Number of hits in the array.
- Returns:
ovphysx_result_t
- ovphysx_result_t ovphysx_overlap(
- ovphysx_handle_t handle,
- const ovphysx_scene_query_geometry_desc_t *geometry,
- ovphysx_scene_query_mode_t mode,
- const ovphysx_scene_query_hit_t **out_hits,
- uint32_t *out_count,
Test geometry overlap against objects in the scene.
Overlap queries do not have a direction or distance. Location fields in the hit struct (normal, position, distance, face_index, material) are zeroed. Only object identity (collision, rigid_body, proto_index) is populated.
- Parameters:
handle – Instance handle.
geometry – Geometry descriptor (sphere, box, or arbitrary shape).
mode – ANY (0 or 1 result) or ALL. CLOSEST is treated as ALL.
out_hits – [out] Receives pointer to internal hit array.
out_count – [out] Number of hits (or overlaps) in the array.
- Returns:
ovphysx_result_t
- ovphysx_result_t ovphysx_scene_query_get_paths_from_ids(
- ovphysx_handle_t handle,
- const uint64_t *ids,
- uint32_t id_count,
- ovphysx_string_t *out_paths,
- uint32_t max_paths,
- uint32_t *out_count,
Resolve object-identity handles to physics-object paths.
Given an array of opaque object-identity handles produced by this API, fills
out_pathswith the corresponding physics-object paths in the same order. Despite thescene_queryname the resolution is generic: any identity field carries the same opaque handle, so scene-query hits (collision,rigid_body,materialof an ovphysx_scene_query_hit_t from ovphysx_raycast, ovphysx_sweep or ovphysx_overlap) and contact-report identities (actor0/1,collider0/1of an ovphysx_contact_event_header_t,material0/1of an ovphysx_contact_point_t) are all accepted. IDs that cannot be resolved (a zero/sentinel id, an id from an object removed since it was reported, or a call with no active attach) yield empty paths rather than an error.- Parameters:
handle – Instance handle.
ids – Input array of opaque identity handles (see fields above).
id_count – Number of entries in
ids.out_paths – [out] Array of ovphysx_string_t to fill. ovphysx owns the returned string storage. Unlike ovphysx_contact_binding_get_other_actor_paths_from_ids, these pointers are not a per-call cache. Each is owned by the currently attached physics source and stays valid only until the next detach or re-attach. A later call to this function (against the same attach) does not invalidate a pointer returned by an earlier one. Callers that need a path to outlive a detach/re-attach must copy it.
max_paths – Capacity of
out_pathsarray.out_count – [out] Total number of ids in
ids(== id_count). Onlymin(id_count, max_paths)entries are written toout_paths, so compare againstmax_pathsto detect truncation.
- Returns:
ovphysx_result_t
- ovphysx_enqueue_result_t ovphysx_add_user_task(
- ovphysx_handle_t handle,
- const ovphysx_user_task_desc_t *desc,
- ovphysx_result_t ovphysx_wait_op(
- ovphysx_handle_t handle,
- ovphysx_op_index_t op_index,
- ovphysx_timeout_t timeout_ns,
- ovphysx_op_wait_result_t *out_wait_result,
-
ovphysx_string_t ovphysx_get_last_error(void)#
Query the error string for the last failed API call on the calling thread.
The returned string is valid until the next ovphysx API call on the same thread. Returns a stable empty string if the last call succeeded.
#include <ovphysx/ovphysx.h> #include <stdio.h> int main(void) { ovphysx_result_t result = ovphysx_initialize(); if (result.status != OVPHYSX_API_SUCCESS) { ovphysx_string_t error = ovphysx_get_last_error(); if (error.length != 0) fprintf(stderr, "Error: %.*s\n", (int)error.length, error.ptr); return 1; } return ovphysx_shutdown().status == OVPHYSX_API_SUCCESS ? 0 : 1; }
- Threading
Thread-local storage. Safe to call from any thread.
- Returns:
Error message, or {“”, 0} on success. ptr is always non-NULL and ptr[length] is ‘\0’.
- ovphysx_string_t ovphysx_get_last_op_error(
- ovphysx_op_index_t op_index,
Query the error string for a specific failed op_index from the last wait_op call.
After ovphysx_wait_op() reports failed operations via error_op_indices, call this function for each failed op_index to retrieve the error message. The returned string is valid until the next ovphysx_wait_op() call on the same thread.
See also
ovphysx_wait_op for the wait-result API that supplies failed operation indices.
- Threading
Thread-local storage. Safe to call from any thread.
- Parameters:
op_index – The failed operation index (from ovphysx_op_wait_result_t.error_op_indices).
- Returns:
Error message, or {“”, 0} if op_index has no error. ptr is always non-NULL and ptr[length] is ‘\0’.
-
void ovphysx_destroy_wait_result(ovphysx_op_wait_result_t *result)#
Free the error_op_indices array in an ovphysx_op_wait_result_t.
Call this after processing the wait result to release the dynamically allocated error_op_indices array.
#include <ovphysx/ovphysx.h> static void release_wait_result(ovphysx_op_wait_result_t* result) { ovphysx_destroy_wait_result(result); }
- Parameters:
result – Pointer to the wait result to clean up (NULL-safe).
- Pre:
Safe to call with NULL or already-cleaned result.
- Post:
result->error_op_indices is NULL and num_errors is 0.
-
ovphysx_result_t ovphysx_set_log_level(uint32_t level)#
Set the process-scoped libovphysx source log level threshold.
Messages emitted by the named Carbonite sources
omni_physx_sdk,omni.physx, andovphysx_internalbelow this level are suppressed for console and application-callback delivery. Every other process source and channel, including any unnamed source, remains unchanged and is subject only to the callback’s minimum severity and channel filter. OVPHYSX_LOG_NONE therefore mutes only the three named sources. It is not a whole-runtime or process mute. Callable at any time. If called before instance creation, the level is stored and applied when Carbonite initializes.- Threading
Thread-safe.
Note
Must not be called from within the application log callback. It returns OVPHYSX_API_ERROR without changing the setting.
- Parameters:
level – Unsigned value corresponding to ovphysx_log_level_t. Default: OVPHYSX_LOG_WARNING. OVPHYSX_LOG_DEFAULT restores the library default (WARNING).
- Returns:
ovphysx_result_t with OVPHYSX_API_SUCCESS on success, or OVPHYSX_API_INVALID_ARGUMENT if the level was out of range (no state change is applied), or OVPHYSX_API_ERROR when called from the active log callback.
-
uint32_t ovphysx_get_log_level(void)#
Get the current process-scoped libovphysx source log level threshold.
- Threading
Thread-safe.
- Returns:
Unsigned value corresponding to the current ovphysx_log_level_t.
-
ovphysx_result_t ovphysx_enable_default_log_output(bool enable)#
Enable or disable Carbonite’s built-in console log output.
By default, Carbonite logs to the console (stdout/stderr). When a custom callback is set via ovphysx_set_log_callback(), both the built-in console output and the custom callback receive messages, which may cause duplicate output if the callback also writes to the console.
Call this function with
falseto suppress the built-in console output while keeping the custom callback active. Call withtrueto re-enable it.This function is independent of callback registration and the process-scoped libovphysx source log level. It controls Carbonite’s process-global built-in console logger and therefore affects every Carbonite tenant in the process. Multi-tenant hosts should normally own this policy themselves and leave this function enabled.
Callable at any time. If called before Carbonite initializes, the preference is stored and applied during initialization.
- Threading
Thread-safe.
- Parameters:
enable –
trueto enable (default),falseto disable.- Returns:
OVPHYSX_API_SUCCESS on success, or OVPHYSX_API_ERROR when called from the application log callback.
- ovphysx_result_t ovphysx_set_log_callback(
- ovphysx_log_level_t min_severity,
- const ovphysx_string_t *channel_filter,
- ovphysx_log_callback_t callback,
- void *user_data,
Set or disable the application log callback.
One callback may be registered. Calling again publishes the replacement for newly accepted messages, then waits for the prior registration’s in-flight invocations before returning. Passing NULL for
callbackimmediately stops accepting delivery and drains the prior registration. Once set, the callback pointer and resources reachable throughuser_datamust remain valid until a later replacing or disabling call, or a successful ovphysx_shutdown(), returns. This includes shutdown with live handles retained only for explicit destruction. During replacement, accepted invocations of the old registration may overlap invocations of the newly published registration. Invocations within each registration remain serialized.min_severityapplies to every record in the observed process log stream. Records from the library-ownedomni_physx_sdk,omni.physx, andovphysx_internalsources are also subject to the source threshold configured by ovphysx_set_log_level(). OVPHYSX_LOG_DEFAULT uses WARNING.channel_filteris optional. It is a comma-separated list ofchannel=levelrules. ASCII whitespace around entries, channels, and levels is ignored, and level names are case-insensitive. A rule matches any channel beginning with its raw prefix. Rules are considered in declaration order. The longest matching prefix wins, and a later rule wins ties between equal-length matching prefixes. An empty filter usesmin_severityfor every channel.Note
The callback may be invoked from any thread, but invocations for the active registration are serialized.
Note
The callback observes Carbonite’s process log stream. The channel parameter identifies the emitting source for application filtering.
Note
Must not be called from within the callback. Returns OVPHYSX_API_ERROR if called during callback dispatch.
Note
An OVPHYSX_API_ERROR after valid arguments may be reported after the replacement was published. Conservatively keep
callbackanduser_dataalive until a later successful replace, disable, or shutdown drains the slot.- Parameters:
min_severity – Minimum delivered severity.
channel_filter – Optional non-owning filter view, copied by the call.
callback – Callback function, or NULL to disable.
user_data – Opaque pointer forwarded to every callback invocation.
- Returns:
ovphysx_result_t with status.
- Post:
Invalid arguments leave the prior registration unchanged.
-
ovphysx_result_t ovphysx_flush_log(ovphysx_timeout_t timeout_ns)#
Wait for application-callback deliveries accepted before this call.
This is an exact barrier for records already handed to ovphysx by Carbonite. If the host enabled Carbonite asynchronous logging, records still buffered upstream have not yet been accepted and are outside this barrier. Successful ovphysx_shutdown() flushes that upstream buffer before disabling and draining the callback.
- Parameters:
timeout_ns – Maximum wait in nanoseconds. OVPHYSX_TIMEOUT_POLL polls. OVPHYSX_TIMEOUT_INFINITE waits indefinitely.
- Returns:
OVPHYSX_API_SUCCESS when drained, OVPHYSX_API_TIMEOUT on timeout, or OVPHYSX_API_ERROR when called from a log callback.
- ovphysx_result_t ovphysx_create_sdf_view(
- ovphysx_handle_t handle,
- ovphysx_string_t pattern,
- uint32_t max_query_points,
- ovphysx_sdf_view_handle_t *out_handle,
Create an SDF shape view for shapes matching the given pattern.
The view evaluates the signed distance field of PhysX collision shapes at caller-supplied query points. Requires a GPU instance. CPU SDF evaluation is not implemented and create fails for CPU instances.
The returned handle must be released with ovphysx_destroy_sdf_view when no longer needed. The handle is invalidated when the attached USD stage changes (ovphysx_reset_stage, ovphysx_detach_ovstage, or loading a new stage) or when the instance is destroyed (via ovphysx_destroy_instance) even if ovphysx_destroy_sdf_view is not called explicitly. After invalidation, evaluate/get calls return OVPHYSX_API_NOT_FOUND. Recreate the view after re-attaching a stage.
Thread safety: safe to call concurrently with other ovphysx API functions on the same handle, but not concurrently with ovphysx_destroy_instance on the same handle.
- Parameters:
handle – Instance handle.
pattern – USD-style path glob selecting SDF-enabled collision shapes, including runtime-only clones (e.g. “/World/Mesh*”). Must match at least one shape or the call returns an error. A single path component longer than 4096 characters is rejected with OVPHYSX_API_INVALID_ARGUMENT.
max_query_points – Number of query points per shape per evaluate call. Query tensors passed to ovphysx_evaluate_sdf must have Q == this value (second dimension). Must be > 0.
out_handle – Receives the new SDF view handle on success. Set to 0 on failure.
- Returns:
OVPHYSX_API_SUCCESS or an error code.
- ovphysx_result_t ovphysx_sdf_view_get_count(
- ovphysx_handle_t handle,
- ovphysx_sdf_view_handle_t sdf_handle,
- uint32_t *out_count,
Return the number of shapes in the SDF view (N, first dimension of query tensors).
- Parameters:
handle – Instance handle.
sdf_handle – SDF view handle from ovphysx_create_sdf_view.
out_count – Receives the shape count on success.
- Returns:
OVPHYSX_API_SUCCESS, OVPHYSX_API_INVALID_ARGUMENT if out_count is NULL, OVPHYSX_API_NOT_FOUND if sdf_handle is not valid.
- ovphysx_result_t ovphysx_sdf_view_get_max_query_points(
- ovphysx_handle_t handle,
- ovphysx_sdf_view_handle_t sdf_handle,
- uint32_t *out_max_query_points,
Return the max_query_points value this view was created with (Q, second dimension).
- Parameters:
handle – Instance handle.
sdf_handle – SDF view handle from ovphysx_create_sdf_view.
out_max_query_points – Receives the max query points on success.
- Returns:
OVPHYSX_API_SUCCESS, OVPHYSX_API_INVALID_ARGUMENT if out_max_query_points is NULL, OVPHYSX_API_NOT_FOUND if sdf_handle is not valid.
- ovphysx_result_t ovphysx_evaluate_sdf(
- ovphysx_handle_t handle,
- ovphysx_sdf_view_handle_t sdf_handle,
- const DLTensor *query_points,
- DLTensor *out_distances_and_gradients,
Evaluate the SDF at query points and write distances + gradients.
DLTensor requirements: query_points:
shape: [N, Q, 3] where N = shape count, Q == max_query_points
dtype: float32
device: GPU (kDLCUDA) out_distances_and_gradients:
shape: [N, Q, 4] with component layout (grad.x, grad.y, grad.z, distance)
dtype: float32
device: same as query_points
must be pre-allocated with the correct shape
- Parameters:
handle – Instance handle.
sdf_handle – SDF view handle from ovphysx_create_sdf_view.
query_points – Query point tensor [N, Q, 3].
out_distances_and_gradients – Output tensor [N, Q, 4].
- Returns:
OVPHYSX_API_SUCCESS or an error code.
- ovphysx_result_t ovphysx_destroy_sdf_view(
- ovphysx_handle_t handle,
- ovphysx_sdf_view_handle_t sdf_handle,
Destroy an SDF view and release its resources.
Idempotent: returns OVPHYSX_API_SUCCESS if the view was already destroyed or removed by stage reset/detach cleanup. After this call the handle is invalid and must not be used for evaluate/read paths.
- Parameters:
handle – Instance handle.
sdf_handle – SDF view handle from ovphysx_create_sdf_view.
- Returns:
OVPHYSX_API_SUCCESS, or OVPHYSX_API_ERROR on invalid instance handle.
- ovphysx_result_t ovphysx_debug_render_enable(
- ovphysx_handle_t handle,
- bool enable,
Enable or disable debug-render generation.
Enables debug geometry for every body, shape and joint in the scene, applies the master scale and the current parameter set. Re-call after a scene rebuild or reset. Read the generated geometry with ovphysx_debug_render_get_points / _lines / _triangles.
- Parameters:
handle – Simulator instance (drives the attached stage).
enable – true to start generating debug geometry, false to stop.
- Returns:
OVPHYSX_API_SUCCESS (also a no-op SUCCESS when the viz interface is unavailable), or OVPHYSX_API_ERROR when no USD stage is attached.
- ovphysx_result_t ovphysx_debug_render_set_parameter(
- ovphysx_handle_t handle,
- uint32_t param,
- float value,
Set one debug-geometry parameter.
0 disables the geometry type and a positive value enables it. For parameters whose PhysX semantics define a magnitude, that value scales the geometry together with the master scale. CONTACT_POINT and FRICTION_POINT use a positive value only as an enable gate. Their marker size follows the master scale. Geometry with an inherent shape (collision shapes, bounds) is drawn at that shape’s dimensions.
- Parameters:
handle – Simulator instance (drives the attached stage).
param – One of ovphysx_debug_render_parameter_t. NONE (0) and values >= OVPHYSX_DEBUG_RENDER_PARAM_COUNT are rejected.
value – Finite value >= 0. 0 disables and a positive value enables.
- Returns:
OVPHYSX_API_INVALID_ARGUMENT if param is out of range or value is non-finite or negative, OVPHYSX_API_ERROR when no USD stage is attached, otherwise OVPHYSX_API_SUCCESS (a no-op SUCCESS when debug rendering is unavailable).
- ovphysx_result_t ovphysx_debug_render_set_scope_tokens(
- ovphysx_handle_t handle,
- const ovx_primpath_t *tokens,
- uint32_t count,
Limit debug rendering to an exact set of interned prim paths.
An object is in scope when its interned prim path is one of the handles (exact membership, NO prefix expansion). Build the list through the attached Stage’s path_dictionary_instance_t or from a query’s prim list. Expanding a hierarchy into its exact object set is the caller’s job, not this call’s. count 0 clears the scope. Joints follow their attached bodies. The scope applies immediately to currently instantiated runtime objects. Reapply it after runtime topology changes. Out-of-scope objects are skipped at emission.
Requires an OVStage attached through ovphysx_attach_ovstage (the path dictionary lives there). Handles are valid only for that exact dictionary, require no per-handle release, and the scope is cleared automatically by ovphysx_detach_ovstage. Re-intern and reapply the scope after attaching a different Stage. Returns OVPHYSX_API_ERROR when the sidecar symbol, visualization slot, or attached Stage dictionary is unavailable. Scope state remains unchanged on every error.
- Parameters:
handle – Simulator instance (drives the attached stage).
tokens – Array of count interned ovx_primpath_t handles from the attached Stage’s dictionary. May be NULL when count is 0.
count – Number of entries. 0 clears the scope.
- Returns:
OVPHYSX_API_INVALID_ARGUMENT when tokens is NULL with count > 0 or any token is invalid, or OVPHYSX_API_ERROR when the sidecar symbol, visualization slot, or attached Stage dictionary is unavailable.
- ovphysx_result_t ovphysx_debug_render_get_parameter(
- ovphysx_handle_t handle,
- uint32_t param,
- float *out_value,
Read back a debug-render parameter’s value.
Returns the value last set through ovphysx_debug_render_set_parameter, cached on the OvPhysX side. The debug-render state is process-global. 0 means off and is the default before any set.
- Parameters:
handle – Instance handle.
param – One of ovphysx_debug_render_parameter_t (NONE / out-of-range rejected).
out_value – [out] Set to the cached value. Must be non-NULL.
- Returns:
OVPHYSX_API_INVALID_ARGUMENT if param is NONE / out of range or out_value is NULL.
- ovphysx_result_t ovphysx_debug_render_set_scale(
- ovphysx_handle_t handle,
- float scale,
Set the master PhysX debug-render scale.
- Parameters:
handle – Simulator instance (drives the attached stage).
scale – Must be finite and >= 0.
- Returns:
OVPHYSX_API_INVALID_ARGUMENT if scale is non-finite or negative, OVPHYSX_API_ERROR when no USD stage is attached, otherwise OVPHYSX_API_SUCCESS.
- ovphysx_result_t ovphysx_debug_render_get_scale(
- ovphysx_handle_t handle,
- float *out_scale,
Read back the master debug-render scale last set through OvPhysX (cached, defaults to 1.0 before any set).
- Parameters:
handle – Instance handle.
out_scale – [out] Set to the cached scale. Must be non-NULL.
- Returns:
OVPHYSX_API_INVALID_ARGUMENT if out_scale is NULL.
- ovphysx_result_t ovphysx_debug_render_set_culling_box(
- ovphysx_handle_t handle,
- const float min3[3],
- const float max3[3],
Restrict debug-render generation to a world-space AABB.
- Parameters:
handle – Simulator instance (drives the attached stage).
min3 – Box minimum, float[3]. Must be non-NULL and finite.
max3 – Box maximum, float[3]. Must be non-NULL, finite, and >= min3 per axis.
- Returns:
OVPHYSX_API_INVALID_ARGUMENT if min3/max3 is NULL, non-finite, or min > max, OVPHYSX_API_ERROR when no USD stage is attached, otherwise OVPHYSX_API_SUCCESS.
- ovphysx_result_t ovphysx_debug_render_get_points(
- ovphysx_handle_t handle,
- const ovphysx_debug_point_t **out_points,
- uint32_t *out_count,
Read the current debug-render point buffer (the debug geometry produced during the step).
OvPhysX has no viewer. The application draws it.
Ownership / lifetime: the returned pointer aliases an OvPhysX-owned buffer and is invalidated by the next ovphysx_step() OR by any stage / scene change (ovphysx_reset_stage, ovphysx_update_from_ovstage, ovphysx_detach_ovstage, ovphysx_destroy_instance): the underlying PhysX scenes and debug buffers may be recreated. Copy out before any of those. Do not hold the pointer across a step or re-attach. On success-with-no-data *out_points is set to NULL and *out_count to 0.
- Parameters:
handle – Instance handle.
out_points – [out] Set to the buffer base (NULL when empty). Must be non-NULL.
out_count – [out] Set to the primitive count (0 when empty). Must be non-NULL.
- Returns:
OVPHYSX_API_INVALID_ARGUMENT if out_points or out_count is NULL, OVPHYSX_API_ERROR when no USD stage is attached, otherwise OVPHYSX_API_SUCCESS.
- ovphysx_result_t ovphysx_debug_render_get_lines(
- ovphysx_handle_t handle,
- const ovphysx_debug_line_t **out_lines,
- uint32_t *out_count,
Read the debug-render line buffer.
Same ownership / lifetime + argument contract as ovphysx_debug_render_get_points.
- ovphysx_result_t ovphysx_debug_render_get_triangles(
- ovphysx_handle_t handle,
- const ovphysx_debug_triangle_t **out_triangles,
- uint32_t *out_count,
Read the debug-render triangle buffer.
Same ownership / lifetime + argument contract as ovphysx_debug_render_get_points.
C API Types#
Defines
-
OVPHYSX_LITERAL(s)#
Create ovphysx_string_t from a string LITERAL only.
For runtime strings (variables, user input), use ovphysx_cstr() instead.
-
OVPHYSX_INVALID_HANDLE#
Sentinel value representing an invalid/null ovphysx instance handle.
Valid handles are nonzero, so 0 is reserved to indicate “no handle” or “invalid handle”. Use this when a handle parameter is required but no valid instance is available.
-
OVPHYSX_OP_INDEX_ALL#
Sentinel value for ovphysx_wait_op to wait for all operations submitted up to the call.
Use this to ensure all outstanding operations have completed.
-
OVPHYSX_TIMEOUT_POLL#
-
OVPHYSX_TIMEOUT_INFINITE#
-
OVPHYSX_ATTR_POSITION#
Canonical physics-output attribute names (semantic, not USD attribute names).
Pass any of these to ovphysx_read(). Which names a type produces is documented in the ovstage usage guide.
-
OVPHYSX_ATTR_ORIENTATION#
-
OVPHYSX_ATTR_LINEAR_VELOCITY#
-
OVPHYSX_ATTR_ANGULAR_VELOCITY#
-
OVPHYSX_ATTR_LINEAR_ACCELERATION#
-
OVPHYSX_ATTR_ANGULAR_ACCELERATION#
-
OVPHYSX_ATTR_MASS#
-
OVPHYSX_ATTR_INVERSE_MASS#
-
OVPHYSX_ATTR_INERTIA#
-
OVPHYSX_ATTR_INVERSE_INERTIA#
-
OVPHYSX_ATTR_CENTER_OF_MASS_POSITION#
-
OVPHYSX_ATTR_CENTER_OF_MASS_ORIENTATION#
-
OVPHYSX_ATTR_ROOT_POSITION#
-
OVPHYSX_ATTR_ROOT_ORIENTATION#
-
OVPHYSX_ATTR_ROOT_LINEAR_VELOCITY#
-
OVPHYSX_ATTR_ROOT_ANGULAR_VELOCITY#
-
OVPHYSX_ATTR_CENTER_OF_MASS_WORLD#
-
OVPHYSX_ATTR_CENTER_OF_MASS_LOCAL#
-
OVPHYSX_ATTR_JACOBIAN#
-
OVPHYSX_ATTR_JACOBIAN_SHAPE#
-
OVPHYSX_ATTR_MASS_MATRIX#
-
OVPHYSX_ATTR_CORIOLIS_FORCE#
-
OVPHYSX_ATTR_GRAVITY_FORCE#
-
OVPHYSX_ATTR_CENTROIDAL_MOMENTUM#
-
OVPHYSX_ATTR_DISABLE_GRAVITY#
-
OVPHYSX_ATTR_DISABLE_SIMULATION#
-
OVPHYSX_ATTR_STATIC_FRICTION#
-
OVPHYSX_ATTR_DYNAMIC_FRICTION#
-
OVPHYSX_ATTR_RESTITUTION#
-
OVPHYSX_ATTR_CONTACT_OFFSET#
-
OVPHYSX_ATTR_REST_OFFSET#
-
OVPHYSX_ATTR_SHAPE_COUNT#
-
OVPHYSX_ATTR_POINTS#
-
OVPHYSX_ATTR_VELOCITIES#
-
OVPHYSX_ATTR_REST_POINTS#
-
OVPHYSX_ATTR_SIM_ELEMENT_INDICES#
-
OVPHYSX_ATTR_COLLISION_ELEMENT_INDICES#
-
OVPHYSX_ATTR_DEFORMABLE_DYNAMIC_FRICTION#
-
OVPHYSX_ATTR_DEFORMABLE_YOUNGS_MODULUS#
-
OVPHYSX_ATTR_DEFORMABLE_POISSONS_RATIO#
-
OVPHYSX_ATTR_DEFORMABLE_ELASTICITY_DAMPING#
-
OVPHYSX_ATTR_DEFORMABLE_BENDING_STIFFNESS#
-
OVPHYSX_ATTR_DEFORMABLE_THICKNESS#
-
OVPHYSX_ATTR_DEFORMABLE_BENDING_DAMPING#
-
OVPHYSX_ATTR_JOINT_POSITION#
-
OVPHYSX_ATTR_JOINT_VELOCITY#
-
OVPHYSX_ATTR_JOINT_POSITION_TARGET#
-
OVPHYSX_ATTR_JOINT_VELOCITY_TARGET#
-
OVPHYSX_ATTR_JOINT_ACTUATION_FORCE#
-
OVPHYSX_ATTR_JOINT_PROJECTED_FORCE#
-
OVPHYSX_ATTR_JOINT_STIFFNESS#
-
OVPHYSX_ATTR_JOINT_DAMPING#
-
OVPHYSX_ATTR_JOINT_LIMIT#
-
OVPHYSX_ATTR_JOINT_MAX_VELOCITY#
-
OVPHYSX_ATTR_JOINT_MAX_FORCE#
-
OVPHYSX_ATTR_JOINT_ARMATURE#
-
OVPHYSX_ATTR_JOINT_STATIC_FRICTION#
-
OVPHYSX_ATTR_JOINT_DYNAMIC_FRICTION#
-
OVPHYSX_ATTR_JOINT_VISCOUS_FRICTION#
-
OVPHYSX_ATTR_JOINT_SPEED_EFFORT_GRADIENT#
-
OVPHYSX_ATTR_JOINT_MAX_ACTUATOR_VELOCITY#
-
OVPHYSX_ATTR_JOINT_VELOCITY_DEPENDENT_RESISTANCE#
-
OVPHYSX_ATTR_JOINT_DRIVE_TYPE#
-
OVPHYSX_ATTR_LINK_INCOMING_JOINT_FORCE#
-
OVPHYSX_ATTR_TENDON_STIFFNESS#
-
OVPHYSX_ATTR_TENDON_DAMPING#
-
OVPHYSX_ATTR_TENDON_LIMIT_STIFFNESS#
-
OVPHYSX_ATTR_TENDON_LIMIT#
-
OVPHYSX_ATTR_TENDON_REST_LENGTH#
-
OVPHYSX_ATTR_TENDON_OFFSET#
-
OVPHYSX_ATTR_FORCE#
-
OVPHYSX_ATTR_WRENCH#
-
OVPHYSX_ATTR_DRIVE_TORQUE#
-
OVPHYSX_ATTR_BRAKE_TORQUE#
-
OVPHYSX_ATTR_STEER_ANGLE#
-
OVPHYSX_INVALID_SUBSCRIPTION_ID#
Sentinel value for an invalid / unset subscription ID.
Valid subscription IDs are never equal to this value. After calling ovphysx_subscribe_object_changes(), check the returned status code first; only use the out_subscription value when status == OVPHYSX_API_SUCCESS.
-
OVPHYSX_CREATE_ARGS_DEFAULT#
Default initializer for ovphysx_create_args.
Typedefs
-
typedef uint64_t ovphysx_handle_t#
One ovphysx handle, created by ovphysx_create_instance.
Owns per-handle bookkeeping and drives at most one attached USD stage. Handles share the process-global simulation backend and attached stage.
-
typedef uint64_t ovphysx_usd_handle_t#
-
typedef uint64_t ovphysx_attribute_binding_handle_t#
-
typedef uint64_t ovphysx_write_map_handle_t#
-
typedef uint64_t ovphysx_read_map_handle_t#
-
typedef uint64_t ovphysx_op_index_t#
-
typedef uint64_t ovphysx_tensor_binding_handle_t#
- Deprecated:
Tensor-binding handle. Use ovphysx_read / ovphysx_write sessions instead.
-
typedef uint64_t ovphysx_contact_binding_handle_t#
-
typedef uint64_t ovphysx_query_handle_t#
Physics-output query (ovphysx_query).
-
typedef uint64_t ovphysx_read_handle_t#
Physics-output read session (ovphysx_read).
-
typedef uint64_t ovphysx_write_handle_t#
App-to-physics write session (ovphysx_write).
-
typedef uint64_t ovphysx_sdf_view_handle_t#
-
typedef uint64_t ovphysx_timeout_t#
Nanosecond timeout used by timeout-bearing OVPhysX APIs.
Values are nanoseconds. OVPHYSX_TIMEOUT_POLL performs one non-blocking readiness check, while OVPHYSX_TIMEOUT_INFINITE waits until completion. This local uint64_t alias is byte-identical to the shared ovx_timeout_ns_t so that it can migrate to that type without an ABI change.
-
typedef void (*ovphysx_log_callback_t)(ovphysx_log_level_t severity, ovphysx_string_t message, ovphysx_string_t channel, double timestamp, void *user_data)#
Log callback function type.
Called for each message that passes the callback’s severity and channel filters. Invocations for one registration are serialized.
Note
A callback implemented in C++ must not allow exceptions to cross this C ABI boundary.
- Param severity:
The ovphysx_log_level_t severity of the message.
- Param message:
UTF-8 message. Valid only during the callback and guaranteed null-terminated at message.ptr[message.length].
- Param channel:
UTF-8 source/channel. Valid only during the callback and guaranteed null-terminated at channel.ptr[channel.length]. An unavailable channel is delivered as {“”, 0}.
- Param timestamp:
Seconds since the Unix epoch. Always greater than zero.
- Param user_data:
Opaque pointer passed during registration.
-
typedef uint64_t ovphysx_subscription_id_t#
Subscription ID returned by ovphysx_subscribe_object_changes().
Used to identify a subscription for later unsubscribe. Treat as opaque.
-
typedef void (*ovphysx_object_created_fn)(ovphysx_string_t prim_path, ovphysx_physx_type_t type, void *user_data)#
Notification when a PhysX object is created during simulation.
Fires AFTER the object exists, so it is safe to call ovphysx_get_physx_ptr() for prim_path / type from a deferred handler.
Only fires for creations triggered by stage edits during simulation. The initial object population from ovstage attach/update is NOT notified: the caller already has that state from its setup code. See ovphysx_subscribe_object_changes() for the full lifecycle contract.
- Param prim_path:
Absolute USD prim path of the created object. The underlying storage is owned by ovphysx and only valid for the duration of the callback. Copy it to retain it. ptr is non-NULL and ptr[length] is ‘\0’.
- Param type:
The PhysX object type of the created object.
- Param user_data:
Opaque pointer passed during subscription.
-
typedef void (*ovphysx_object_destroyed_fn)(ovphysx_string_t prim_path, ovphysx_physx_type_t type, void *user_data)#
Notification when a PhysX object is about to be destroyed during simulation.
Fires BEFORE the object is destroyed. Drop any cached pointer for prim_path / type at this point. Do NOT call release() on it (ovphysx owns the lifetime).
Only fires for destructions that occur during simulation. Bulk teardown (e.g. ovphysx_reset_stage()) is delivered via ovphysx_all_objects_destroyed_fn instead, not as N individual destruction notifications.
- Param prim_path:
Absolute USD prim path of the soon-to-be-destroyed object. Same lifetime and null-termination rules as ovphysx_object_created_fn.
- Param type:
The PhysX object type that is going away.
- Param user_data:
Opaque pointer passed during subscription.
-
typedef void (*ovphysx_all_objects_destroyed_fn)(void *user_data)#
Notification when ALL PhysX objects are about to be destroyed in bulk.
Fires BEFORE the bulk teardown (e.g. on ovphysx_reset_stage()). Subscribers should flush their entire pointer cache. No per-object destruction events are delivered for this teardown.
- Param user_data:
Opaque pointer passed during subscription.
-
typedef ovphysx_result_t (*ovphysx_user_task_fn)(ovphysx_handle_t handle, ovphysx_op_index_t op_index, void *user_data)#
User task callback function type.
Called in stream order when the task executes.
- Param handle:
Physics handle
- Param op_index:
Operation index of this task
- Param user_data:
User-provided context data
- Return:
Result status (typically OVPHYSX_API_SUCCESS)
Enums
-
enum ovphysx_writability_t#
How a tensor type may be written, asked of the API rather than read from docs.
Derived from the backend’s actual getter/setter support, NOT from the
(READ-ONLY)markers in this header’s comments. Those are an incomplete index, and their absence never implied writable.Values:
-
enumerator OVPHYSX_WRITABILITY_UNCLASSIFIED#
not classified.
The write API rejects it (a gap to close, not a licence)
-
enumerator OVPHYSX_WRITABILITY_WRITABLE#
writable with no precondition beyond the object existing
-
enumerator OVPHYSX_WRITABILITY_CONDITIONAL#
writable only under a stated condition.
The write reports an unmet one
-
enumerator OVPHYSX_WRITABILITY_WRITE_ONLY#
control input consumed then cleared each step (forces, wrenches), no read-back
-
enumerator OVPHYSX_WRITABILITY_READ_ONLY#
readable only.
Writing is an error naming the type, not a silent no-op
-
enumerator OVPHYSX_WRITABILITY_UNCLASSIFIED#
-
enum ovphysx_sim_object_type_t#
Simulated object type selected by ovphysx_query().
This is the engine’s simulated type, not a USD schema predicate.
Note
This is a separate enum domain from the TensorBindings OVPHYSX_OBJECT_TYPE_* selector. In particular, OVPHYSX_OBJECT_ARTICULATION (9) must not be confused with OVPHYSX_OBJECT_TYPE_ARTICULATION (2).
Values:
-
enumerator OVPHYSX_OBJECT_RIGID_BODY#
dynamic rigid bodies (standalone + point-instancer instances)
-
enumerator OVPHYSX_OBJECT_ARTICULATION_LINK#
articulation link body transforms
-
enumerator OVPHYSX_OBJECT_ARTICULATION_JOINT#
articulation joint state (per-axis, one array group per joint)
-
enumerator OVPHYSX_OBJECT_VEHICLE_WHEEL#
vehicle wheel transforms
-
enumerator OVPHYSX_OBJECT_DEFORMABLE_VOLUME#
volume deformable meshes (points / velocities)
-
enumerator OVPHYSX_OBJECT_DEFORMABLE_SURFACE#
surface deformable meshes
-
enumerator OVPHYSX_OBJECT_PARTICLE_SET#
particle sets
-
enumerator OVPHYSX_OBJECT_FIXED_TENDON#
articulation fixed tendons (prim: joint carrying the root axis)
-
enumerator OVPHYSX_OBJECT_SPATIAL_TENDON#
articulation spatial tendons (prim: link carrying the root attachment)
-
enumerator OVPHYSX_OBJECT_ARTICULATION#
whole articulations (prim: the articulation-root API prim)
-
enumerator OVPHYSX_OBJECT_DEFORMABLE_MATERIAL#
deformable materials (prim: the bound Material prim)
-
enumerator OVPHYSX_OBJECT_RIGID_BODY#
-
enum ovphysx_object_scope_t#
Output query scope.
For OVPHYSX_OBJECT_ARTICULATION, ACTIVE includes an articulation when any link is reported by its owning scene’s active-actor set. If that scene cannot report active actors, articulation awake state is the fallback. DirectGPU currently disables sleeping, so its whole-articulation ACTIVE membership is equivalent to ALL.
Note
OVPHYSX_SCOPE_ACTIVE is SINGLE-FRAME: the active set is recomputed every step, so a query opened with it (and the groups read from it) is valid only for the step it was opened against. Re-query each frame. OVPHYSX_SCOPE_ALL is stable across steps until a structural change (object add/remove, instancer instance-count change).
Values:
-
enumerator OVPHYSX_SCOPE_ALL#
every object of the type
-
enumerator OVPHYSX_SCOPE_ACTIVE#
only objects the solver moved last step
-
enumerator OVPHYSX_SCOPE_ALL#
-
enum ovphysx_log_level_t#
The physics output-read surface uses ovstage’s own types directly rather than an ovphysx mirror (so a read group feeds straight back into the ovstage write path with no repack and no translation layer):
a read group is an
ovstage_read_group_t(from ovstage_api_types.h):data.tensors[0..tensor_count)are borrowed DLTensors (tuple width indtype.lanes),prims.listis the interned prim set,attributeis the interned EMITTED attribute token,semanticis the authored USD role (ovstage_attribute_semantic_t). For this physics-output pathis_delete == false,prims.offset == 0, and a point-instancer always emits the FULL instance array by-index (data.index_map == NULL). Slots with no live point-instancer body are zero-filled in every emitted array. In particular, an all-zeroorientationsquaternion is the absent-slot marker; live orientations are normalized and never all zero.is_arraydecides how many tensors a group carries, and reading onlytensors[0]is wrong for half of them:is_array == false(a FIXED group, e.g. rigid-body position) stacks every prim into ONE tensor.tensor_count == 1, and row i belongs to prim i ofprims.list.is_array == true(an ARRAY group, e.g. joint state, point-instancer positions, deformable points) carries ONE TENSOR PER PRIM.tensor_count == prims.count, andtensors[i]is prim i’s own variable-length array. A joint read of 16k joints is ONE group with 16k tensors, not 16k groups. Takingtensors[0]yields the first prim’s values and no error. Element type is per attribute, intensors[i].dtype. Do not assume f32. Most columns are{kDLFloat, 32}. The boolean flags (disableGravity, disableSimulation) are{kDLUInt, 8}and shapeCount is{kDLInt, 32}.dtype.lanesis the tuple width, and for a per-shape column it is the widest selected object in THAT read, so it varies between reads of the same attribute. Do not cache it.
residency is per attribute too. On a DirectGPU scene the simulated outputs (pose, velocity, acceleration, and whole-articulation centerOfMassWorld / centerOfMassLocal) are
kDLCUDA, while authored body properties (mass, inertia, centerOfMassPosition / centerOfMassOrientation, and the flags) arekDLCPU: PhysX never writes those authored values back, so there is no device copy to read. One read can therefore hand back both. Branch ontensors[i].device.device_type.discovery is an
ovstage_query_result_t(attributesis the interned token array, andtotal_prim_count == 0is the valid empty-match case).attribute names are
ovx_string_or_token_t. Pass a string (e.g. OVPHYSX_ATTR_POSITION) or an interned token from discovery, no round-trip.
The queried
ovphysx_sim_object_type_tis NOT carried on the group: a read is opened over one type, so every group belongs to the type the caller passed to ovphysx_query. Group lifetime is producer-owned (see ovphysx_fetch_read_next).Values:
-
enumerator OVPHYSX_LOG_DEFAULT#
Set-level sentinel: restore the library default (WARNING).
Never delivered
-
enumerator OVPHYSX_LOG_VERBOSE#
All messages including verbose/debug (maps to Carbonite kLevelVerbose)
-
enumerator OVPHYSX_LOG_INFO#
Info, warnings, and errors.
-
enumerator OVPHYSX_LOG_WARNING#
Warnings and errors (library default)
-
enumerator OVPHYSX_LOG_ERROR#
Error messages only.
-
enumerator OVPHYSX_LOG_NONE#
Set-level sentinel: no logging.
Never delivered
-
enum ovphysx_physx_type_t#
Identifies the type of a path-bound or process-global PhysX object.
Used with ovphysx_get_physx_ptr() to retrieve raw PhysX SDK pointers. The named constants below cover common runtime object types. Unknown values return NULL for unrecognized path/type combinations.
Enum value
PhysX SDK C++ type
OVPHYSX_PHYSX_TYPE_SCENE
physx::PxScene
OVPHYSX_PHYSX_TYPE_MATERIAL
physx::PxMaterial
OVPHYSX_PHYSX_TYPE_SHAPE
physx::PxShape
OVPHYSX_PHYSX_TYPE_COMPOUND_SHAPE
Opaque compound-shape wrapper (see note)
OVPHYSX_PHYSX_TYPE_ACTOR
physx::PxRigidDynamic/PxRigidStatic
OVPHYSX_PHYSX_TYPE_JOINT
physx::PxJoint (standalone joints)
OVPHYSX_PHYSX_TYPE_CUSTOM_JOINT
CustomPhysXJoint (plugin custom joints)
OVPHYSX_PHYSX_TYPE_ARTICULATION
physx::PxArticulationReducedCoordinate
OVPHYSX_PHYSX_TYPE_LINK
physx::PxArticulationLink
OVPHYSX_PHYSX_TYPE_LINK_JOINT
physx::PxArticulationJointReducedCoordinate
OVPHYSX_PHYSX_TYPE_PARTICLE_SYSTEM
physx::PxPBDParticleSystem
OVPHYSX_PHYSX_TYPE_PARTICLE_SET
physx::PxParticleBuffer
OVPHYSX_PHYSX_TYPE_PHYSICS
physx::PxPhysics
Note: PHYSICS names the process-global PxPhysics object and is selected with a zero-length path. Both
{ NULL, 0 }and{ "", 0 }are accepted. Every other type requires a non-empty physics-object path.See ovphysx_object_type_t for the matching high-level classification.
COMPOUND_SHAPE returns an internal compound-shape wrapper. Use the C++ helper matching the SDK build to access the underlying physx::PxShape pointers.
Values:
-
enumerator OVPHYSX_PHYSX_TYPE_SCENE#
-
enumerator OVPHYSX_PHYSX_TYPE_MATERIAL#
-
enumerator OVPHYSX_PHYSX_TYPE_SHAPE#
-
enumerator OVPHYSX_PHYSX_TYPE_COMPOUND_SHAPE#
-
enumerator OVPHYSX_PHYSX_TYPE_ACTOR#
-
enumerator OVPHYSX_PHYSX_TYPE_JOINT#
-
enumerator OVPHYSX_PHYSX_TYPE_CUSTOM_JOINT#
-
enumerator OVPHYSX_PHYSX_TYPE_ARTICULATION#
-
enumerator OVPHYSX_PHYSX_TYPE_LINK#
-
enumerator OVPHYSX_PHYSX_TYPE_LINK_JOINT#
-
enumerator OVPHYSX_PHYSX_TYPE_PARTICLE_SYSTEM#
-
enumerator OVPHYSX_PHYSX_TYPE_PARTICLE_SET#
-
enumerator OVPHYSX_PHYSX_TYPE_PHYSICS#
-
enumerator OVPHYSX_PHYSX_TYPE_SCENE#
-
enum ovphysx_object_type_t#
High-level object classification for prim paths (TensorAPI-level).
Mirrors omni::physics::tensors::ObjectType. Returned by ovphysx_get_object_type to let callers tell rigid bodies, articulations, articulation links/joints, articulation root links, and maximal-coordinate (standalone) and plugin-registered custom joints apart at a path without inspecting the PhysX SDK pointer directly.
Note
The
JOINT/ARTICULATION_JOINT/CUSTOM_JOINTsplit mirrors ovphysx_physx_type_t’sOVPHYSX_PHYSX_TYPE_JOINT,OVPHYSX_PHYSX_TYPE_LINK_JOINT, andOVPHYSX_PHYSX_TYPE_CUSTOM_JOINT.Values:
-
enumerator OVPHYSX_OBJECT_TYPE_INVALID#
No classified simulation object at the path.
-
enumerator OVPHYSX_OBJECT_TYPE_RIGID_BODY#
-
enumerator OVPHYSX_OBJECT_TYPE_ARTICULATION#
-
enumerator OVPHYSX_OBJECT_TYPE_ARTICULATION_LINK#
-
enumerator OVPHYSX_OBJECT_TYPE_ARTICULATION_ROOT_LINK#
-
enumerator OVPHYSX_OBJECT_TYPE_ARTICULATION_JOINT#
Reduced-coordinate articulation joint.
-
enumerator OVPHYSX_OBJECT_TYPE_JOINT#
Maximal-coordinate standalone joint (physx::PxJoint)
-
enumerator OVPHYSX_OBJECT_TYPE_CUSTOM_JOINT#
Plugin-registered custom joint (CustomPhysXJoint)
-
enumerator OVPHYSX_OBJECT_TYPE_INVALID#
-
enum ovphysx_articulation_kinematic_flag_t#
Bit flags for ovphysx_articulation_update_kinematic.
Mirrors PxArticulationKinematicFlag::Enum. Flags may be OR’d.
Values:
-
enumerator OVPHYSX_ARTICULATION_KINEMATIC_POSITION#
Recompute link transforms from joint positions + root pose.
-
enumerator OVPHYSX_ARTICULATION_KINEMATIC_VELOCITY#
Recompute link velocities from joint velocities + root velocity.
-
enumerator OVPHYSX_ARTICULATION_KINEMATIC_POSITION#
-
enum ovphysx_scene_query_mode_t#
Scene query mode.
Controls how many hits are returned.
Values:
-
enumerator OVPHYSX_SCENE_QUERY_MODE_CLOSEST#
Return the single closest hit (or none).
-
enumerator OVPHYSX_SCENE_QUERY_MODE_ANY#
Return whether any hit exists (0 or 1 result).
-
enumerator OVPHYSX_SCENE_QUERY_MODE_ALL#
Return all hits.
-
enumerator OVPHYSX_SCENE_QUERY_MODE_CLOSEST#
-
enum ovphysx_scene_query_geometry_type_t#
Geometry type for sweep and overlap queries.
SHAPE accepts any UsdGeomGPrim path (sphere, box, capsule, cone, cylinder, mesh, etc.). For meshes the runtime uses a convex approximation internally.
Values:
-
enumerator OVPHYSX_SCENE_QUERY_GEOMETRY_SPHERE#
Sphere defined by radius + center position.
-
enumerator OVPHYSX_SCENE_QUERY_GEOMETRY_BOX#
Oriented box defined by half-extents + pose.
-
enumerator OVPHYSX_SCENE_QUERY_GEOMETRY_SHAPE#
Arbitrary UsdGeomGPrim identified by prim path.
-
enumerator OVPHYSX_SCENE_QUERY_GEOMETRY_SPHERE#
-
enum ovphysx_api_status_t#
Values:
-
enumerator OVPHYSX_API_SUCCESS#
Operation completed or enqueued successfully.
-
enumerator OVPHYSX_API_ERROR#
Operation failed - check error field.
-
enumerator OVPHYSX_API_TIMEOUT#
Operation timed out.
-
enumerator OVPHYSX_API_NOT_IMPLEMENTED#
Feature not yet implemented.
-
enumerator OVPHYSX_API_INVALID_ARGUMENT#
Invalid argument provided.
-
enumerator OVPHYSX_API_NOT_FOUND#
Requested resource not found (handle unknown, binding invalidated)
-
enumerator OVPHYSX_API_BUFFER_TOO_SMALL#
Caller-supplied buffer is too small.
Check out_required_size
-
enumerator OVPHYSX_API_DEVICE_MISMATCH#
Tensor device cannot be used or staged for this binding/policy.
-
enumerator OVPHYSX_API_GPU_NOT_AVAILABLE#
GPU requested but not available or CUDA init failed.
-
enumerator OVPHYSX_API_END_OF_ITERATION#
Iterator exhausted (e.g.
ovphysx_fetch_read_next past the last group). Not an error
-
enumerator OVPHYSX_API_INVALID_STATE#
Operation is not valid in the instance’s current lifecycle state.
-
enumerator OVPHYSX_API_SUCCESS#
-
enum ovphysx_tensor_type_t#
Tensor type identifiers for bulk GPU data access.
Each value specifies what physical quantity the tensor represents, its shape, data type, and coordinate frame.
Coordinate conventions:
All poses and velocities are in WORLD FRAME
DOF data (positions, velocities, targets) are in JOINT SPACE
Quaternions use [qx, qy, qz, qw] ordering (xyzw)
RIGID BODY TENSORS#
OVPHYSX_TENSOR_RIGID_BODY_POSE_F32 Shape: [N, 7] where N = number of rigid bodies Layout: [px, py, pz, qx, qy, qz, qw] (position xyz, quaternion xyzw) Frame: World DType: float32
OVPHYSX_TENSOR_RIGID_BODY_VELOCITY_F32 Shape: [N, 6] where N = number of rigid bodies Layout: [vx, vy, vz, wx, wy, wz] (linear xyz, angular xyz) Frame: World DType: float32
OVPHYSX_TENSOR_RIGID_BODY_ACCELERATION_F32 Shape: [N, 6] where N = number of rigid bodies Layout: [ax, ay, az, alpha_x, alpha_y, alpha_z] (linear + angular acc) Frame: World DType: float32 Access: read-only
ARTICULATION TENSORS#
OVPHYSX_TENSOR_ARTICULATION_ROOT_POSE_F32 Shape: [N, 7] where N = number of articulations Layout: [px, py, pz, qx, qy, qz, qw] Frame: Exposed view world (subspace origin removed) DType: float32
OVPHYSX_TENSOR_ARTICULATION_ROOT_VELOCITY_F32 Shape: [N, 6] where N = number of articulations Layout: [vx, vy, vz, wx, wy, wz] Frame: World DType: float32
OVPHYSX_TENSOR_ARTICULATION_MASS_CENTER_WORLD_F32 (READ-ONLY) Shape: [N, 3] where N = number of articulations Layout: [x, y, z] center of mass per articulation Frame: Exposed view world (subspace origin removed) DType: float32 Note: Computed from PxArticulationReducedCoordinate::computeArticulationCOM(false)
OVPHYSX_TENSOR_ARTICULATION_MASS_CENTER_LOCAL_F32 (READ-ONLY) Shape: [N, 3] where N = number of articulations Layout: [x, y, z] center of mass per articulation Frame: Root link’s center-of-mass (mass) frame, not its actor/prim frame DType: float32 Note: Computed from PxArticulationReducedCoordinate::computeArticulationCOM(true)
OVPHYSX_TENSOR_ARTICULATION_CENTROIDAL_MOMENTUM_F32 (READ-ONLY) Shape: [N, 6, D + 7] where N = articulations, D = getMaxDofs() Layout: 6 spatial-momentum rows (3 linear + 3 angular) of (D + 6) matrix columns followed by 1 bias column (D + 7 total). cols [0..5] = root spatial DOFs, cols [6..D+5] = joint DOFs, col [D+6] = centroidalMomentumBias[row]. Frame: World, evaluated at the articulation COM. DType: float32 Requires: Floating-base articulations only (PhysX errors out on fixed-base). Note: Computed from PxArticulationReducedCoordinate::computeCentroidalMomentumMatrix.
ARTICULATION LINK TENSORS (3D - per-link data)#
OVPHYSX_TENSOR_ARTICULATION_LINK_POSE_F32 Shape: [N, L, 7] where N = articulations, L = max links Layout: [px, py, pz, qx, qy, qz, qw] per link Frame: World DType: float32 Note: For articulations with fewer than L links, extra entries are zero-padded
OVPHYSX_TENSOR_ARTICULATION_LINK_VELOCITY_F32 Shape: [N, L, 6] where N = articulations, L = max links Layout: [vx, vy, vz, wx, wy, wz] per link Frame: World DType: float32
ARTICULATION DOF TENSORS (joint space)#
OVPHYSX_TENSOR_ARTICULATION_DOF_POSITION_F32 Shape: [N, D] where N = articulations, D = max DOFs Layout: Joint positions in articulation DOF order Units: Radians (revolute) or meters (prismatic) DType: float32 Note: For articulations with fewer than D DOFs, extra entries are zero-padded
OVPHYSX_TENSOR_ARTICULATION_DOF_VELOCITY_F32 Shape: [N, D] Layout: Joint velocities Units: rad/s or m/s DType: float32
OVPHYSX_TENSOR_ARTICULATION_DOF_POSITION_TARGET_F32 Shape: [N, D] Layout: Position targets for position-controlled joints DType: float32
OVPHYSX_TENSOR_ARTICULATION_DOF_VELOCITY_TARGET_F32 Shape: [N, D] Layout: Velocity targets for velocity-controlled joints DType: float32
OVPHYSX_TENSOR_ARTICULATION_DOF_ACTUATION_FORCE_F32 Shape: [N, D] Layout: Actuation forces/torques applied to joints. Units: N or Nm DType: float32
NOTE: This reads the staging buffer associated with the PhysX GPU joint-force API (write-only internally). Depending on simulation settings, it may not match the solver-applied joint forces for the current step.
RIGID BODY PROPERTY TENSORS (standalone non-articulated bodies)#
OVPHYSX_TENSOR_RIGID_BODY_MASS_F32 Shape: [N] where N = number of rigid bodies Layout: scalar mass per body Units: kilograms DType: float32
OVPHYSX_TENSOR_RIGID_BODY_INV_MASS_F32 Shape: [N] where N = number of rigid bodies Layout: scalar inverse mass per body Units: 1/kg DType: float32 Access: read-only
OVPHYSX_TENSOR_RIGID_BODY_INERTIA_F32 Shape: [N, 9] where N = number of rigid bodies Layout: row-major 3x3 inertia tensor in center-of-mass frame Units: kg*m^2 DType: float32
OVPHYSX_TENSOR_RIGID_BODY_INV_INERTIA_F32 Shape: [N, 9] where N = number of rigid bodies Layout: row-major 3x3 inverse inertia tensor in center-of-mass frame Units: 1/(kg*m^2) DType: float32 Access: read-only
OVPHYSX_TENSOR_RIGID_BODY_DISABLE_SIMULATION_BOOL Shape: [N] where N = number of rigid bodies Layout: per-body byte. Nonzero disables simulation, zero enables. DType: bool / uint8 Access: read/write. Writes apply at runtime (engine toggles PxActorFlag::eDISABLE_SIMULATION on the underlying PxRigidActor so the body stops participating in the next solver step).
OVPHYSX_TENSOR_RIGID_BODY_DISABLE_GRAVITY_BOOL Shape: [N] where N = number of rigid bodies Layout: per-body byte. Nonzero disables gravity, zero enables. DType: bool / uint8 Access: read/write. Writes apply at runtime (engine toggles PxActorFlag::eDISABLE_GRAVITY on the underlying PxRigidActor). Reads return live PhysX actor flags (post-parse internal state only).
OVPHYSX_TENSOR_RIGID_BODY_COM_POSE_F32 Shape: [N, 7] where N = number of rigid bodies Layout: [px, py, pz, qx, qy, qz, qw] (position xyz, quaternion xyzw) Frame: Local frame (relative to body origin) DType: float32
ARTICULATION LINK ACCELERATION (READ-ONLY)#
OVPHYSX_TENSOR_ARTICULATION_LINK_ACCELERATION_F32 Shape: [N, L, 6] where N = articulations, L = max links Layout: [ax, ay, az, alpha_x, alpha_y, alpha_z] (linear + angular acc) Frame: World DType: float32
ARTICULATION DOF PROPERTY TENSORS (read/write, except where noted)#
OVPHYSX_TENSOR_ARTICULATION_DOF_STIFFNESS_F32 Shape: [N, D] where N = articulations, D = max DOFs Layout: Joint stiffness values DType: float32
OVPHYSX_TENSOR_ARTICULATION_DOF_DAMPING_F32 Shape: [N, D] Layout: Joint damping values DType: float32
OVPHYSX_TENSOR_ARTICULATION_DOF_LIMIT_F32 Shape: [N, D, 2] Layout: (lower, upper) position limit per DOF DType: float32
OVPHYSX_TENSOR_ARTICULATION_DOF_MAX_VELOCITY_F32 Shape: [N, D] Layout: Maximum velocity per DOF Units: rad/s or m/s DType: float32
OVPHYSX_TENSOR_ARTICULATION_DOF_MAX_FORCE_F32 Shape: [N, D] Layout: Maximum force/torque per DOF Units: N or Nm DType: float32
OVPHYSX_TENSOR_ARTICULATION_DOF_ARMATURE_F32 Shape: [N, D] Layout: Armature (reflected inertia) per DOF DType: float32
OVPHYSX_TENSOR_ARTICULATION_DOF_FRICTION_PROPERTIES_F32 Shape: [N, D, 3] Layout: (static, dynamic, viscous) friction coefficients per DOF DType: float32
OVPHYSX_TENSOR_ARTICULATION_DOF_DRIVE_MODEL_F32 Shape: [N, D, 3] Layout: (speedEffortGradient, maxActuatorVelocity, velocityDependentResistance) per DOF DType: float32 Note: only DOFs with PhysxDrivePerformanceEnvelopeAPI applied in USD accept writes. Writes to other DOFs are silently dropped.
OVPHYSX_TENSOR_ARTICULATION_DOF_DRIVE_TYPE_U8 Shape: [N, D] where N = articulations, D = max DOFs (zero-padded) Layout: per-DOF byte in solver DOF order. 0 = no drive, 1 = force, 2 = acceleration. DType: uint8 Access: read-only. Reads return the live PxArticulationDrive driveType. Trailing padded DOF columns beyond numDofs read as 0.
ARTICULATION BODY PROPERTY TENSORS (read/write, except where noted)#
OVPHYSX_TENSOR_ARTICULATION_BODY_MASS_F32 Shape: [N, L] where N = articulations, L = max links Layout: Mass per link Units: kilograms DType: float32
OVPHYSX_TENSOR_ARTICULATION_BODY_COM_POSE_F32 Shape: [N, L, 7] Layout: [px, py, pz, qx, qy, qz, qw] (COM local pose per link) Frame: Local frame (relative to link origin) DType: float32
OVPHYSX_TENSOR_ARTICULATION_BODY_INERTIA_F32 Shape: [N, L, 9] Layout: row-major 3x3 inertia tensor in COM frame per link Units: kg*m^2 DType: float32
OVPHYSX_TENSOR_ARTICULATION_BODY_INV_MASS_F32 (READ-ONLY) Shape: [N, L] Layout: Inverse mass (1/m) per link DType: float32
OVPHYSX_TENSOR_ARTICULATION_BODY_INV_INERTIA_F32 (READ-ONLY) Shape: [N, L, 9] Layout: row-major 3x3 inverse inertia in COM frame per link DType: float32
OVPHYSX_TENSOR_ARTICULATION_BODY_DISABLE_GRAVITY_BOOL Shape: [N, L] where N = articulations, L = max links (zero-padded) Layout: per-link byte in solver link order. Nonzero disables gravity. DType: bool / uint8 Access: read/write. Writes apply at runtime (engine toggles PxActorFlag::eDISABLE_GRAVITY on each link actor). Trailing padded link columns beyond numLinks are ignored on write. Reads return live PhysX actor flags (post-parse internal state only).
INVERSE DYNAMICS QUERY TENSORS (READ-ONLY)#
Generalized joint coordinates follow the authored USD body relationship: their sign is +1 when body0 is the articulation parent and -1 when body1 is the parent. Let S_dof contain those signs and let T=S_dof for a fixed base or T=diag(I6,S_dof) for a floating base. The returned quantities satisfy J=J_physx*T, M=T*M_physx*T, c=T*c_physx, g=T*g_physx, and [A|b]=[A_physx*T|b_physx] for the packed centroidal matrix and bias. The six floating-root coordinates and centroidal bias are unchanged. Angular generalized- coordinate dimensions use radians and receive no degree conversion. Prismatic and floating-translation dimensions retain their linear units.
OVPHYSX_TENSOR_ARTICULATION_JACOBIAN_F32 Shape: [N, R, C] where R, C come from getJacobianShape() Fixed-base: R = (numLinks - 1) * 6, C = numDofs Floating-base: R = (numLinks - 1) * 6 + 6, C = numDofs + 6 Floating-base columns: base 6 DOFs at indices 0..5, joint DOFs at 6..C-1 DType: float32
OVPHYSX_TENSOR_ARTICULATION_MASS_MATRIX_F32 Shape: [N, M, M] where M comes from getGeneralizedMassMatrixShape() Layout: Generalized (joint-space) mass matrix DType: float32
OVPHYSX_TENSOR_ARTICULATION_CORIOLIS_AND_CENTRIFUGAL_FORCE_F32 Shape: [N, M] Layout: Combined Coriolis and centrifugal compensation forces DType: float32
OVPHYSX_TENSOR_ARTICULATION_GRAVITY_FORCE_F32 Shape: [N, M] Layout: Gravity compensation forces DType: float32
OVPHYSX_TENSOR_ARTICULATION_LINK_INCOMING_JOINT_FORCE_F32 Shape: [N, L, 6] Layout: [fx, fy, fz, tx, ty, tz] per link incoming joint force DType: float32
OVPHYSX_TENSOR_ARTICULATION_DOF_PROJECTED_JOINT_FORCE_F32 Shape: [N, D] Layout: Projected joint forces per DOF DType: float32
FIXED TENDON PROPERTY TENSORS (read/write, require articulation with tendons)#
OVPHYSX_TENSOR_ARTICULATION_FIXED_TENDON_STIFFNESS_F32 Shape: [N, T] where N = articulations, T = max fixed tendons Layout: Tendon stiffness DType: float32
OVPHYSX_TENSOR_ARTICULATION_FIXED_TENDON_DAMPING_F32 Shape: [N, T] Layout: Tendon damping DType: float32
OVPHYSX_TENSOR_ARTICULATION_FIXED_TENDON_LIMIT_STIFFNESS_F32 Shape: [N, T] Layout: Stiffness of the tendon length limit spring DType: float32
OVPHYSX_TENSOR_ARTICULATION_FIXED_TENDON_LIMIT_F32 Shape: [N, T, 2] Layout: (lower, upper) tendon length limits DType: float32
OVPHYSX_TENSOR_ARTICULATION_FIXED_TENDON_REST_LENGTH_F32 Shape: [N, T] Layout: Tendon rest length DType: float32
OVPHYSX_TENSOR_ARTICULATION_FIXED_TENDON_OFFSET_F32 Shape: [N, T] Layout: Tendon offset DType: float32
SPATIAL TENDON PROPERTY TENSORS (read/write, require articulation with spatial tendons)#
OVPHYSX_TENSOR_ARTICULATION_SPATIAL_TENDON_STIFFNESS_F32 Shape: [N, T] where N = articulations, T = max spatial tendons Layout: Spatial tendon stiffness DType: float32
OVPHYSX_TENSOR_ARTICULATION_SPATIAL_TENDON_DAMPING_F32 Shape: [N, T] Layout: Spatial tendon damping DType: float32
OVPHYSX_TENSOR_ARTICULATION_SPATIAL_TENDON_LIMIT_STIFFNESS_F32 Shape: [N, T] Layout: Stiffness of the spatial tendon length limit spring DType: float32
OVPHYSX_TENSOR_ARTICULATION_SPATIAL_TENDON_OFFSET_F32 Shape: [N, T] Layout: Spatial tendon offset DType: float32
VOLUME DEFORMABLE BODY TENSORS#
OVPHYSX_TENSOR_DEFORMABLE_SIM_NODAL_POSITION_F32 Shape: [N, V, 3] where N = deformable bodies, V = max simulation nodes Layout: simulation mesh node positions DType: float32
OVPHYSX_TENSOR_DEFORMABLE_SIM_NODAL_VELOCITY_F32 Shape: [N, V, 3] Layout: simulation mesh node velocities DType: float32
OVPHYSX_TENSOR_DEFORMABLE_SIM_KINEMATIC_TARGET_F32 Shape: [N, V, 4] Layout: simulation mesh kinematic targets (xyz position, flag) DType: float32
OVPHYSX_TENSOR_DEFORMABLE_REST_NODAL_POSITION_F32 Shape: [N, R, 3] where R = max rest nodes Layout: rest mesh node positions DType: float32 Access: read-only
OVPHYSX_TENSOR_DEFORMABLE_SIM_ELEMENT_INDICES_S32 Shape: [N, E, K] where E = max simulation elements, K = nodes per element (4 for tetmesh) Layout: simulation element node indices DType: int32 Access: read-only
OVPHYSX_TENSOR_DEFORMABLE_COLLISION_ELEMENT_INDICES_S32 Shape: [N, F, 4] where F = max collision elements. K is always 4 (matches backend fetchData) Layout: collision element node indices (tetrahedral, 4 nodes per element) DType: int32 Access: read-only
SURFACE DEFORMABLE BODY TENSORS#
OVPHYSX_TENSOR_SURFACE_DEFORMABLE_SIM_POSITION_F32 Shape: [N, V, 3] where N = surface deformable bodies, V = max simulation nodes Layout: simulation mesh node positions DType: float32
OVPHYSX_TENSOR_SURFACE_DEFORMABLE_SIM_VELOCITY_F32 Shape: [N, V, 3] Layout: simulation mesh node velocities DType: float32
OVPHYSX_TENSOR_SURFACE_DEFORMABLE_REST_POSITION_F32 Shape: [N, R, 3] where R = max rest nodes Layout: rest mesh node positions DType: float32 Access: read-only
OVPHYSX_TENSOR_SURFACE_DEFORMABLE_SIM_ELEMENT_INDICES_S32 Shape: [N, E, 3] where E = max simulation elements (triangles) Layout: simulation element node indices DType: int32 Access: read-only
DEFORMABLE MATERIAL TENSORS#
OVPHYSX_TENSOR_DEFORMABLE_MATERIAL_DYNAMIC_FRICTION_F32 Shape: [M] where M = deformable materials Layout: scalar dynamic friction DType: float32
OVPHYSX_TENSOR_DEFORMABLE_MATERIAL_YOUNGS_MODULUS_F32 Shape: [M] Layout: scalar Young’s modulus DType: float32
OVPHYSX_TENSOR_DEFORMABLE_MATERIAL_POISSONS_RATIO_F32 Shape: [M] Layout: scalar Poisson’s ratio DType: float32
OVPHYSX_TENSOR_DEFORMABLE_MATERIAL_ELASTICITY_DAMPING_F32 Shape: [M] Layout: scalar elasticity damping (volume + surface materials) DType: float32
OVPHYSX_TENSOR_DEFORMABLE_MATERIAL_BENDING_STIFFNESS_F32 Shape: [M] Layout: scalar bending stiffness (surface materials only, 0.0 for volume material entries) DType: float32
OVPHYSX_TENSOR_DEFORMABLE_MATERIAL_THICKNESS_F32 Shape: [M] Layout: scalar thickness (surface materials only, 0.0 for volume material entries) DType: float32
OVPHYSX_TENSOR_DEFORMABLE_MATERIAL_BENDING_DAMPING_F32 Shape: [M] Layout: scalar bending damping (surface materials only, 0.0 for volume material entries) DType: float32
- Deprecated:
The tensor-binding API is deprecated. Use ovphysx_read (reads) and ovphysx_write (writes) instead.
Values:
-
enumerator OVPHYSX_TENSOR_INVALID#
-
enumerator OVPHYSX_TENSOR_RIGID_BODY_POSE_F32#
[N, 7] poses in world frame
-
enumerator OVPHYSX_TENSOR_RIGID_BODY_VELOCITY_F32#
[N, 6] velocities in world frame
-
enumerator OVPHYSX_TENSOR_RIGID_BODY_ACCELERATION_F32#
[N, 6] accelerations in world frame (READ-ONLY)
-
enumerator OVPHYSX_TENSOR_RIGID_BODY_MASS_F32#
[N] mass per body
-
enumerator OVPHYSX_TENSOR_RIGID_BODY_INERTIA_F32#
[N, 9] row-major 3x3 inertia tensor
-
enumerator OVPHYSX_TENSOR_RIGID_BODY_COM_POSE_F32#
[N, 7] COM local pose (px,py,pz,qx,qy,qz,qw)
-
enumerator OVPHYSX_TENSOR_RIGID_BODY_INV_MASS_F32#
[N] inverse mass per body (READ-ONLY)
-
enumerator OVPHYSX_TENSOR_RIGID_BODY_INV_INERTIA_F32#
[N, 9] inverse inertia tensor (READ-ONLY)
-
enumerator OVPHYSX_TENSOR_RIGID_BODY_DISABLE_SIMULATION_BOOL#
[N] uint8/bool.
Nonzero disables, zero enables PxActorFlag::eDISABLE_SIMULATION at runtime
-
enumerator OVPHYSX_TENSOR_ARTICULATION_ROOT_POSE_F32#
[N, 7] root poses in exposed view world frame
-
enumerator OVPHYSX_TENSOR_ARTICULATION_ROOT_VELOCITY_F32#
[N, 6] root velocities
-
enumerator OVPHYSX_TENSOR_ARTICULATION_MASS_CENTER_WORLD_F32#
[N, 3] articulation COM in exposed view world frame (READ-ONLY)
-
enumerator OVPHYSX_TENSOR_ARTICULATION_MASS_CENTER_LOCAL_F32#
[N, 3] articulation COM in root-link mass frame (READ-ONLY)
-
enumerator OVPHYSX_TENSOR_ARTICULATION_CENTROIDAL_MOMENTUM_F32#
[N, 6, D+7] centroidal momentum matrix + bias column, floating-base only (READ-ONLY)
-
enumerator OVPHYSX_TENSOR_ARTICULATION_LINK_POSE_F32#
[N, L, 7] link poses
-
enumerator OVPHYSX_TENSOR_ARTICULATION_LINK_VELOCITY_F32#
[N, L, 6] link velocities
-
enumerator OVPHYSX_TENSOR_ARTICULATION_LINK_ACCELERATION_F32#
[N, L, 6] link accelerations (lin_acc xyz + ang_acc xyz), READ-ONLY
-
enumerator OVPHYSX_TENSOR_ARTICULATION_DOF_POSITION_F32#
[N, D] joint positions
-
enumerator OVPHYSX_TENSOR_ARTICULATION_DOF_VELOCITY_F32#
[N, D] joint velocities
-
enumerator OVPHYSX_TENSOR_ARTICULATION_DOF_POSITION_TARGET_F32#
[N, D] position targets
-
enumerator OVPHYSX_TENSOR_ARTICULATION_DOF_VELOCITY_TARGET_F32#
[N, D] velocity targets
-
enumerator OVPHYSX_TENSOR_ARTICULATION_DOF_ACTUATION_FORCE_F32#
[N, D] actuation forces
-
enumerator OVPHYSX_TENSOR_ARTICULATION_DOF_STIFFNESS_F32#
[N, D] joint stiffness
-
enumerator OVPHYSX_TENSOR_ARTICULATION_DOF_DAMPING_F32#
[N, D] joint damping
-
enumerator OVPHYSX_TENSOR_ARTICULATION_DOF_LIMIT_F32#
[N, D, 2] (lower, upper) per DOF
-
enumerator OVPHYSX_TENSOR_ARTICULATION_DOF_MAX_VELOCITY_F32#
[N, D] max velocity per DOF
-
enumerator OVPHYSX_TENSOR_ARTICULATION_DOF_MAX_FORCE_F32#
[N, D] max force per DOF
-
enumerator OVPHYSX_TENSOR_ARTICULATION_DOF_ARMATURE_F32#
[N, D] armature per DOF
-
enumerator OVPHYSX_TENSOR_ARTICULATION_DOF_FRICTION_PROPERTIES_F32#
[N, D, 3] (static, dynamic, viscous)
-
enumerator OVPHYSX_TENSOR_ARTICULATION_DOF_DRIVE_MODEL_F32#
[N, D, 3] (speedEffortGradient, maxActuatorVelocity, velocityDependentResistance)
-
enumerator OVPHYSX_TENSOR_ARTICULATION_DOF_DRIVE_TYPE_U8#
[N, D] uint8 drive type per DOF.
0=none, 1=force, 2=acceleration (READ-ONLY)
-
enumerator OVPHYSX_TENSOR_RIGID_BODY_FORCE_F32#
External forces/wrenches - WRITE-ONLY (control inputs applied each step).
All components are in global (world) frame, including application position.
WRENCH layout: [fx, fy, fz, tx, ty, tz, px, py, pz]
(fx,fy,fz) = force vector in world frame
(tx,ty,tz) = torque vector in world frame
(px,py,pz) = force application position in world frame [N, 3] forces at center of mass
-
enumerator OVPHYSX_TENSOR_RIGID_BODY_WRENCH_F32#
[N, 9] row-major: [fx,fy,fz,tx,ty,tz,px,py,pz] per body
-
enumerator OVPHYSX_TENSOR_ARTICULATION_LINK_WRENCH_F32#
[N, L, 9] row-major: same layout per link
-
enumerator OVPHYSX_TENSOR_ARTICULATION_BODY_MASS_F32#
[N, L] mass per link
-
enumerator OVPHYSX_TENSOR_ARTICULATION_BODY_COM_POSE_F32#
[N, L, 7] COM local pose (px,py,pz,qx,qy,qz,qw)
-
enumerator OVPHYSX_TENSOR_ARTICULATION_BODY_INERTIA_F32#
[N, L, 9] row-major 3x3 inertia in COM frame
-
enumerator OVPHYSX_TENSOR_ARTICULATION_BODY_INV_MASS_F32#
[N, L] inverse mass (1/m) per link (READ-ONLY)
-
enumerator OVPHYSX_TENSOR_ARTICULATION_BODY_INV_INERTIA_F32#
[N, L, 9] inverse inertia in COM frame (READ-ONLY)
-
enumerator OVPHYSX_TENSOR_ARTICULATION_BODY_DISABLE_GRAVITY_BOOL#
[N, L] uint8/bool.
Nonzero disables PxActorFlag::eDISABLE_GRAVITY per link at runtime
-
enumerator OVPHYSX_TENSOR_ARTICULATION_JACOBIAN_F32#
[N, R, C] from getJacobianShape().
For fixed-base: R = (numLinks-1)*6, C = numDofs. For floating-base: R = (numLinks-1)*6 + 6, C = numDofs + 6. Floating-base columns: base 6 DOFs at indices 0..5, joint DOFs at 6..C-1.
-
enumerator OVPHYSX_TENSOR_ARTICULATION_MASS_MATRIX_F32#
[N, M, M] from getGeneralizedMassMatrixShape()
-
enumerator OVPHYSX_TENSOR_ARTICULATION_CORIOLIS_AND_CENTRIFUGAL_FORCE_F32#
[N, M] Coriolis + centrifugal forces (both terms, from getCoriolisAndCentrifugalCompensationForces())
-
enumerator OVPHYSX_TENSOR_ARTICULATION_GRAVITY_FORCE_F32#
[N, M] gravity compensation
-
enumerator OVPHYSX_TENSOR_ARTICULATION_LINK_INCOMING_JOINT_FORCE_F32#
[N, L, 6] per-link incoming joint force
-
enumerator OVPHYSX_TENSOR_ARTICULATION_DOF_PROJECTED_JOINT_FORCE_F32#
[N, D] projected joint forces (READ-ONLY)
-
enumerator OVPHYSX_TENSOR_ARTICULATION_FIXED_TENDON_STIFFNESS_F32#
[N, T] tendon stiffness
-
enumerator OVPHYSX_TENSOR_ARTICULATION_FIXED_TENDON_DAMPING_F32#
[N, T] tendon damping
-
enumerator OVPHYSX_TENSOR_ARTICULATION_FIXED_TENDON_LIMIT_STIFFNESS_F32#
[N, T] tendon limit stiffness
-
enumerator OVPHYSX_TENSOR_ARTICULATION_FIXED_TENDON_LIMIT_F32#
[N, T, 2] (lower, upper) tendon limits
-
enumerator OVPHYSX_TENSOR_ARTICULATION_FIXED_TENDON_REST_LENGTH_F32#
[N, T] tendon rest length
-
enumerator OVPHYSX_TENSOR_ARTICULATION_FIXED_TENDON_OFFSET_F32#
[N, T] tendon offset
-
enumerator OVPHYSX_TENSOR_ARTICULATION_SPATIAL_TENDON_STIFFNESS_F32#
[N, T] spatial tendon stiffness
-
enumerator OVPHYSX_TENSOR_ARTICULATION_SPATIAL_TENDON_DAMPING_F32#
[N, T] spatial tendon damping
-
enumerator OVPHYSX_TENSOR_ARTICULATION_SPATIAL_TENDON_LIMIT_STIFFNESS_F32#
[N, T] spatial tendon limit stiffness
-
enumerator OVPHYSX_TENSOR_ARTICULATION_SPATIAL_TENDON_OFFSET_F32#
[N, T] spatial tendon offset
-
enumerator OVPHYSX_TENSOR_RIGID_BODY_SHAPE_FRICTION_AND_RESTITUTION_F32#
[N, S, 3] (static friction, dynamic friction, restitution) per shape
-
enumerator OVPHYSX_TENSOR_RIGID_BODY_CONTACT_OFFSET_F32#
[N, S] contact offset per shape
-
enumerator OVPHYSX_TENSOR_RIGID_BODY_REST_OFFSET_F32#
[N, S] rest offset per shape
-
enumerator OVPHYSX_TENSOR_RIGID_BODY_DISABLE_GRAVITY_BOOL#
[N] uint8/bool.
Nonzero disables PxActorFlag::eDISABLE_GRAVITY at runtime
-
enumerator OVPHYSX_TENSOR_ARTICULATION_SHAPE_FRICTION_AND_RESTITUTION_F32#
[N, S, 3] (static friction, dynamic friction, restitution) per link shape
-
enumerator OVPHYSX_TENSOR_ARTICULATION_CONTACT_OFFSET_F32#
[N, S] contact offset per link shape
-
enumerator OVPHYSX_TENSOR_ARTICULATION_REST_OFFSET_F32#
[N, S] rest offset per link shape
-
enumerator OVPHYSX_TENSOR_DEFORMABLE_SIM_NODAL_POSITION_F32#
[N, V, 3] simulation node positions
-
enumerator OVPHYSX_TENSOR_DEFORMABLE_SIM_NODAL_VELOCITY_F32#
[N, V, 3] simulation node velocities
-
enumerator OVPHYSX_TENSOR_DEFORMABLE_SIM_KINEMATIC_TARGET_F32#
[N, V, 4] simulation node kinematic targets (xyz, flag)
-
enumerator OVPHYSX_TENSOR_DEFORMABLE_REST_NODAL_POSITION_F32#
[N, R, 3] rest node positions (READ-ONLY)
-
enumerator OVPHYSX_TENSOR_DEFORMABLE_SIM_ELEMENT_INDICES_S32#
[N, E, K] simulation element indices, K=4 tetmesh (int32, READ-ONLY)
-
enumerator OVPHYSX_TENSOR_DEFORMABLE_COLLISION_ELEMENT_INDICES_S32#
[N, F, 4] collision element indices, K=4 tetmesh (int32, READ-ONLY)
-
enumerator OVPHYSX_TENSOR_SURFACE_DEFORMABLE_SIM_POSITION_F32#
[N, V, 3] simulation node positions
-
enumerator OVPHYSX_TENSOR_SURFACE_DEFORMABLE_SIM_VELOCITY_F32#
[N, V, 3] simulation node velocities
-
enumerator OVPHYSX_TENSOR_SURFACE_DEFORMABLE_REST_POSITION_F32#
[N, R, 3] rest node positions (READ-ONLY)
-
enumerator OVPHYSX_TENSOR_SURFACE_DEFORMABLE_SIM_ELEMENT_INDICES_S32#
[N, E, 3] simulation element indices, K=3 trimesh (int32, READ-ONLY)
-
enumerator OVPHYSX_TENSOR_DEFORMABLE_MATERIAL_DYNAMIC_FRICTION_F32#
[M] dynamic friction
-
enumerator OVPHYSX_TENSOR_DEFORMABLE_MATERIAL_YOUNGS_MODULUS_F32#
[M] Young’s modulus
-
enumerator OVPHYSX_TENSOR_DEFORMABLE_MATERIAL_POISSONS_RATIO_F32#
[M] Poisson’s ratio
-
enumerator OVPHYSX_TENSOR_DEFORMABLE_MATERIAL_ELASTICITY_DAMPING_F32#
[M] elasticity damping (volume + surface)
-
enumerator OVPHYSX_TENSOR_DEFORMABLE_MATERIAL_BENDING_STIFFNESS_F32#
[M] bending stiffness (surface only, 0 for volume)
-
enumerator OVPHYSX_TENSOR_DEFORMABLE_MATERIAL_THICKNESS_F32#
[M] thickness (surface only, 0 for volume)
-
enumerator OVPHYSX_TENSOR_DEFORMABLE_MATERIAL_BENDING_DAMPING_F32#
[M] bending damping (surface only, 0 for volume)
-
enum ovphysx_config_key_type_t#
Config key type discriminator - selects which key/value union members are valid.
Values:
-
enumerator OVPHYSX_CONFIG_KEY_TYPE_BOOL#
Key from ovphysx_config_bool_t, value is bool.
-
enumerator OVPHYSX_CONFIG_KEY_TYPE_INT32#
Key from ovphysx_config_int32_t, value is int32_t.
-
enumerator OVPHYSX_CONFIG_KEY_TYPE_FLOAT#
Key from ovphysx_config_float_t, value is float.
-
enumerator OVPHYSX_CONFIG_KEY_TYPE_STRING#
Key from ovphysx_config_string_t, value is ovphysx_string_t.
-
enumerator OVPHYSX_CONFIG_KEY_TYPE_CARBONITE#
Escape hatch: arbitrary Carbonite path (string key + string value)
-
enumerator OVPHYSX_CONFIG_KEY_TYPE_COUNT#
-
enumerator OVPHYSX_CONFIG_KEY_TYPE_BOOL#
-
enum ovphysx_config_bool_t#
Boolean config keys.
Value type: bool.
Values:
-
enumerator OVPHYSX_CONFIG_DISABLE_CONTACT_PROCESSING#
/physics/disableContactProcessing
-
enumerator OVPHYSX_CONFIG_COLLISION_CONE_CUSTOM_GEOMETRY#
/physics/collisionConeCustomGeometry
-
enumerator OVPHYSX_CONFIG_COLLISION_CYLINDER_CUSTOM_GEOMETRY#
/physics/collisionCylinderCustomGeometry
-
enumerator OVPHYSX_CONFIG_OMNIPVD_OUTPUT_ENABLED#
/physics/omniPvdOutputEnabled
-
enumerator OVPHYSX_CONFIG_NVTX_ENABLED#
/physics/nvtxEnabled: emit NVTX ranges for capture with Nsight Systems.
Equivalent to setting OVPHYSX_NVTX=1 in the environment.
-
enumerator OVPHYSX_CONFIG_OMNIPVD_RECORDING_CAPABLE#
/physics/omniPvdRecordingCapable
-
enumerator OVPHYSX_CONFIG_BOOL_COUNT#
-
enumerator OVPHYSX_CONFIG_DISABLE_CONTACT_PROCESSING#
-
enum ovphysx_config_int32_t#
Int32 config keys.
Value type: int32_t.
Values:
-
enumerator OVPHYSX_CONFIG_NUM_THREADS#
/physics/numThreads
-
enumerator OVPHYSX_CONFIG_SCENE_MULTI_GPU_MODE#
/physics/sceneMultiGPUMode (0=disabled, 1=all, 2=skip-first).
Used only when active_cuda_gpus is empty
-
enumerator OVPHYSX_CONFIG_OMNIPVD_TCP_PORT#
/physics/omniPvdTcpPort
-
enumerator OVPHYSX_CONFIG_OMNIPVD_TCP_TIMEOUT_MS#
/physics/omniPvdTcpTimeoutMs
-
enumerator OVPHYSX_CONFIG_OVSTAGE_READ_POOL_MAX_MB#
/physics/ovstageReadPoolMaxMB: device read-buffer pool retention budget in MiB.
0 or less disables the pool (default 256)
-
enumerator OVPHYSX_CONFIG_INT32_COUNT#
-
enumerator OVPHYSX_CONFIG_NUM_THREADS#
-
enum ovphysx_config_float_t#
Float config keys (reserved for future use).
Value type: float.
Values:
-
enumerator OVPHYSX_CONFIG_FLOAT_COUNT#
-
enumerator OVPHYSX_CONFIG_FLOAT_COUNT#
-
enum ovphysx_config_string_t#
String config keys.
Value type: ovphysx_string_t.
Values:
-
enumerator OVPHYSX_CONFIG_OMNIPVD_OVD_RECORDING_DIRECTORY#
/persistent/physics/omniPvdOvdRecordingDirectory
-
enumerator OVPHYSX_CONFIG_COOKED_COLLIDER_CACHE_DIRECTORY#
/UJITSO/datastore/localCachePath: application-provided dir for the local cooked-collider cache.
Unset cooks to a process-private temp dir (nothing persists)
-
enumerator OVPHYSX_CONFIG_OMNIPVD_TRANSPORT#
/physics/omniPvdTransport
-
enumerator OVPHYSX_CONFIG_OMNIPVD_TCP_ADDRESS#
/physics/omniPvdTcpAddress
-
enumerator OVPHYSX_CONFIG_STRING_COUNT#
-
enumerator OVPHYSX_CONFIG_OMNIPVD_OVD_RECORDING_DIRECTORY#
-
enum ovphysx_omnipvd_transport_t#
Destination transport for a late OmniPVD recording.
Values:
-
enumerator OVPHYSX_OMNIPVD_TRANSPORT_FILE#
Write one exact .ovd file path.
-
enumerator OVPHYSX_OMNIPVD_TRANSPORT_TCP#
Connect to one TCP listener.
-
enumerator OVPHYSX_OMNIPVD_TRANSPORT_FILE#
-
enum ovphysx_debug_render_parameter_t#
PhysX debug-visualization parameters for ovphysx_debug_render_set_parameter() / _get_parameter().
Mirrors omni::physx::PhysXVisualizationParameter. A static_assert in the sidecar TU keeps the two enums aligned, so these named constants are the stable, reorder-proof public spelling of the otherwise-opaque integer index. NONE (0) and COUNT (one-past-the-end) are NOT valid parameters: ovphysx_debug_render_set_parameter() rejects them with OVPHYSX_API_INVALID_ARGUMENT.
Values:
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_NONE#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_WORLD_AXES#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_BODY_AXES#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_BODY_MASS_AXES#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_BODY_LINEAR_VELOCITY#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_BODY_ANGULAR_VELOCITY#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_CONTACT_POINT#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_CONTACT_NORMAL#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_CONTACT_ERROR#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_CONTACT_IMPULSE#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_FRICTION_POINT#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_FRICTION_NORMAL#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_FRICTION_IMPULSE#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_ACTOR_AXES#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_COLLISION_AABBS#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_COLLISION_SHAPES#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_COLLISION_AXES#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_COLLISION_COMPOUNDS#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_COLLISION_FACE_NORMALS#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_COLLISION_EDGES#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_COLLISION_STATIC_PRUNER#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_COLLISION_DYNAMIC_PRUNER#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_JOINT_LOCAL_FRAMES#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_JOINT_LIMITS#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_CULL_BOX#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_MBP_REGIONS#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_SIMULATION_MESH#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_SDF#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_COUNT#
-
enumerator OVPHYSX_DEBUG_RENDER_PARAM_NONE#
Functions
-
static inline ovphysx_string_t ovphysx_cstr(const char *cstr)#
Helper function to create ovphysx_string_t from a null-terminated C string.
Returns empty string if cstr is NULL.
-
struct ovphysx_string_t#
- #include <include/ovphysx/ovphysx_types.h>
String with pointer and length.
Input strings are length-prefixed views and need not be null-terminated. Strings produced by successful ovphysx calls (return values and populated out-parameters) and strings delivered to callbacks always have a non-NULL ptr and are null-terminated: ptr[length] == ‘\0’. Always use length for comparisons and when accepting input substring views. Use OVPHYSX_LITERAL(“literal”) or ovphysx_cstr() for convenient construction.
-
struct ovphysx_object_change_callbacks_t#
- #include <include/ovphysx/ovphysx_types.h>
Callback set passed to ovphysx_subscribe_object_changes().
Any of the function-pointer fields may be NULL. ovphysx skips a NULL field rather than invoking it. The caller does NOT need to keep this struct alive after the subscribe call returns, because ovphysx copies the relevant state internally.
Threading: callbacks may fire from internal worker threads during ovphysx_step(), ovphysx_step_sync(), or ovphysx_reset_stage(). Do NOT call other ovphysx APIs from inside a callback (re-entrancy / deadlock risk). Defer follow-up work until the triggering synchronous call returns, or until the next ovphysx_wait_op() returns for async work.
Public Members
-
ovphysx_object_created_fn on_object_created#
Fired AFTER an object is created (NULL = skip).
-
ovphysx_object_destroyed_fn on_object_destroyed#
Fired BEFORE an object is destroyed (NULL = skip).
-
ovphysx_all_objects_destroyed_fn on_all_objects_destroyed#
Fired BEFORE a bulk teardown (NULL = skip).
-
void *user_data#
Opaque pointer passed unchanged to every callback.
-
ovphysx_object_created_fn on_object_created#
-
struct ovphysx_scene_query_geometry_desc_t#
- #include <include/ovphysx/ovphysx_types.h>
Geometry descriptor for sweep/overlap queries.
Set
typeand fill the corresponding union member.Public Members
-
float radius#
Sphere radius.
-
float position[3]#
Sphere center (world space).
Box center (world space).
-
struct ovphysx_scene_query_geometry_desc_t::[anonymous]::[anonymous] sphere#
-
float half_extent[3]#
Box half-extents.
-
float rotation[4]#
Box orientation quaternion (x, y, z, w).
-
struct ovphysx_scene_query_geometry_desc_t::[anonymous]::[anonymous] box#
-
ovphysx_string_t prim_path#
USD prim path for any UsdGeomGPrim (embedded NUL bytes are rejected).
-
struct ovphysx_scene_query_geometry_desc_t::[anonymous]::[anonymous] shape#
-
union ovphysx_scene_query_geometry_desc_t::[anonymous] [anonymous]#
-
float radius#
-
struct ovphysx_scene_query_hit_t#
- #include <include/ovphysx/ovphysx_types.h>
Scene query hit result.
Used for raycast, sweep, and overlap queries. For overlap queries the location fields (normal, position, distance, face_index, material) are zeroed. Only the object identity fields are populated.
Path fields (collision, rigid_body, material) hold an opaque omni::physics::parse::ObjectKey.handle, a runtime-assigned identity, not a uint64-encoded SdfPath. There is no client-side bit-cast that reproduces or compares against it. Resolve it to a prim path with ovphysx_scene_query_get_paths_from_ids().
Public Members
-
uint64_t collision#
Collision shape identity (opaque ObjectKey.handle).
-
uint64_t rigid_body#
Rigid body identity (opaque ObjectKey.handle).
-
uint32_t proto_index#
Point instancer prototype index (0xFFFFFFFF if N/A).
-
float normal[3]#
Hit normal (world space).
Zero for overlap queries.
-
float position[3]#
Hit position (world space).
Zero for overlap queries.
-
float distance#
Hit distance along ray/sweep direction.
Zero for overlap.
-
uint32_t face_index#
Triangle mesh face index.
Zero for non-mesh hits.
-
uint64_t material#
Material identity (opaque ObjectKey.handle).
Zero for overlap.
-
uint64_t collision#
-
struct ovphysx_result_t#
- #include <include/ovphysx/ovphysx_types.h>
Result returned by synchronous API functions.
On failure (status != OVPHYSX_API_SUCCESS), call ovphysx_get_last_error() on the same thread to retrieve the error message.
Public Members
-
ovphysx_api_status_t status#
Operation status code.
-
ovphysx_api_status_t status#
-
struct ovphysx_enqueue_result_t#
- #include <include/ovphysx/ovphysx_types.h>
Result returned by asynchronous API functions.
On failure (status != OVPHYSX_API_SUCCESS), call ovphysx_get_last_error() on the same thread to retrieve the error message.
Public Members
-
ovphysx_api_status_t status#
Operation status code.
-
ovphysx_op_index_t op_index#
Operation index for async tracking.
-
ovphysx_api_status_t status#
-
struct ovphysx_op_wait_result_t#
- #include <include/ovphysx/ovphysx_types.h>
Result from ovphysx_wait_op() containing failed op indices and pending operation status.
For each failed op index, call ovphysx_get_last_op_error(op_index) to retrieve the error message. Free this struct via ovphysx_destroy_wait_result().
Public Members
-
ovphysx_op_index_t *error_op_indices#
Array of op indices that failed (free via ovphysx_destroy_wait_result)
-
size_t num_errors#
Number of failed op indices.
-
ovphysx_op_index_t lowest_pending_op_index#
Lowest operation index still pending, 0 if all complete.
-
ovphysx_op_index_t *error_op_indices#
-
struct ovphysx_tensor_binding_desc_t#
- #include <include/ovphysx/ovphysx_types.h>
Descriptor for creating a tensor binding.
A tensor binding connects physics-object paths to a tensor type, enabling bulk read/write of physics data for authored USD objects and runtime-only clones.
Prim selection (mutually exclusive - use ONE of these):
pattern: Glob pattern like “/World/robot*” or “/World/env[N]/robot”
prim_paths: Explicit list of exact physics-object paths
Precedence rules:
If prim_paths != NULL AND prim_paths_count > 0, uses explicit paths
Else if pattern.ptr != NULL AND pattern.length > 0, uses pattern
Else returns OVPHYSX_API_INVALID_ARGUMENT
When prim_paths is used, pattern is completely ignored (not combined).
Example with pattern: ovphysx_tensor_binding_desc_t desc = { .pattern = OVPHYSX_LITERAL(“/World/robot*”), .tensor_type = OVPHYSX_TENSOR_RIGID_BODY_POSE_F32 };
Example with explicit physics-object paths: ovphysx_string_t paths[] = { OVPHYSX_LITERAL(“/World/env1/robot”), OVPHYSX_LITERAL(“/World/env4/robot”), OVPHYSX_LITERAL(“/World/env5/robot”) }; ovphysx_tensor_binding_desc_t desc = { .prim_paths = paths, .prim_paths_count = 3, .tensor_type = OVPHYSX_TENSOR_RIGID_BODY_POSE_F32 };
- Deprecated:
The tensor-binding API is deprecated. Use ovphysx_read (reads) and ovphysx_write (writes) instead.
Public Members
-
ovphysx_string_t pattern#
Physics-object path glob (ignored if prim_paths is set)
-
const ovphysx_string_t *prim_paths#
Explicit list of exact object paths (NULL = use pattern)
-
uint32_t prim_paths_count#
Number of object paths (0 = use pattern)
-
ovphysx_tensor_type_t tensor_type#
Type of tensor data to bind.
-
struct ovphysx_tensor_spec_t#
- #include <include/ovphysx/ovphysx_types.h>
Tensor layout specification for DLTensor construction.
Use ovphysx_get_tensor_binding_spec() to get the exact dtype, rank, and shape needed to allocate a layout-compatible tensor. Query native memory residency separately with ovphysx_get_tensor_binding_native_device().
Tensor specifications by type:
Rigid body pose: ndim=2, shape=[N, 7]
Rigid body velocity: ndim=2, shape=[N, 6]
Articulation root: ndim=2, shape=[N, 7] or [N, 6]
Articulation links: ndim=3, shape=[N, L, 7] or [N, L, 6]
Articulation DOF: ndim=2, shape=[N, D]
Tensor dtype is tensor-type specific:
Most tensor types use float32 (kDLFloat, 32 bits, 1 lane)
Deformable element index tensors (DEFORMABLE_SIM_ELEMENT_INDICES_S32, DEFORMABLE_COLLISION_ELEMENT_INDICES_S32, SURFACE_DEFORMABLE_SIM_ELEMENT_INDICES_S32) use int32 (kDLInt, 32 bits, 1 lane)
OVPHYSX_TENSOR_RIGID_BODY_DISABLE_SIMULATION_BOOL, OVPHYSX_TENSOR_RIGID_BODY_DISABLE_GRAVITY_BOOL, and OVPHYSX_TENSOR_ARTICULATION_BODY_DISABLE_GRAVITY_BOOL use bool/uint8 (kDLUInt, 8 bits, 1 lane) as per-body/per-link byte flags.
OVPHYSX_TENSOR_ARTICULATION_DOF_DRIVE_TYPE_U8 also uses uint8 (kDLUInt, 8 bits, 1 lane), but as a per-DOF enum byte (0/1/2), not a flag. Always call ovphysx_get_tensor_binding_spec() and respect the returned dtype. Do not assume float32.
Layout: row-major contiguous (C-order)
- Deprecated:
The tensor-binding API is deprecated. Use ovphysx_read (reads) and ovphysx_write (writes) instead.
Public Members
-
DLDataType dtype#
DLPack data type for this tensor type.
Most bindings use float32, element-index tensors use int32, and disable-simulation/gravity bool bindings and the DOF drive-type enum binding use uint8. Always honor this field rather than assuming float32.
-
int32_t ndim#
Number of dimensions.
-
int64_t shape[4]#
Shape dimensions [dim0, dim1, dim2, 0].
-
struct ovphysx_articulation_metadata_t#
- #include <include/ovphysx/ovphysx_types.h>
Articulation topology metadata returned by ovphysx_get_articulation_metadata().
All fields are read at binding-creation time and remain constant for the lifetime of the binding.
String arrays (DOF names, body names, joint names) are NOT included here because they are variable-length and require caller-allocated buffers. Use ovphysx_articulation_get_dof_names / get_body_names / get_joint_names instead.
- Deprecated:
Produced only by the deprecated ovphysx_get_articulation_metadata. It retires with the tensor-binding surface. No non-binding successor exists yet.
Public Members
-
int32_t dof_count#
Number of degrees of freedom (DOFs)
-
int32_t body_count#
Number of links.
-
int32_t joint_count#
Number of joints.
-
int32_t fixed_tendon_count#
Max fixed tendons (0 if none)
-
int32_t spatial_tendon_count#
Max spatial tendons (0 if none)
-
bool is_fixed_base#
True if base link is fixed in world.
-
struct ovphysx_cuda_sync_t#
- #include <include/ovphysx/ovphysx_types.h>
CUDA synchronization for GPU operations.
Controls when the system accesses user memory and when completion is signaled.
Fields: stream: CUDA stream for the operation
0 = use default CUDA stream
~0 (all bits set) = unspecified, system chooses
other = cudaStream_t cast to uintptr_t
wait_event: CUDA event the system waits on BEFORE accessing user memory
0 = no wait (system may access memory immediately during operation execution)
non-zero = cudaEvent_t cast to uintptr_t
System waits: cudaStreamWaitEvent(internal_stream, wait_event, 0)
Use this to ensure the caller’s GPU kernels have finished writing to buffers
signal_event: CUDA event the system records AFTER operation completes
0 = no signal
non-zero = cudaEvent_t cast to uintptr_t
System records: cudaEventRecord(signal_event, internal_stream)
Use this to synchronize downstream GPU work with operation completion
See individual function documentation for operation-specific semantics.
-
struct ovphysx_user_task_desc_t#
- #include <include/ovphysx/ovphysx_types.h>
Description for enqueueing a user task.
Public Members
-
ovphysx_user_task_fn run#
Task callback function.
-
void *user_data#
User context (lifetime must be synchronized through events)
-
ovphysx_user_task_fn run#
-
struct ovphysx_contact_event_header_t#
- #include <include/ovphysx/ovphysx_types.h>
Contact event header - describes one contact pair.
ABI-stable contact header returned by ovphysx. Each header references a slice of the contact data array (contactDataOffset .. contactDataOffset + numContactData).
The identity fields (actor0/1, collider0/1) hold an opaque omni::physics::parse::ObjectKey.handle, a runtime-assigned identity, not a uint64-encoded SdfPath. There is no client-side bit-cast that reproduces or compares against one. Resolve them with ovphysx_scene_query_get_paths_from_ids instead.
Public Members
-
int32_t type#
0 = found, 1 = lost, 2 = persist
-
uint64_t attachHandle#
Attach that reported the contact.
Nonzero for every live attach, including one with no backing USD stage.
-
uint64_t actor0#
Actor 0 identity (opaque ObjectKey.handle)
-
uint64_t actor1#
Actor 1 identity (opaque ObjectKey.handle)
-
uint64_t collider0#
Collider 0 identity (opaque ObjectKey.handle)
-
uint64_t collider1#
Collider 1 identity (opaque ObjectKey.handle)
-
uint32_t contactDataOffset#
Index into the contact data array.
-
uint32_t numContactData#
Number of contact points for this pair.
-
uint32_t frictionAnchorsDataOffset#
Index into the friction anchors array.
-
uint32_t numfrictionAnchorsData#
Number of friction anchors for this pair.
-
uint32_t protoIndex0#
Point instancer index (0xFFFFFFFF if N/A)
-
uint32_t protoIndex1#
Point instancer index (0xFFFFFFFF if N/A)
-
int32_t type#
-
struct ovphysx_contact_point_t#
- #include <include/ovphysx/ovphysx_types.h>
Per-contact-point data returned by ovphysx.
position, normal, and impulse are float[3] in world space.
The identity fields (material0/1) hold an opaque omni::physics::parse::ObjectKey.handle, a runtime-assigned identity, not a uint64-encoded SdfPath. There is no client-side bit-cast that reproduces or compares against one. Resolve them with ovphysx_scene_query_get_paths_from_ids instead. They are 0 when the reporting attach is no longer live.
Public Members
-
float position[3]#
Contact position (world space)
-
float normal[3]#
Contact normal.
-
float impulse[3]#
Contact impulse (divide by dt for force)
-
float separation#
Contact separation distance.
-
uint32_t faceIndex0#
Triangle mesh face index for collider 0.
-
uint32_t faceIndex1#
Triangle mesh face index for collider 1.
-
uint64_t material0#
Material 0 identity (opaque ObjectKey.handle)
-
uint64_t material1#
Material 1 identity (opaque ObjectKey.handle)
-
float position[3]#
-
struct ovphysx_friction_anchor_t#
- #include <include/ovphysx/ovphysx_types.h>
Friction anchor data returned by ovphysx.
-
struct ovphysx_prim_list_t#
- #include <include/ovphysx/ovphysx_types.h>
List of USD prim paths for batch operations.
Public Members
-
const ovphysx_string_t *prim_paths#
Array of USD prim path strings.
-
size_t num_paths#
Number of paths in array.
-
const ovphysx_string_t *prim_paths#
-
struct ovphysx_config_entry_t#
- #include <include/ovphysx/ovphysx_types.h>
A typed config entry (tagged union).
key_type selects which member of key and value is valid. Use the builder functions in ovphysx_config.h for convenient construction.
Public Members
-
ovphysx_config_key_type_t key_type#
Discriminator.
-
ovphysx_config_bool_t bool_key#
-
ovphysx_config_int32_t int32_key#
-
ovphysx_config_float_t float_key#
-
ovphysx_config_string_t string_key#
-
ovphysx_string_t carbonite_key#
For KEY_TYPE_CARBONITE: arbitrary Carbonite path.
-
union ovphysx_config_entry_t::[anonymous] key#
-
bool bool_value#
-
int32_t int32_value#
-
float float_value#
-
ovphysx_string_t string_value#
For KEY_TYPE_STRING and KEY_TYPE_CARBONITE.
-
union ovphysx_config_entry_t::[anonymous] value#
-
ovphysx_config_key_type_t key_type#
-
struct ovphysx_config_t#
- #include <include/ovphysx/ovphysx_types.h>
Config array container (convenience wrapper).
-
struct ovphysx_omnipvd_destination_t#
- #include <include/ovphysx/ovphysx_types.h>
Destination for ovphysx_start_recording().
FILE requires a non-empty file_path and empty/zero TCP fields. TCP requires a non-empty tcp_address, tcp_port in 1..65535, and an empty file_path. String views are borrowed only for the synchronous call and must not contain embedded NUL bytes. A zero TCP timeout leaves the socket send timeout at its platform default.
Public Members
-
ovphysx_omnipvd_transport_t transport#
-
ovphysx_string_t file_path#
-
ovphysx_string_t tcp_address#
-
uint32_t tcp_port#
-
int32_t tcp_timeout_ms#
-
ovphysx_omnipvd_transport_t transport#
-
struct ovphysx_create_args#
- #include <include/ovphysx/ovphysx_types.h>
Configuration for creating an ovphysx instance.
Initialize with OVPHYSX_CREATE_ARGS_DEFAULT for safe defaults.
A non-empty active_cuda_gpus request is retained by this handle and applied to the shared process physics backend when this handle attaches a stage. To select a deterministic ordinal, make the request before the process’s first GPU scene creates its persistent CUDA context manager. Per-scene CPU/GPU dynamics are controlled by physxScene:enableGPUDynamics in the USD stage. ovphysx never reads or writes those settings.
To force process-wide CPU-only mode (ovphysx touches no CUDA driver), call ovphysx_set_cpu_mode(true) before creating any instances, or set OVPHYSX_DISABLE_GPU before ovphysx initialization. See ovphysx_set_cpu_mode for the external-driver boundary: the Python read and write paths expose warp.array tensors, so a CUDA-enabled Warp BUILD opens the driver. Install a CPU-only Warp to keep both Python paths driverless.
DirectGPU notes#
DirectGPU (eENABLE_DIRECT_GPU_API) skips GPU-to-CPU readback for faster steps. It is opt-in: set /physics/suppressReadback=true via Carbonite settings BEFORE ovphysx_create_instance. Restrictions: disables contact modification (no surface velocity, no custom contact callbacks), and host-side actor accessors return stale data after DirectGPU initializes.
Public Members
-
ovphysx_string_t bundled_deps_path#
Bundled deps path: empty = runtime discovery (default: empty)
-
const ovphysx_config_entry_t *config_entries#
Array of typed config entries.
-
uint32_t config_entry_count#
Number of config entries.
-
ovphysx_string_t active_cuda_gpus#
Comma-separated CUDA device ordinals (default: empty = no ovphysx ordinal override).
Restricts which GPU ordinal(s) are used. Supported patterns:
Empty: preserve the current PhysX process selection (a fresh/default process selects automatically)
”0”: single GPU 0
”N”: single GPU N
”-1”: PhysX default CUDA selection
”0,1,…,N-1”: all N GPUs, round-robin across scenes
”1,2,…,N-1”: all GPUs except first, round-robin Lists are normalized into ascending ordinal order. Input order does not control scene rotation. A non-empty value takes precedence over OVPHYSX_CONFIG_SCENE_MULTI_GPU_MODE. A single ordinal disables multi-GPU scene distribution. A different ordinal after the first GPU scene requires a new process. Other patterns are unsupported and return OVPHYSX_API_INVALID_ARGUMENT when CUDA topology is discoverable during instance creation.
-
ovphysx_string_t bundled_deps_path#
-
struct ovphysx_debug_point_t#
- #include <include/ovphysx/ovphysx_types.h>
Debug-visualization primitives, read from ovphysx_debug_render_get_points / _lines / _triangles.
The layout matches omni::physx DebugPoint / DebugLine / DebugTriangle (a carb::Float3 position plus a uint32 colour) so the OvPhysX debug buffer is read directly with no copy or per-element translation. Colours are 0xAARRGGBB (PhysX debug colour).
-
struct ovphysx_debug_line_t#
- #include <include/ovphysx/ovphysx_types.h>
-
struct ovphysx_debug_triangle_t#
- #include <include/ovphysx/ovphysx_types.h>
Typed Config Entries#
Builder functions for typed config entries.
Provides static inline helpers to construct ovphysx_config_entry_t values for use with ovphysx_create_instance() and ovphysx_set_global_config().
Pattern: generic type builders + named convenience functions per enum value. Matches the ovrtx_config.h builder pattern for API consistency.
Functions
- static inline ovphysx_config_entry_t ovphysx_config_entry_bool(
- ovphysx_config_bool_t key,
- bool value,
Build a config entry for a boolean setting.
- static inline ovphysx_config_entry_t ovphysx_config_entry_int32(
- ovphysx_config_int32_t key,
- int32_t value,
Build a config entry for an int32 setting.
- static inline ovphysx_config_entry_t ovphysx_config_entry_float(
- ovphysx_config_float_t key,
- float value,
Build a config entry for a float setting.
- static inline ovphysx_config_entry_t ovphysx_config_entry_string(
- ovphysx_config_string_t key,
- ovphysx_string_t value,
Build a config entry for a string setting.
value.ptr must remain valid until the API call that consumes the config returns.
- static inline ovphysx_config_entry_t ovphysx_config_entry_carbonite(
- ovphysx_string_t key,
- ovphysx_string_t value,
Build a config entry for an arbitrary Carbonite setting (direct override).
The key is a Carbonite settings path (e.g., “/physics/updateToUsd”) and the value is a string whose type is auto-detected at runtime: “true”/”false” becomes bool, an integer string int, a float string float, anything else string.
Both key.ptr and value.ptr must remain valid until the API call returns.
- static inline ovphysx_config_entry_t ovphysx_config_entry_disable_contact_processing(
- bool value,
Enable/disable contact processing (/physics/disableContactProcessing).
- static inline ovphysx_config_entry_t ovphysx_config_entry_collision_cone_custom_geometry(
- bool value,
Enable/disable cone custom geometry for collisions (/physics/collisionConeCustomGeometry).
- static inline ovphysx_config_entry_t ovphysx_config_entry_collision_cylinder_custom_geometry(
- bool value,
Enable/disable cylinder custom geometry for collisions (/physics/collisionCylinderCustomGeometry).
- static inline ovphysx_config_entry_t ovphysx_config_entry_num_threads(
- int32_t value,
Set number of worker threads (/physics/numThreads).
0 = auto.
- static inline ovphysx_config_entry_t ovphysx_config_entry_scene_multi_gpu_mode(
- int32_t value,
Set scene multi-GPU mode (/physics/sceneMultiGPUMode).
0=disabled, 1=all GPUs, 2=skip first GPU. Used only when ovphysx_create_args.active_cuda_gpus is empty.
- static inline ovphysx_config_entry_t ovphysx_config_entry_ovstage_read_pool_max_mb(
- int32_t value,
Set the ovstage read device-buffer pool retention budget in MiB (/physics/ovstageReadPoolMaxMB).
Bounds the device and pinned-host memory the per-context output-read pool retains between reads. 0 or a negative value DISABLES the pool (nothing is retained, and every read allocates and frees as if the pool were absent). Default 256.
- static inline ovphysx_config_entry_t ovphysx_config_entry_omnipvd_transport(
- ovphysx_string_t value,
Select the OmniPVD startup transport: exact lowercase “file” or “tcp”.
- static inline ovphysx_config_entry_t ovphysx_config_entry_omnipvd_tcp_address(
- ovphysx_string_t value,
Set the OmniPVD TCP peer address.
- static inline ovphysx_config_entry_t ovphysx_config_entry_omnipvd_tcp_port(
- int32_t value,
Set the OmniPVD TCP peer port (1..65535).
- static inline ovphysx_config_entry_t ovphysx_config_entry_omnipvd_tcp_timeout_ms(
- int32_t value,
Set the blocked-send timeout in milliseconds (0 keeps the OS default and uses a 3000 ms connect window).
- static inline ovphysx_config_entry_t ovphysx_config_entry_omnipvd_ovd_recording_directory(
- ovphysx_string_t value,
Set OmniPVD OVD recording directory (/persistent/physics/omniPvdOvdRecordingDirectory).
Both this and omnipvd_output_enabled must be set before instance creation. When passed together in config_entries, order within the array does not matter (both are applied before the physics engine reads them). value.ptr must remain valid until the API call returns.
- static inline ovphysx_config_entry_t ovphysx_config_entry_omnipvd_output_enabled(
- bool value,
Enable/disable OmniPVD recording (/physics/omniPvdOutputEnabled).
Both this and omnipvd_ovd_recording_directory must be set before instance creation. When passed together in config_entries, order within the array does not matter.
- static inline ovphysx_config_entry_t ovphysx_config_entry_omnipvd_recording_capable(
- bool value,
Enable/disable OmniPVD recording capability (/physics/omniPvdRecordingCapable).
This is a creation-time, process-wide setting that defaults to false. Enabling startup OmniPVD output also enables this capability.
- static inline ovphysx_config_entry_t ovphysx_config_entry_nvtx_enabled(
- bool value,
Enable/disable NVTX ranges for capture with Nsight Systems (/physics/nvtxEnabled).
Must be set before instance creation. Setting OVPHYSX_NVTX=1 in the environment has the same effect and needs no code change.
C++ Wrappers (Experimental)#
C++17 RAII wrappers and helpers in the ovphysx namespace.
-
namespace ovphysx#
Functions
-
inline ovphysx_api_status_t shutdown()#
Clear the ovphysx process-lifecycle token.
Thin wrapper for ovphysx_shutdown(). See the C header for full semantics. This does not destroy live handles. With no live handles it drains the direct PhysX runtime while Carbonite remains resident for its process-exit hook.
- Returns:
OVPHYSX_API_SUCCESS on success, OVPHYSX_API_ERROR if called without a matching ovphysx_initialize().
- inline ObjectChangeSubscription subscribeObjectChanges(
- ObjectChangeCallbacks callbacks,
Subscribe to PhysX object create/destroy notifications.
Returns an RAII handle whose destructor calls ovphysx_unsubscribe_object_changes(). On failure (no callbacks set, internal sidecar not loaded, etc.) the returned handle satisfies
!handle.isActive(). The underlying C call’s error is not exposed through this overload. Subscriptions are process-global, so callbacks fire for events on every ovphysx instance in the process. See the docstring on ovphysx_subscribe_object_changes in ovphysx.h for the full contract.
-
class CreateArgs#
- #include <include/ovphysx/experimental/ovphysx.hpp>
Safe wrapper for ovphysx_create_args.
Default-constructs to OVPHYSX_CREATE_ARGS_DEFAULT (empty active_cuda_gpus, no config entries, empty bundled deps path). Use setters to override individual fields before passing to PhysX::create().
Callers do not need to touch ovphysx_create_args directly. This class guarantees all fields are initialized.
Public Functions
-
CreateArgs()#
-
CreateArgs(const CreateArgs&)#
-
CreateArgs &operator=(const CreateArgs&)#
-
CreateArgs(CreateArgs&&) noexcept#
-
CreateArgs &operator=(CreateArgs&&) noexcept#
-
void setActiveCudaGpus(const std::string &gpus)#
- Parameters:
gpus – Comma-separated CUDA device ordinals, e.g. “0”, “0,1,2”, “1,2”. See active_cuda_gpus on ovphysx_create_args for supported patterns. CreateArgs copies the string internally, so the caller does not need to keep the argument alive after this call returns.
-
void setBundledDepsPath(const std::string &path)#
- Parameters:
path – Bundled deps path. CreateArgs copies the string internally, so the caller does not need to keep the argument alive after this call returns.
- void setConfigEntries(
- const ovphysx_config_entry_t *entries,
- uint32_t count,
- Parameters:
entries – Pointer to an array of config entries. The caller must keep this array valid until PhysX::create() returns. CreateArgs does not copy the data.
count – Number of entries in the array.
-
const ovphysx_create_args &cArgs() const#
Returns a const reference to the underlying ovphysx_create_args. The reference is valid only for the lifetime of this CreateArgs object.
-
CreateArgs()#
-
struct ObjectChangeCallbacks#
- #include <include/ovphysx/experimental/ovphysx.hpp>
Callback set for ObjectChangeSubscription.
Each callback is optional. An unset std::function is skipped rather than called. At least one of the three must be set, otherwise subscribeObjectChanges() returns an inactive ObjectChangeSubscription (check ObjectChangeSubscription::isActive() to detect this).
Threading: callbacks may fire from internal worker threads during PhysX::step() or PhysX::reset_stage(). Do not call other ovphysx APIs from inside a callback. Defer that work to after the next waitOp() / waitAll() returns.
PhysX::clone() does NOT emit onCreated for clone-replicated objects. Refresh cached PhysX pointers after PhysX::clone() returns and PhysX::waitAll() completes, not by waiting for a callback.
Public Members
-
std::function<void(std::string_view primPath, ovphysx_physx_type_t type)> onCreated#
Fires AFTER the object is created. Safe to call PhysX::getPhysXPtr() from a deferred handler.
-
std::function<void(std::string_view primPath, ovphysx_physx_type_t type)> onDestroyed#
Fires BEFORE the object is destroyed. Drop any cached pointer for primPath / type at this point.
-
std::function<void()> onAllDestroyed#
Fires BEFORE a bulk teardown (e.g. PhysX::reset_stage()). Flush the entire pointer cache. No per-object onDestroyed events follow.
-
std::function<void(std::string_view primPath, ovphysx_physx_type_t type)> onCreated#
-
class ObjectChangeSubscription#
- #include <include/ovphysx/experimental/ovphysx.hpp>
RAII subscription handle returned by subscribeObjectChanges().
On destruction, unsubscribes via ovphysx_unsubscribe_object_changes() so the callbacks stop firing. Movable, non-copyable.
Public Functions
-
inline ObjectChangeSubscription() noexcept#
-
ObjectChangeSubscription(const ObjectChangeSubscription&) = delete#
- ObjectChangeSubscription &operator=(
- const ObjectChangeSubscription&,
- inline ObjectChangeSubscription(
- ObjectChangeSubscription &&other,
- inline ObjectChangeSubscription &operator=(
- ObjectChangeSubscription &&other,
-
inline ~ObjectChangeSubscription()#
-
inline bool isActive() const noexcept#
Returns true if this handle owns a live subscription.
-
inline ovphysx_subscription_id_t id() const noexcept#
Underlying C subscription ID (or OVPHYSX_INVALID_SUBSCRIPTION_ID if inactive).
-
inline void unsubscribe()#
Unsubscribe explicitly. Idempotent.
On success, both m_id and m_state are cleared. If the underlying C unsubscribe FAILS (e.g. internal sidecar unloaded), m_state is intentionally leaked rather than freed. The C-side subscription may still hold a pointer to it, and freeing would leave a dangling user_data for any in-flight or queued callback. m_id is still cleared so the handle is considered consumed by the caller.
-
struct State#
- #include <include/ovphysx/experimental/ovphysx.hpp>
Public Members
-
ObjectChangeCallbacks callbacks#
-
ObjectChangeCallbacks callbacks#
-
inline ObjectChangeSubscription() noexcept#
-
class PhysX#
- #include <include/ovphysx/experimental/ovphysx.hpp>
RAII wrapper for ovphysx_handle_t.
Automatically calls ovphysx_destroy_instance on destruction. Move-only (non-copyable) to ensure unique ownership.
Provides implicit conversion to ovphysx_handle_t for use with the C API.
Example: ovphysx_initialize(); { CreateArgs args; PhysX physx; PhysX::create(physx, args); physx.step(0.01f); physx.waitAll(); } ovphysx_shutdown();
Notes:
Use PhysX::create to obtain a valid instance. Methods log and return errors if the handle is null.
Use waitOp/waitAll when results are needed outside stream order.
Public Types
-
using ContactEventHeader = ovphysx_contact_event_header_t#
-
using ContactPoint = ovphysx_contact_point_t#
-
using FrictionAnchor = ovphysx_friction_anchor_t#
-
using SceneQueryHit = ovphysx_scene_query_hit_t#
Public Functions
-
explicit PhysX(ovphysx_handle_t h)#
Construct from existing handle (takes ownership)
-
PhysX()#
Default constructor - creates null handle.
-
~PhysX()#
Destructor - destroys instance if valid.
-
inline ovphysx_handle_t handle() const#
Get raw handle.
-
inline operator ovphysx_handle_t() const#
Implicit conversion to handle for use with C API.
-
inline explicit operator bool() const#
Check if handle is valid.
-
ovphysx_handle_t release()#
Release ownership of handle (caller must destroy)
-
void reset(ovphysx_handle_t h = 0)#
Reset to new handle (destroys current if valid)
-
ovphysx_api_status_t reset_stage()#
Reset the stage to empty and detach any ovstage (does not change the simulation-time counter)
- ovphysx_api_status_t attachOvstage(
- ovstage_instance_t *stage,
- ovstage_ordinal_t read_ordinal,
Attach an ovstage Stage through the top-level ovphysx API.
read_ordinalselects the caller-owned sealed ordinal (must be non-zero, 0 is reserved). Only one instance may own the process-wide live attach. This returns OVPHYSX_API_ERROR rather than displacing another instance’s attachment.
-
ovphysx_api_status_t updateFromOvstage(ovstage_ordinal_range_t range)#
Pull and apply ovstage changes over the committed ordinal range.
- ovphysx_api_status_t clone(
- const std::string &sourcePath,
- const std::vector<std::string> &targetPaths,
- const float *anchorTransforms = nullptr,
- const uint32_t *envIds = nullptr,
- ovphysx_op_index_t *outOpIndex = nullptr,
Clone a USD prim hierarchy to create multiple runtime physics copies.
Creates physics-optimized clones in the internal representation for high-performance simulation. The source prim must exist in the loaded USD stage and have physics properties. Replication runs inline (any returned op index is already complete), backed by the PhysX SDK replicator, so cloned articulations are real articulations.
This is the clone entrypoint for both standalone callers and callers that populate the scene through an ovstage Stage attached via the C API
ovphysx_attach_ovstage. Replication runs in the internal representation only (USD untouched).- Parameters:
sourcePath – USD path of the source prim hierarchy (e.g., “/World/env0”)
targetPaths – Vector of runtime physics-object paths for cloned hierarchies (e.g., [“/World/env1”, “/World/env2”])
anchorTransforms – Absolute world pose of each target subtree root. Entry i anchors the exact subtree at targetPaths[i]. Flat array of [targetPaths.size() * 7] floats: (px, py, pz, qx, qy, qz, qw) per target. Descendants keep their poses relative to the source subtree root (targetObjectWorld = anchorTransforms[i] * inverse(sourceRootWorld) * sourceObjectWorld). Pass nullptr to co-locate every copy on the source.
envIds – Optional logical environment id per target ([targetPaths.size()] uint32, each < 0x00FFFFFF, runtime id = envIds[i]+1). Stable across calls: the same id maps to the same environment, so clones sharing an id collide and stay isolated from other environments. Pass nullptr for automatic per-call numbering.
outOpIndex – Optional. Receives the clone operation index on success (usable with waitOp()). The clone completes synchronously, so waiting is only for API uniformity.
- Returns:
OVPHYSX_API_SUCCESS if cloning succeeded, OVPHYSX_API_ERROR on error
-
ovphysx_api_status_t step(float step_dt)#
Enqueue a physics simulation step (simulation time tracked internally).
-
ovphysx_api_status_t updateArticulationsKinematic()#
Recompute articulation link poses from current joint positions without stepping simulation.
- ovphysx_api_status_t addUserTask(
- const ovphysx_user_task_desc_t &desc,
- ovphysx_op_index_t &out_op_index,
Add a user task to the execution queue.
- physx::WaitResult waitOp(
- ovphysx_op_index_t op_index,
- ovphysx_timeout_t timeout_ns = OVPHYSX_TIMEOUT_INFINITE,
Wait for a specific operation to complete.
- physx::WaitResult waitAll(
- ovphysx_timeout_t timeout_ns = OVPHYSX_TIMEOUT_INFINITE,
Wait for all pending operations to complete.
- ovphysx_api_status_t createTensorBinding(
- TensorBinding &out_binding,
- const std::string &pattern,
- ovphysx_tensor_type_t tensor_type,
Create a tensor binding for bulk physics data access.
Creates a binding that connects physics-object paths (matched by pattern) to a tensor type, enabling efficient bulk read/write for authored USD objects and runtime-only clones.
- Deprecated:
The tensor-binding API is deprecated. Use ovphysx_read (reads) and ovphysx_write (writes) instead.
- Parameters:
out_binding – Receives the created TensorBinding on success
pattern – Physics-object path pattern (e.g., “/World/robot*”)
tensor_type – The type of tensor data to bind
- Returns:
OVPHYSX_API_SUCCESS on success
-
template<typename T>
inline ovphysx_api_status_t getPhysXPtr( - const std::string &primPath,
- T *&out,
Type-safe accessor: deduces the enum from the PhysX pointer type.
Example:
physx::PxScene* s; physx.getPhysXPtr("/World/scene", s);Compile error if T has no PhysXTypeFor<T> specialization.
- inline ovphysx_api_status_t getPhysXPtr(
- const std::string &primPath,
- ovphysx_physx_type_t type,
- void *&out,
Explicit-enum accessor for advanced use or unsupported types.
Prefer the two-argument overload above when T is a known PhysX type.
- inline ovphysx_api_status_t getContactReport(
- const ContactEventHeader *&headers,
- uint32_t &numHeaders,
- const ContactPoint *&points,
- uint32_t &numPoints,
- const FrictionAnchor **anchors = nullptr,
- uint32_t *numAnchors = nullptr,
Get contact report data for the current simulation step.
Returns typed pointers to the internal contact buffers. Data is valid until the next simulation step.
- Parameters:
headers – [out] Pointer to contact event header array.
numHeaders – [out] Number of headers.
points – [out] Pointer to contact point data array.
numPoints – [out] Number of contact point entries.
anchors – [out] Optional. Pointer to friction anchor array (pass nullptr to skip).
numAnchors – [out] Optional. Friction anchor count (pass nullptr to skip).
- inline ovphysx_api_status_t raycast(
- const float origin[3],
- const float direction[3],
- float distance,
- bool both_sides,
- ovphysx_scene_query_mode_t mode,
- const SceneQueryHit *&hits,
- uint32_t &count,
Cast a ray into the scene.
- Parameters:
origin – Ray origin (world space).
direction – Normalized ray direction.
distance – Maximum ray length.
both_sides – Test both sides of mesh triangles.
mode – CLOSEST, ANY, or ALL.
hits – [out] Pointer to internal hit array (valid until next scene query call).
count – [out] Number of hits.
- inline ovphysx_api_status_t sweep(
- const ovphysx_scene_query_geometry_desc_t &geometry,
- const float direction[3],
- float distance,
- bool both_sides,
- ovphysx_scene_query_mode_t mode,
- const SceneQueryHit *&hits,
- uint32_t &count,
Sweep a geometry shape through the scene.
- Parameters:
geometry – Geometry descriptor.
direction – Normalized sweep direction.
distance – Maximum sweep length.
both_sides – Test both sides of mesh triangles.
mode – CLOSEST, ANY, or ALL.
hits – [out] Pointer to internal hit array (valid until next scene query call).
count – [out] Number of hits.
- inline ovphysx_api_status_t overlap(
- const ovphysx_scene_query_geometry_desc_t &geometry,
- ovphysx_scene_query_mode_t mode,
- const SceneQueryHit *&hits,
- uint32_t &count,
Test geometry overlap against objects in the scene.
- Parameters:
geometry – Geometry descriptor.
mode – ANY or ALL. CLOSEST falls back to ALL because overlap tests have no distance ordering.
hits – [out] Pointer to internal hit array (valid until next scene query call).
count – [out] Number of overlapping objects.
Public Static Functions
- static ovphysx_api_status_t create(
- PhysX &out_instance,
- const CreateArgs &args,
Factory method to create a PhysX instance from CreateArgs.
This is the primary creation path. Use CreateArgs to configure device selection, GPU index, config entries, and other options.
Initialize the C API first, construct CreateArgs, call create(), and check its returned status. Destroy the PhysX instance before calling ovphysx_shutdown().
- Parameters:
out_instance – Receives the created PhysX instance on success.
args – Creation arguments (default-constructed = OVPHYSX_CREATE_ARGS_DEFAULT).
- Returns:
OVPHYSX_API_SUCCESS on success, or OVPHYSX_API_INVALID_ARGUMENT on inconsistent args (e.g. config_entry_count > 0 with null pointer).
-
static ovphysx_api_status_t setCpuMode(bool cpuOnly)#
Force process-wide CPU-only mode. Must be called before any instances are active. See ovphysx_set_cpu_mode() for full semantics.
-
static ovphysx_api_status_t getCpuMode(bool &outCpuOnly)#
Query whether process-wide hard CPU-only mode is in effect. See ovphysx_get_cpu_mode() for full semantics.
-
template<typename T>
struct PhysXTypeFor# Traits mapping a PhysX SDK type to its ovphysx_physx_type_t enum value. Enables type-safe getPhysXPtr() overloads that auto-deduce the enum.
-
template<>
struct PhysXTypeFor<::physx::PxArticulationJointReducedCoordinate># - #include <include/ovphysx/experimental/ovphysx.hpp>
Public Static Attributes
-
static constexpr ovphysx_physx_type_t value = OVPHYSX_PHYSX_TYPE_LINK_JOINT#
-
static constexpr ovphysx_physx_type_t value = OVPHYSX_PHYSX_TYPE_LINK_JOINT#
-
template<>
struct PhysXTypeFor<::physx::PxArticulationLink># - #include <include/ovphysx/experimental/ovphysx.hpp>
Public Static Attributes
-
static constexpr ovphysx_physx_type_t value = OVPHYSX_PHYSX_TYPE_LINK#
-
static constexpr ovphysx_physx_type_t value = OVPHYSX_PHYSX_TYPE_LINK#
-
template<>
struct PhysXTypeFor<::physx::PxArticulationReducedCoordinate># - #include <include/ovphysx/experimental/ovphysx.hpp>
Public Static Attributes
-
static constexpr ovphysx_physx_type_t value = OVPHYSX_PHYSX_TYPE_ARTICULATION#
-
static constexpr ovphysx_physx_type_t value = OVPHYSX_PHYSX_TYPE_ARTICULATION#
-
template<>
struct PhysXTypeFor<::physx::PxJoint># - #include <include/ovphysx/experimental/ovphysx.hpp>
Public Static Attributes
-
static constexpr ovphysx_physx_type_t value = OVPHYSX_PHYSX_TYPE_JOINT#
-
static constexpr ovphysx_physx_type_t value = OVPHYSX_PHYSX_TYPE_JOINT#
-
template<>
struct PhysXTypeFor<::physx::PxMaterial># - #include <include/ovphysx/experimental/ovphysx.hpp>
Public Static Attributes
-
static constexpr ovphysx_physx_type_t value = OVPHYSX_PHYSX_TYPE_MATERIAL#
-
static constexpr ovphysx_physx_type_t value = OVPHYSX_PHYSX_TYPE_MATERIAL#
-
template<>
struct PhysXTypeFor<::physx::PxPhysics># - #include <include/ovphysx/experimental/ovphysx.hpp>
Public Static Attributes
-
static constexpr ovphysx_physx_type_t value = OVPHYSX_PHYSX_TYPE_PHYSICS#
-
static constexpr ovphysx_physx_type_t value = OVPHYSX_PHYSX_TYPE_PHYSICS#
-
template<>
struct PhysXTypeFor<::physx::PxRigidActor># - #include <include/ovphysx/experimental/ovphysx.hpp>
Public Static Attributes
-
static constexpr ovphysx_physx_type_t value = OVPHYSX_PHYSX_TYPE_ACTOR#
-
static constexpr ovphysx_physx_type_t value = OVPHYSX_PHYSX_TYPE_ACTOR#
-
template<>
struct PhysXTypeFor<::physx::PxScene># - #include <include/ovphysx/experimental/ovphysx.hpp>
Public Static Attributes
-
static constexpr ovphysx_physx_type_t value = OVPHYSX_PHYSX_TYPE_SCENE#
-
static constexpr ovphysx_physx_type_t value = OVPHYSX_PHYSX_TYPE_SCENE#
-
template<>
struct PhysXTypeFor<::physx::PxShape># - #include <include/ovphysx/experimental/ovphysx.hpp>
Public Static Attributes
-
static constexpr ovphysx_physx_type_t value = OVPHYSX_PHYSX_TYPE_SHAPE#
-
static constexpr ovphysx_physx_type_t value = OVPHYSX_PHYSX_TYPE_SHAPE#
-
class TensorBinding#
- #include <include/ovphysx/experimental/TensorBinding.hpp>
RAII wrapper for ovphysx_tensor_binding_handle_t.
Automatically calls ovphysx_destroy_tensor_binding on destruction. Move-only (non-copyable) to ensure unique ownership.
Created via PhysX::createTensorBinding(). Do not construct directly.
Example: TensorBinding binding; physx.createTensorBinding(binding, “/World/robot”, OVPHYSX_TENSOR_ARTICULATION_DOF_POSITION_F32); binding.read(myTensor);
- Deprecated:
The tensor-binding API is deprecated. Use ovphysx_read (reads) and ovphysx_write (writes) instead. The action members below (spec/metadata/read/write/writeMasked/destroy) and the PhysX::createTensorBinding() factory carry the deprecation marker, so both creating and using a binding warn. The class type itself is left unmarked on purpose: a deprecated type warns wherever it is named, including this header’s own factory declaration, which would warn every consumer merely for including the header. Member-function markers warn only on call.
Public Functions
-
TensorBinding()#
-
~TensorBinding()#
-
TensorBinding(TensorBinding &&other) noexcept#
-
TensorBinding &operator=(TensorBinding &&other) noexcept#
-
TensorBinding(const TensorBinding&) = delete#
-
TensorBinding &operator=(const TensorBinding&) = delete#
-
inline ovphysx_tensor_binding_handle_t handle() const#
Get the raw binding handle (for use with C API)
-
inline explicit operator bool() const#
Check whether this wrapper currently owns a non-null binding handle. This does not query whether the underlying TensorAPI view survived a stage reset or bound-object removal. read/write report that error.
-
ovphysx_api_status_t spec(ovphysx_tensor_spec_t &out_spec) const#
Query the tensor spec (dtype, ndim, shape)
-
ovphysx_api_status_t nativeDevice(DLDevice &out_device) const#
Query the native DLPack device used by this binding.
- ovphysx_api_status_t metadata(
- ovphysx_articulation_metadata_t &out_metadata,
Query articulation topology metadata (dof_count, body_count, joint_count, fixed_tendon_count, spatial_tendon_count, is_fixed_base). Only valid for articulation bindings. Returns OVPHYSX_API_ERROR otherwise.
-
ovphysx_api_status_t read(DLTensor &dst) const#
Read simulation data into a DLTensor.
- ovphysx_api_status_t write(
- const DLTensor &src,
- const DLTensor *indices = nullptr,
Write data from a DLTensor, optionally with an index tensor for sparse updates.
- ovphysx_api_status_t writeMasked(
- const DLTensor &src,
- const DLTensor &mask,
Write data from a DLTensor using a boolean mask for selective updates.
-
void destroy()#
Explicitly destroy the binding (called automatically by destructor)
-
namespace detail#
Functions
- inline void objectChangeCreatedTrampoline(
- ovphysx_string_t primPath,
- ovphysx_physx_type_t type,
- void *userData,
- inline void objectChangeDestroyedTrampoline(
- ovphysx_string_t primPath,
- ovphysx_physx_type_t type,
- void *userData,
-
inline void objectChangeAllDestroyedTrampoline(void *userData)#
-
namespace physx#
-
class WaitResult#
- #include <include/ovphysx/experimental/Helpers.hpp>
RAII wrapper for ovphysx_op_wait_result_t.
Automatically calls ovphysx_destroy_wait_result when destroyed. Use get() to pass to ovphysx_wait_op.
#include <ovphysx/experimental/Helpers.hpp> #include <iostream> static ovphysx_result_t wait_and_report_errors( ovphysx_handle_t handle, ovphysx_op_index_t op_index, ovphysx_timeout_t timeout_ns) { ovphysx::physx::WaitResult wait_result; ovphysx_result_t result = ovphysx_wait_op(handle, op_index, timeout_ns, wait_result.get()); for (size_t index = 0; index < wait_result.errorCount(); ++index) { ovphysx_op_index_t failed_op = wait_result.errorOpIndexAt(index); ovphysx_string_t error = ovphysx_get_last_op_error(failed_op); std::cerr << "Op " << failed_op << " failed: " << std::string(error.ptr, error.length) << '\n'; } return result; }
Public Functions
-
inline WaitResult()#
-
inline ~WaitResult()#
-
inline WaitResult(WaitResult &&other) noexcept#
-
inline WaitResult &operator=(WaitResult &&other) noexcept#
-
WaitResult(const WaitResult&) = delete#
-
WaitResult &operator=(const WaitResult&) = delete#
-
inline ovphysx_op_wait_result_t *get()#
Get pointer to underlying result (pass to ovphysx_wait_op)
-
inline const ovphysx_op_wait_result_t *get() const#
-
inline bool hasErrors() const#
Check if there were any errors.
-
inline size_t errorCount() const#
Number of errors.
-
inline ovphysx_op_index_t lowestPendingOpIndex() const#
Get lowest pending operation index (0 if all complete)
-
inline ovphysx_op_index_t errorOpIndexAt(size_t i) const#
Get the failed operation index at position i.
-
inline WaitResult()#
-
class WaitResult#
-
inline ovphysx_api_status_t shutdown()#