Bullet Collision Detection & Physics Library
btSoftBodySolver_DX11SIMDAware.h
Go to the documentation of this file.
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
4 
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it freely,
9 subject to the following restrictions:
10 
11 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.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
14 */
15 
16 #include "vectormath/vmInclude.h"
17 #include "btSoftBodySolver_DX11.h"
22 
23 
24 #ifndef BT_SOFT_BODY_DX11_SOLVER_SIMDAWARE_H
25 #define BT_SOFT_BODY_DX11_SOLVER_SIMDAWARE_H
26 
28 {
29 protected:
31  {
32  int startWave;
33  int numWaves;
34  float kst;
35  float ti;
36  };
37 
38 
41 
44 
45 
46  virtual bool buildShaders();
47 
48  void updateConstants( float timeStep );
49 
50 
52  // Kernel dispatches
53 
54 
55  void solveLinksForPosition( int startLink, int numLinks, float kst, float ti );
56 
57  // End kernel dispatches
59 
60 
61 
62 public:
63  btDX11SIMDAwareSoftBodySolver(ID3D11Device * dx11Device, ID3D11DeviceContext* dx11Context, DXFunctions::CompileFromMemoryFunc dx11CompileFromMemory = &D3DX11CompileFromMemory);
64 
66 
68 
69  virtual void optimize( btAlignedObjectArray< btSoftBody * > &softBodies , bool forceUpdate=false);
70 
71  virtual void solveConstraints( float solverdt );
72 
73  virtual SolverTypes getSolverType() const
74  {
75  return DX_SIMD_SOLVER;
76  }
77 
78 };
79 
80 #endif // #ifndef BT_SOFT_BODY_DX11_SOLVER_SIMDAWARE_H
81 
virtual void optimize(btAlignedObjectArray< btSoftBody * > &softBodies, bool forceUpdate=false)
Optimize soft bodies in this solver.
virtual SolverTypes getSolverType() const
Return the type of the solver.
virtual void solveConstraints(float solverdt)
Solve constraints for a set of soft bodies.
bool m_updateSolverConstants
Variable to define whether we need to update solver constants on the next iteration.
void solveLinksForPosition(int startLink, int numLinks, float kst, float ti)
virtual btSoftBodyLinkData & getLinkData()
btDX11SIMDAwareSoftBodySolver(ID3D11Device *dx11Device, ID3D11DeviceContext *dx11Context, DXFunctions::CompileFromMemoryFunc dx11CompileFromMemory=&D3DX11CompileFromMemory)
HRESULT(WINAPI * CompileFromMemoryFunc)(LPCSTR, SIZE_T, LPCSTR, const D3D10_SHADER_MACRO *, LPD3D10INCLUDE, LPCSTR, LPCSTR, UINT, UINT, ID3DX11ThreadPump *, ID3D10Blob **, ID3D10Blob **, HRESULT *)
btSoftBodyLinkDataDX11SIMDAware m_linkData
Link data for all cloths.