Skip to content

Commit

Permalink
Merge pull request #1787 from Holo-Krzysztof/master
Browse files Browse the repository at this point in the history
Changed SpatialUnderstanding DllImports to cdecl.
  • Loading branch information
StephenHodgson authored Mar 6, 2018
2 parents 9fb253b + 88cc736 commit 701f292
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,12 @@ public enum SurfaceTypes
/// before any other DLL function.
/// </summary>
/// <returns>Zero if fails, one if success</returns>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern int SpatialUnderstanding_Init();
/// <summary>
/// Terminate the spatial understanding DLL.
/// </summary>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern void SpatialUnderstanding_Term();

/// <summary>
Expand All @@ -384,7 +384,7 @@ public enum SurfaceTypes
/// <param name="camUp_Z">The user's camera/view unit up vector, z value</param>
/// <param name="searchDst">Suggested search distance for playspace center</param>
/// <param name="optimalSize">Optimal room size. Used to determined the playspace size</param>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern void GeneratePlayspace_InitScan(
[In] float camPos_X, [In] float camPos_Y, [In] float camPos_Z,
[In] float camFwd_X, [In] float camFwd_Y, [In] float camFwd_Z,
Expand All @@ -407,7 +407,7 @@ public static extern void GeneratePlayspace_InitScan(
/// <param name="camUp_Z">The user's camera/view unit up vector, z value</param>
/// <param name="deltaTime">Time since last update</param>
/// <returns>One if scanning has been finalized, zero if more updates are required.</returns>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern int GeneratePlayspace_UpdateScan(
[In] int meshCount, [In] IntPtr meshes,
[In] float camPos_X, [In] float camPos_Y, [In] float camPos_Z,
Expand All @@ -420,7 +420,7 @@ public static extern int GeneratePlayspace_UpdateScan(
/// finalized. This should be called once the user is happy with the currently
/// scanned in playspace.
/// </summary>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern void GeneratePlayspace_RequestFinish();

/// <summary>
Expand All @@ -432,7 +432,7 @@ public static extern int GeneratePlayspace_UpdateScan(
/// <param name="vertexCount">Filled in with the number of vertices to be returned in the subsequent extract call</param>
/// <param name="indexCount">Filled in with the number of indices to be returned in the subsequent extract call</param>
/// <returns>Zero if fails, one if success</returns>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern int GeneratePlayspace_ExtractMesh_Setup(
[Out] out int vertexCount,
[Out] out int indexCount);
Expand All @@ -447,7 +447,7 @@ public static extern int GeneratePlayspace_ExtractMesh_Setup(
/// <param name="bufferIndexCount">Size of indices, in number of elements</param>
/// <param name="indices">Array to receive the mesh indices</param>
/// <returns>Zero if fails, one if success</returns>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern int GeneratePlayspace_ExtractMesh_Extract(
[In] int bufferVertexCount,
[In] IntPtr verticesPos, // (vertexCount) DirectX::XMFLOAT3*
Expand All @@ -460,7 +460,7 @@ public static extern int GeneratePlayspace_ExtractMesh_Extract(
/// </summary>
/// <param name="playspaceStats">playspace stats structure to receive the statistics data</param>
/// <returns>Zero if fails, one if success</returns>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern int QueryPlayspaceStats(
[In] IntPtr playspaceStats); // PlayspaceStats

Expand All @@ -469,7 +469,7 @@ public static extern int QueryPlayspaceStats(
/// </summary>
/// <param name="playspaceAlignment">playspace alignment structure to receive the alignment data</param>
/// <returns>Zero if fails, one if success</returns>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern int QueryPlayspaceAlignment(
[In] IntPtr playspaceAlignment); // PlayspaceAlignment

Expand All @@ -485,7 +485,7 @@ public static extern int QueryPlayspaceAlignment(
/// <param name="rayVec_Z">Ray direction vector, z component. Length of ray indicates the length of the ray cast query.</param>
/// <param name="result">Structure to receive the results of the raycast</param>
/// <returns>Zero if fails or no intersection, one if an intersection is detected</returns>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern int PlayspaceRaycast(
[In] float rayPos_X, [In] float rayPos_Y, [In] float rayPos_Z,
[In] float rayVec_X, [In] float rayVec_Y, [In] float rayVec_Z,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ public object Clone()
/// scanning phase has finish and the playspace has been finalized.
/// </summary>
/// <returns></returns>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern int Solver_Init();

/// <summary>
Expand All @@ -470,7 +470,7 @@ public object Clone()
/// <param name="placementConstraints">Array of ObjectPlacementConstraint structures, defining the constraints</param>
/// <param name="placementResult">Pointer to an ObjectPlacementResult structure to receive the result of the query </param>
/// <returns>Zero on failure, one on success</returns>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern int Solver_PlaceObject(
[In, MarshalAs(UnmanagedType.LPStr)] string objectName,
[In] IntPtr placementDefinition,// ObjectPlacementDefinition
Expand All @@ -488,7 +488,7 @@ public static extern int Solver_PlaceObject(
/// </summary>
/// <param name="objectName"></param>
/// <returns></returns>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern int Solver_RemoveObject(
[In, MarshalAs(UnmanagedType.LPStr)] string objectName);

Expand All @@ -498,7 +498,7 @@ public static extern int Solver_RemoveObject(
/// Objects placed with Solver_PlaceObject persist until removed
/// and are considered in subsequent queries by some rules and constraints.
/// </summary>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern void Solver_RemoveAllObjects();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ public static ShapeConstraint Create_AtRightOf(int componentIndexA, int componen
/// <param name="shapeData">An array of ShapeResult structures to receive the results of the query</param>
/// <returns>Number of positions found. This number will never exceed shapeCount (the space provided for the results in shapeData).</returns>
// Queries (shapes)
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern int QueryShape_FindPositionsOnShape(
[In, MarshalAs(UnmanagedType.LPStr)] string shapeName, // char*
[In] float minRadius,
Expand All @@ -853,7 +853,7 @@ public static extern int QueryShape_FindPositionsOnShape(
/// <param name="shapeCount">Length of the array passed in shapeData, the return value will never exceed this value</param>
/// <param name="shapeData">An array of ShapeResult structures to receive the results of the query</param>
/// <returns>Number of shapes found. This number will never exceed shapeCount (the space provided for the results in shapeData).</returns>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern int QueryShape_FindShapeHalfDims(
[In, MarshalAs(UnmanagedType.LPStr)] string shapeName, // char*
[In] int shapeCount, // Pass in the space allocated in shapeData
Expand All @@ -870,7 +870,7 @@ public static extern int QueryShape_FindShapeHalfDims(
/// <param name="shapeConstraints">Length of the shape constraint array passed in the constraints parameter</param>
/// <param name="constraints">Array of ShapeConstraint structures</param>
/// <returns></returns>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern int AddShape(
[In, MarshalAs(UnmanagedType.LPStr)] string shapeName,
[In] int componentCount,
Expand All @@ -882,13 +882,13 @@ public static extern int AddShape(
/// Runs the shape analysis. This should be called after scanning has been
/// finalized and shapes have been defined with AddShape.
/// </summary>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern void ActivateShapeAnalysis();

/// <summary>
/// Removes all shapes defined by AddShape.
/// </summary>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern void RemoveAllShapes();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public struct TopologyResult
/// <param name="locationData">Location result array of TopologyResult to be filled with the spaces found by the query</param>
/// <returns>Number of spaces found by the query. This value is limited by the number of results supplied by the caller (locationCount)</returns>
// Queries (topology)
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern int QueryTopology_FindPositionsOnWalls(
[In] float minHeightOfWallSpace,
[In] float minWidthOfWallSpace,
Expand All @@ -59,7 +59,7 @@ public static extern int QueryTopology_FindPositionsOnWalls(
/// <param name="locationCount">Number of location results supplied by the user in locationData</param>
/// <param name="locationData">Location result array of TopologyResult to be filled with the spaces found by the query</param>
/// <returns>Number of spaces found by the query. This value is limited by the number of results supplied by the caller (locationCount)</returns>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern int QueryTopology_FindLargePositionsOnWalls(
[In] float minHeightOfWallSpace,
[In] float minWidthOfWallSpace,
Expand All @@ -73,7 +73,7 @@ public static extern int QueryTopology_FindLargePositionsOnWalls(
/// </summary>
/// <param name="wall">Pointer to a TopologyResult structure, to be filled with the found wall</param>
/// <returns>Zero if fails, one if success</returns>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern int QueryTopology_FindLargestWall(
[In, Out] IntPtr wall); // TopologyResult

Expand All @@ -85,7 +85,7 @@ public static extern int QueryTopology_FindLargestWall(
/// <param name="locationCount">Number of location results supplied by the user in locationData</param>
/// <param name="locationData">Location result array of TopologyResult to be filled with the spaces found by the query</param>
/// <returns>Number of spaces found by the query. This value is limited by the number of results supplied by the caller (locationCount)</returns>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern int QueryTopology_FindPositionsOnFloor(
[In] float minLengthOfFloorSpace,
[In] float minWidthOfFloorSpace,
Expand All @@ -98,7 +98,7 @@ public static extern int QueryTopology_FindPositionsOnFloor(
/// <param name="locationCount">Number of location results supplied by the user in locationData</param>
/// <param name="locationData">Location result array of TopologyResult to be filled with the spaces found by the query</param>
/// <returns>Number of spaces found by the query. This value is limited by the number of results supplied by the caller (locationCount)</returns>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern int QueryTopology_FindLargestPositionsOnFloor(
[In] int locationCount, // Pass in the space allocated in locationData
[In, Out] IntPtr locationData); // TopologyResult
Expand All @@ -112,7 +112,7 @@ public static extern int QueryTopology_FindLargestPositionsOnFloor(
/// <param name="locationCount">Number of location results supplied by the user in locationData</param>
/// <param name="locationData">Location result array of TopologyResult to be filled with the spaces found by the query</param>
/// <returns>Number of spaces found by the query. This value is limited by the number of results supplied by the caller (locationCount)</returns>
[DllImport("SpatialUnderstanding")]
[DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
public static extern int QueryTopology_FindPositionsSittable(
[In] float minHeight,
[In] float maxHeight,
Expand Down

0 comments on commit 701f292

Please sign in to comment.