warp.handle#
- class warp.handle(x=0)[source]#
Object handle type for meshes, volumes, BVHs, and hash grids.
Use this type for scalar object IDs in kernel parameters and struct fields, for example
mesh: warp.handle.For arrays of object IDs, annotate kernel parameters as
warp.array[warp.handle]and construct the arrays withdtype=warp.handle. An annotation alone does not change an array’s dtype. An existing Warp array of 64-bit integer IDs can be reinterpreted withids.view(warp.handle)without copying its storage.Handles use the same native 64-bit representation as
warp.uint64. See Object Handles for legacy integer compatibility and API Capture: Saving and Loading Graphs for resource serialization requirements and limitations.A handle does not keep its object alive. Keep the corresponding
warp.Mesh,warp.Volume,warp.Bvh, orwarp.HashGridalive while its handle is in use.warp.tile_load()andwarp.tile_store()do not yet support arrays withdtype=warp.handle. Handle arrays support ordinary kernel indexing.