Méthode | Description | |
---|---|---|
FindPlanes ( List |
Convenience wrapper that executes FindSubPlanes followed by MergeSubPlanes via a single call into native code (which improves performance by avoiding a bunch of unnecessary data marshalling and a managed-to-native transition).
|
|
FindSubPlanes ( List |
Finds small planar patches that are contained within individual meshes. The output of this API can then be passed to MergeSubPlanes() in order to find larger planar surfaces that potentially span across multiple meshes.
|
|
MergeSubPlanes ( |
Takes the subplanes returned by one or more previous calls to FindSubPlanes() and merges them together into larger planes that can potentially span across multiple meshes. Overlapping subplanes that have similar plane equations will be merged together to form larger planes.
|
Méthode | Description | |
---|---|---|
FinishPlaneFinding ( ) : void |
Cleanup after finishing a PlaneFinding API call by unpinning any memory that was pinned for the call into the driver, and then reset the findPlanesRunning bool.
|
|
MarshalBoundedPlanesFromIntPtr ( |
Marshals BoundedPlane data returned from a DLL API call into a managed BoundedPlane array and then frees the memory that was allocated within the DLL. Disabling warning 618 when calling Marshal.SizeOf(), because Unity does not support .Net 4.5.1+ for using the preferred Marshal.SizeOf(T) method."/>, |
|
PinMeshDataForMarshalling ( List |
Copies the supplied mesh data into the reusedMeshesForMarhsalling array. All managed arrays are pinned so that the marshalling only needs to pass a pointer and the native code can reference the memory in place without needing the marshaller to create a complete copy of the data.
|
|
PinObject ( System obj ) : |
Pins the specified object so that the backing memory can not be relocated, adds the pinned memory handle to the tracking list, and then returns that address of the pinned memory so that it can be passed into the DLL to be access directly from native code.
|
|
StartPlaneFinding ( ) : void |
Validate that no other PlaneFinding API call is currently in progress. As a performance optimization to avoid unnecessarily thrashing the garbage collector, each call into the PlaneFinding DLL reuses a couple of static data structures. As a result, we can't handle multiple concurrent calls into these APIs.
|
|
UnpinAllObjects ( ) : void |
Unpins all of the memory previously pinned by calls to PinObject().
|
public static FindPlanes ( List |
||
meshes | List |
/// List of meshes to run the plane finding algorithm on. /// |
snapToGravityThreshold | float | /// Planes whose normal vectors are within this threshold (in degrees) from vertical/horizontal /// will be snapped to be perfectly gravity aligned. When set to something other than zero, the /// bounding boxes for each plane will be gravity aligned as well, rather than rotated for an /// optimally tight fit. Pass 0.0 for this parameter to completely disable the gravity alignment /// logic. /// |
minArea | float | /// While merging subplanes together, any candidate merged plane whose constituent mesh /// triangles have a total area less than this threshold are ignored. /// |
Résultat | HoloToolkit.Unity.BoundedPlane[] |
public static FindSubPlanes ( List |
||
meshes | List |
/// List of meshes to run the plane finding algorithm on. /// |
snapToGravityThreshold | float | /// Planes whose normal vectors are within this threshold (in degrees) from vertical/horizontal /// will be snapped to be perfectly gravity aligned. When set to something other than zero, the /// bounding boxes for each plane will be gravity aligned as well, rather than rotated for an /// optimally tight fit. Pass 0.0 for this parameter to completely disable the gravity alignment /// logic. /// |
Résultat | HoloToolkit.Unity.BoundedPlane[] |
public static MergeSubPlanes ( |
||
subPlanes | /// The output from one or more previous calls to FindSubPlanes(). /// | |
snapToGravityThreshold | float | /// Planes whose normal vectors are within this threshold (in degrees) from vertical/horizontal /// will be snapped to be perfectly gravity aligned. When set to something other than zero, the /// bounding boxes for each plane will be gravity aligned as well, rather than rotated for an /// optimally tight fit. Pass 0.0 for this parameter to completely disable the gravity alignment /// logic. /// |
minArea | float | /// While merging subplanes together, any candidate merged plane whose constituent mesh /// triangles have a total area less than this threshold are ignored. /// |
Résultat | HoloToolkit.Unity.BoundedPlane[] |