コード例 #1
0
ファイル: Functions.cs プロジェクト: alexey-bez/SharpDX
        /// <summary>	
        /// No documentation.	
        /// </summary>	
        /// <param name="meshRef">No documentation.</param>	
        /// <param name="adjacencyRef">No documentation.</param>	
        /// <param name="vertexAttributeWeightsRef">No documentation.</param>	
        /// <param name="vertexWeightsRef">No documentation.</param>	
        /// <param name="sMeshOut">No documentation.</param>	
        /// <returns>No documentation.</returns>	
        /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='D3DXCreateSPMesh']/*"/>	
        /// <unmanaged>HRESULT D3DXCreateSPMesh([In] ID3DXMesh* pMesh,[In] const unsigned int* pAdjacency,[In] const D3DXATTRIBUTEWEIGHTS* pVertexAttributeWeights,[In] const float* pVertexWeights,[In] ID3DXSPMesh** ppSMesh)</unmanaged>	
        /// <unmanaged-short>D3DXCreateSPMesh</unmanaged-short>	
        public static void CreateSPMesh(SharpDX.Direct3D9.Mesh meshRef, int adjacencyRef, ref SharpDX.Direct3D9.AttributeWeights vertexAttributeWeightsRef, float vertexWeightsRef, out SharpDX.Direct3D9.SimplificationMesh sMeshOut) {
            unsafe {
                var vertexAttributeWeightsRef_ = new SharpDX.Direct3D9.AttributeWeights.__Native();
                vertexAttributeWeightsRef.__MarshalTo(ref vertexAttributeWeightsRef_);
                IntPtr sMeshOut_ = IntPtr.Zero;
                SharpDX.Result __result__;
                __result__= 
				D3DXCreateSPMesh_((void*)((meshRef == null)?IntPtr.Zero:meshRef.NativePointer), &adjacencyRef, &vertexAttributeWeightsRef_, &vertexWeightsRef, &sMeshOut_);		
                vertexAttributeWeightsRef.__MarshalFree(ref vertexAttributeWeightsRef_);
                sMeshOut= (sMeshOut_ == IntPtr.Zero)?null:new SharpDX.Direct3D9.SimplificationMesh(sMeshOut_);	
                __result__.CheckError();
            }
        }
コード例 #2
0
ファイル: Functions.cs プロジェクト: alexey-bez/SharpDX
        /// <summary>	
        /// <p>Generates a simplified mesh using the provided weights that come as close as possible to the given MinValue.</p>	
        /// </summary>	
        /// <param name="meshRef"><dd>  <p>Pointer to an <strong><see cref="SharpDX.Direct3D9.Mesh"/></strong> interface, representing the source mesh.</p> </dd></param>	
        /// <param name="adjacencyRef"><dd>  <p>Pointer to an array of three  DWORDs per face that specify the three neighbors for each face in the mesh to be simplified.</p> </dd></param>	
        /// <param name="vertexAttributeWeightsRef"><dd>  <p>Pointer to a <strong><see cref="SharpDX.Direct3D9.AttributeWeights"/></strong> structure, containing the weight for each vertex component. If this parameter is set to <strong><c>null</c></strong>, a default structure is used. See Remarks.</p> </dd></param>	
        /// <param name="vertexWeightsRef"><dd>  <p>Pointer to an array of vertex weights. If this parameter is set to <strong><c>null</c></strong>, all vertex weights are set to 1.0.</p> </dd></param>	
        /// <param name="minValue"><dd>  <p>Number of vertices or faces, depending on the flag set in the  <em>Options</em> parameter, by which to simplify the source mesh.</p> </dd></param>	
        /// <param name="options"><dd>  <p>Specifies simplification options for the mesh. One of the flags in <strong>D3DXMESHSIMP</strong> can be set.</p> </dd></param>	
        /// <param name="meshOut"><dd>  <p>Address of a reference to an <strong><see cref="SharpDX.Direct3D9.Mesh"/></strong> interface, representing the returned simplification mesh.</p> </dd></param>	
        /// <returns><p>If the function succeeds, the return value is <see cref="SharpDX.Direct3D9.ResultCode.Success"/>. If the function fails, the return value can be one of the following: <see cref="SharpDX.Direct3D9.ResultCode.InvalidCall"/>, D3DXERR_INVALIDDATA, E_OUTOFMEMORY.</p></returns>	
        /// <remarks>	
        /// <p>This function generates a mesh that has <em>MinValue</em> vertices or faces.</p><p>If the simplification process cannot reduce the mesh to <em>MinValue</em>, the call still succeeds because <em>MinValue</em> is a desired minimum, not an absolute minimum.</p><p>If <em>pVertexAttributeWeights</em> is set to <strong><c>null</c></strong>, the following values are assigned to the default <strong><see cref="SharpDX.Direct3D9.AttributeWeights"/></strong> structure.</p><pre> <see cref="SharpDX.Direct3D9.AttributeWeights"/> AttributeWeights; AttributeWeights.Position  = 1.0;	
        /// AttributeWeights.Boundary =  1.0;	
        /// AttributeWeights.Normal   =  1.0;	
        /// AttributeWeights.Diffuse  =  0.0;	
        /// AttributeWeights.Specular =  0.0;	
        /// AttributeWeights.Tex[8]   =  {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};	
        /// </pre><p>This default structure is what most applications should use because it considers only geometric and normal adjustment. Only in special cases will the other member fields need to be modified. </p>	
        /// </remarks>	
        /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='D3DXSimplifyMesh']/*"/>	
        /// <msdn-id>bb205463</msdn-id>	
        /// <unmanaged>HRESULT D3DXSimplifyMesh([In] ID3DXMesh* pMesh,[In] const unsigned int* pAdjacency,[In] const D3DXATTRIBUTEWEIGHTS* pVertexAttributeWeights,[In] const float* pVertexWeights,[In] unsigned int MinValue,[In] unsigned int Options,[In] ID3DXMesh** ppMesh)</unmanaged>	
        /// <unmanaged-short>D3DXSimplifyMesh</unmanaged-short>	
        public static void SimplifyMesh(SharpDX.Direct3D9.Mesh meshRef, int adjacencyRef, ref SharpDX.Direct3D9.AttributeWeights vertexAttributeWeightsRef, float vertexWeightsRef, int minValue, int options, out SharpDX.Direct3D9.Mesh meshOut) {
            unsafe {
                var vertexAttributeWeightsRef_ = new SharpDX.Direct3D9.AttributeWeights.__Native();
                vertexAttributeWeightsRef.__MarshalTo(ref vertexAttributeWeightsRef_);
                IntPtr meshOut_ = IntPtr.Zero;
                SharpDX.Result __result__;
                __result__= 
				D3DXSimplifyMesh_((void*)((meshRef == null)?IntPtr.Zero:meshRef.NativePointer), &adjacencyRef, &vertexAttributeWeightsRef_, &vertexWeightsRef, minValue, options, &meshOut_);		
                vertexAttributeWeightsRef.__MarshalFree(ref vertexAttributeWeightsRef_);
                meshOut= (meshOut_ == IntPtr.Zero)?null:new SharpDX.Direct3D9.Mesh(meshOut_);	
                __result__.CheckError();
            }
        }
コード例 #3
0
ファイル: Interfaces.cs プロジェクト: alexey-bez/SharpDX
        /// <summary>	
        /// No documentation.	
        /// </summary>	
        /// <param name="vertexAttributeWeightsRef">No documentation.</param>	
        /// <returns>No documentation.</returns>	
        /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='ID3DXSPMesh::GetVertexAttributeWeights']/*"/>	
        /// <unmanaged>HRESULT ID3DXSPMesh::GetVertexAttributeWeights([In] D3DXATTRIBUTEWEIGHTS* pVertexAttributeWeights)</unmanaged>	
        /// <unmanaged-short>ID3DXSPMesh::GetVertexAttributeWeights</unmanaged-short>	
        public void GetVertexAttributeWeights(ref SharpDX.Direct3D9.AttributeWeights vertexAttributeWeightsRef) {
            unsafe {
                var vertexAttributeWeightsRef_ = new SharpDX.Direct3D9.AttributeWeights.__Native();
                vertexAttributeWeightsRef.__MarshalTo(ref vertexAttributeWeightsRef_);
                SharpDX.Result __result__;
                __result__= 
				SharpDX.Direct3D9.LocalInterop.Calliint(_nativePointer, &vertexAttributeWeightsRef_,((void**)(*(void**)_nativePointer))[17]);		
                vertexAttributeWeightsRef.__MarshalFree(ref vertexAttributeWeightsRef_);
                __result__.CheckError();
            }
        }