+++ /dev/null
-/*\r
-* Copyright (c) 2007-2010 SlimDX Group\r
-* \r
-* Permission is hereby granted, free of charge, to any person obtaining a copy\r
-* of this software and associated documentation files (the "Software"), to deal\r
-* in the Software without restriction, including without limitation the rights\r
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
-* copies of the Software, and to permit persons to whom the Software is\r
-* furnished to do so, subject to the following conditions:\r
-* \r
-* The above copyright notice and this permission notice shall be included in\r
-* all copies or substantial portions of the Software.\r
-* \r
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
-* THE SOFTWARE.\r
-*/\r
-#pragma once\r
-\r
-#include "../math/Matrix.h"\r
-#include "../math/Ray.h"\r
-\r
-#include "XFile.h"\r
-#include "BaseMesh.h"\r
-\r
-#include "EffectDefault.h"\r
-#include "EffectInstance.h"\r
-#include "ExtendedMaterial.h"\r
-#include "GlyphMetricsFloat.h"\r
-#include "AttributeWeights.h"\r
-#include "WeldEpsilons.h"\r
-\r
-namespace SlimDX\r
-{\r
- namespace Direct3D9\r
- {\r
- ref class SkinInfo;\r
-\r
- /// <summary>\r
- /// Provides an interface to manipulate mesh objects.\r
- /// </summary>\r
- /// <unmanaged>ID3DXMesh</unmanaged>\r
- public ref class Mesh : public BaseMesh\r
- {\r
- COMOBJECT(ID3DXMesh, Mesh);\r
-\r
- private:\r
- array<int>^ adjacency;\r
- array<ExtendedMaterial>^ materials;\r
- array<EffectInstance>^ effects;\r
- SkinInfo^ skinInfo;\r
-\r
- static Mesh^ FromMemory_Internal( SlimDX::Direct3D9::Device^ device, const void* memory, DWORD size, MeshFlags flags );\r
-\r
- internal:\r
- void SetAdjacency( DWORD *adjacency );\r
-\r
- public:\r
- Mesh( SlimDX::Direct3D9::Device^ device, int faceCount, int vertexCount, MeshFlags options, array<VertexElement>^ vertexDeclaration );\r
- Mesh( SlimDX::Direct3D9::Device^ device, int faceCount, int vertexCount, MeshFlags options, SlimDX::Direct3D9::VertexFormat fvf );\r
- virtual ~Mesh() { }\r
-\r
- static Mesh^ FromMemory( SlimDX::Direct3D9::Device^ device, array<System::Byte>^ memory, MeshFlags flags );\r
- static Mesh^ FromStream( SlimDX::Direct3D9::Device^ device, System::IO::Stream^ stream, MeshFlags flags );\r
- static Mesh^ FromFile( SlimDX::Direct3D9::Device^ device, System::String^ fileName, MeshFlags flags );\r
- static Mesh^ FromXFile( SlimDX::Direct3D9::Device^ device, XFileData^ xfile, MeshFlags flags );\r
-\r
- static Result ToXFile( Mesh^ mesh, System::String^ fileName, XFileFormat format, System::Runtime::InteropServices::CharSet charSet );\r
- static Result ToXFile( Mesh^ mesh, System::String^ fileName, XFileFormat format );\r
-\r
- static Mesh^ CreateBox( SlimDX::Direct3D9::Device^ device, float width, float height, float depth );\r
- static Mesh^ CreateCylinder( SlimDX::Direct3D9::Device^ device, float radius1, float radius2, float length, int slices, int stacks );\r
- static Mesh^ CreateSphere( SlimDX::Direct3D9::Device^ device, float radius, int slices, int stacks );\r
- static Mesh^ CreateTeapot( SlimDX::Direct3D9::Device^ device );\r
- static Mesh^ CreateTorus( SlimDX::Direct3D9::Device^ device, float innerRadius, float outerRadius, int sides, int rings );\r
-\r
- static Mesh^ CreateText( SlimDX::Direct3D9::Device^ device, System::Drawing::Font^ font, System::String^ text, float deviation, float extrusion, [Out] array<GlyphMetricsFloat>^% glyphMetrics );\r
- static Mesh^ CreateText( SlimDX::Direct3D9::Device^ device, System::Drawing::Font^ font, System::String^ text, float deviation, float extrusion );\r
-\r
- static Mesh^ Concatenate( SlimDX::Direct3D9::Device^ device, array<Mesh^>^ meshes, MeshFlags options, array<Matrix>^ geometryTransforms, array<Matrix>^ textureTransforms, array<VertexElement>^ vertexDeclaration );\r
- static Mesh^ Concatenate( SlimDX::Direct3D9::Device^ device, array<Mesh^>^ meshes, MeshFlags options, array<Matrix>^ geometryTransforms, array<Matrix>^ textureTransforms );\r
- static Mesh^ Concatenate( SlimDX::Direct3D9::Device^ device, array<Mesh^>^ meshes, MeshFlags options );\r
-\r
- static Mesh^ Simplify( Mesh^ mesh, array<AttributeWeights>^ attributeWeights, array<float>^ vertexWeights, int minimumValue, MeshSimplification options );\r
- static Mesh^ Simplify( Mesh^ mesh, array<AttributeWeights>^ attributeWeights, int minimumValue, MeshSimplification options );\r
- static Mesh^ Simplify( Mesh^ mesh, int minimumValue, MeshSimplification options );\r
-\r
- static Mesh^ TessellateNPatches( Mesh^ mesh, float segmentCount, bool quadraticInterpolation );\r
-\r
- void GenerateAdjacency( float epsilon ) new;\r
-\r
- System::String^ Validate();\r
-\r
- DataStream^ LockAttributeBuffer( LockFlags flags );\r
- Result UnlockAttributeBuffer();\r
- Result SetAttributeTable( array<AttributeRange>^ table );\r
-\r
- Result OptimizeInPlace( MeshOptimizeFlags flags, [Out] array<int>^% faceRemap, [Out] array<int>^% vertexRemap );\r
- Result OptimizeInPlace( MeshOptimizeFlags flags );\r
-\r
- Mesh^ Optimize( MeshOptimizeFlags flags, [Out] array<int>^% faceRemap, [Out] array<int>^% vertexRemap );\r
- Mesh^ Optimize( MeshOptimizeFlags flags );\r
-\r
- Mesh^ Clean( CleanType type, [Out] System::String^% errorsAndWarnings );\r
- Mesh^ Clean( CleanType type );\r
- \r
- Result ComputeNormals();\r
- Result ComputeTangent( int textureStage, int tangentIndex, int binormalIndex, bool wrap );\r
- Result ComputeTangentFrame( TangentOptions options );\r
-\r
- Mesh^ ComputeTangentFrame( int textureInSemantic, int textureInIndex, int partialOutSemanticU, \r
- int partialOutIndexU, int partialOutSemanticV, int partialOutIndexV, int normalOutSemantic,\r
- int normalOutIndex, TangentOptions options, float partialEdgeThreshold,\r
- float singularPointThreshold, float normalEdgeThreshold, [Out] array<int>^% vertexMapping );\r
-\r
- Mesh^ ComputeTangentFrame( int textureInSemantic, int textureInIndex, int partialOutSemanticU, \r
- int partialOutIndexU, int partialOutSemanticV, int partialOutIndexV, int normalOutSemantic,\r
- int normalOutIndex, TangentOptions options, float partialEdgeThreshold,\r
- float singularPointThreshold, float normalEdgeThreshold );\r
-\r
- Result TessellateRectanglePatch( SlimDX::Direct3D9::VertexBuffer^ vertexBuffer, array<float>^ segmentCounts, \r
- array<VertexElement>^ vertexDeclaration, RectanglePatchInfo rectanglePatchInfo );\r
-\r
- Result TessellateTrianglePatch( SlimDX::Direct3D9::VertexBuffer^ vertexBuffer, array<float>^ segmentCounts,\r
- array<VertexElement>^ vertexDeclaration, TrianglePatchInfo trianglePatchInfo );\r
-\r
- array<ExtendedMaterial>^ GetMaterials() { return materials; }\r
- void SetMaterials( array<ExtendedMaterial>^ value ) { materials = value; }\r
-\r
- array<EffectInstance>^ GetEffects() { return effects; }\r
- void SetEffects( array<EffectInstance>^ value ) { effects = value; }\r
-\r
- void SetAdjacency( array<int>^ adjacency ) { this->adjacency = adjacency; }\r
- array<int>^ GetAdjacency() { return adjacency; }\r
-\r
- Result WeldVertices( WeldFlags flags, WeldEpsilons epsilons, [Out] array<int>^% faceRemap, [Out] array<int>^% vertexRemap );\r
- Result WeldVertices( WeldFlags flags, [Out] array<int>^% faceRemap, [Out] array<int>^% vertexRemap );\r
- Result WeldVertices( WeldFlags flags, WeldEpsilons epsilons );\r
- Result WeldVertices( WeldFlags flags );\r
-\r
- property SkinInfo^ SkinInfo\r
- { \r
- SlimDX::Direct3D9::SkinInfo^ get() { return skinInfo; }\r
- void set( SlimDX::Direct3D9::SkinInfo^ value ) { skinInfo = value; }\r
- }\r
- };\r
- }\r
-}\r