btSoftBodySolverVertexData_DX11.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004 
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose, 
00008 including commercial applications, and to alter it and redistribute it freely, 
00009 subject to the following restrictions:
00010 
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015 
00016 
00017 #include "BulletMultiThreaded/GpuSoftBodySolvers/Shared/btSoftBodySolverData.h"
00018 #include "btSoftBodySolverBuffer_DX11.h"
00019 
00020 
00021 #ifndef BT_SOFT_BHODY_SOLVER_VERTEX_DATA_DX11_H
00022 #define BT_SOFT_BHODY_SOLVER_VERTEX_DATA_DX11_H
00023 
00024 class btSoftBodyLinkData;
00025 class btSoftBodyLinkData::LinkDescription;
00026 
00027 struct ID3D11Device;
00028 struct ID3D11DeviceContext;
00029 
00030 class btSoftBodyVertexDataDX11 : public btSoftBodyVertexData
00031 {
00032 protected:
00033         bool                            m_onGPU;
00034         ID3D11Device            *m_d3dDevice;
00035         ID3D11DeviceContext *m_d3dDeviceContext;
00036 
00037 public:
00038         btDX11Buffer<int>                                                                               m_dx11ClothIdentifier;
00039         btDX11Buffer<Vectormath::Aos::Point3>                                   m_dx11VertexPosition;
00040         btDX11Buffer<Vectormath::Aos::Point3>                                   m_dx11VertexPreviousPosition;
00041         btDX11Buffer<Vectormath::Aos::Vector3>                          m_dx11VertexVelocity;
00042         btDX11Buffer<Vectormath::Aos::Vector3>                          m_dx11VertexForceAccumulator;
00043         btDX11Buffer<Vectormath::Aos::Vector3>                          m_dx11VertexNormal;
00044         btDX11Buffer<float>                                                                     m_dx11VertexInverseMass;
00045         btDX11Buffer<float>                                                                     m_dx11VertexArea;
00046         btDX11Buffer<int>                                                                               m_dx11VertexTriangleCount;
00047 
00048 
00049         //ID3D11Buffer*               readBackBuffer;
00050 
00051 public:
00052         btSoftBodyVertexDataDX11( ID3D11Device *d3dDevice, ID3D11DeviceContext *d3dDeviceContext );
00053         virtual ~btSoftBodyVertexDataDX11();
00054 
00055         virtual bool onAccelerator();
00056         virtual bool moveToAccelerator();
00057 
00058         virtual bool moveFromAccelerator(bool bCopy = false, bool bCopyMinimum = true);
00059 };
00060 
00061 
00062 #endif // #ifndef BT_SOFT_BHODY_SOLVER_VERTEX_DATA_DX11_H
00063