Spatial Query Funcs (2015)

This interface will give access to a variety of functions for querying the state of meshes in the scene. Currently only one feature is available, but more are planned.

class lwsdk.LWSpatialQueryFuncs(self)

Bases: object

Proxy of C++ PCore::LWSpatialQueryFuncs class

 acquire() → LWSpatialQueryID

Acquire a Spatial Query ID to be passed to the raycast function.

 destroy(LWItemID item)

Removes spatial structures for the specified scene object.

 items() → LWItemID[]

Gets the list of items as an array.

 numItems() → unsigned int

Returns the number of items that will be returned by the LWSpatialQueryFuncs::items() function.

 raycast(LWSpatialQueryID id, LWItemID item, LWDVector origin, LWDVector direction) → (result, raycastinfo)

Casts a ray only at the specified object. If there is no item registered, the system will create an entry for it.

If result is zero (0), then raycastinfo will be None. Otherwise, it will be a valid LWRayCastInfo structure.

 release(LWSpatialQueryID queryid)

Release the query ID returned by LWSpatialQueryFuncs::acquire(). This is required to clean up unused raycast structures.

 update(LWItemID item)

Updates spatial structures. Use this from an item's deform function to call the update.

Previous topic

Color Space Funcs (2015)

Next topic

Miscellaneous Classes

This Page