Bullet Collision Detection & Physics Library: btNNCGConstraintSolver.h Source File

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

btNNCGConstraintSolver.h
Go to the documentation of this file.
1/*
2Bullet Continuous Collision Detection and Physics Library
3Copyright (c) 2003-2006 Erwin Coumans https://bulletphysics.org
4
5This software is provided 'as-is', without any express or implied warranty.
6In no event will the authors be held liable for any damages arising from the use of this software.
7Permission is granted to anyone to use this software for any purpose,
8including commercial applications, and to alter it and redistribute it freely,
9subject to the following restrictions:
10
111. 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.
122. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
133. This notice may not be removed or altered from any source distribution.
14*/
15
16#ifndef BT_NNCG_CONSTRAINT_SOLVER_H
17#define BT_NNCG_CONSTRAINT_SOLVER_H
18
19#include "btSequentialImpulseConstraintSolver.h"
20
21 ATTRIBUTE_ALIGNED16(class)
22 btNNCGConstraintSolver : public btSequentialImpulseConstraintSolver
23{
24protected:
25 btScalar m_deltafLengthSqrPrev;
26
27 btAlignedObjectArray<btScalar> m_pNC; // p for None Contact constraints
28 btAlignedObjectArray<btScalar> m_pC; // p for Contact constraints
29 btAlignedObjectArray<btScalar> m_pCF; // p for ContactFriction constraints
30 btAlignedObjectArray<btScalar> m_pCRF; // p for ContactRollingFriction constraints
31
32 //These are recalculated in every iterations. We just keep these to prevent reallocation in each iteration.
33 btAlignedObjectArray<btScalar> m_deltafNC; // deltaf for NoneContact constraints
34 btAlignedObjectArray<btScalar> m_deltafC; // deltaf for Contact constraints
35 btAlignedObjectArray<btScalar> m_deltafCF; // deltaf for ContactFriction constraints
36 btAlignedObjectArray<btScalar> m_deltafCRF; // deltaf for ContactRollingFriction constraints
37
38protected:
39 virtual btScalar solveGroupCacheFriendlyFinish(btCollisionObject * *bodies, int numBodies, const btContactSolverInfo& infoGlobal);
40 virtual btScalar solveSingleIteration(int iteration, btCollisionObject** bodies, int numBodies, btPersistentManifold** manifoldPtr, int numManifolds, btTypedConstraint** constraints, int numConstraints, const btContactSolverInfo& infoGlobal, btIDebugDraw* debugDrawer);
41
42 virtual btScalar solveGroupCacheFriendlySetup(btCollisionObject * *bodies, int numBodies, btPersistentManifold** manifoldPtr, int numManifolds, btTypedConstraint** constraints, int numConstraints, const btContactSolverInfo& infoGlobal, btIDebugDraw* debugDrawer);
43
44public:
45 BT_DECLARE_ALIGNED_ALLOCATOR();
46
47 btNNCGConstraintSolver() : btSequentialImpulseConstraintSolver(), m_onlyForNoneContact(false) {}
48
49 virtual btConstraintSolverType getSolverType() const
50 {
51 return BT_NNCG_SOLVER;
52 }
53
54 bool m_onlyForNoneContact;
55};
56
57#endif //BT_NNCG_CONSTRAINT_SOLVER_H
btConstraintSolverType
btConstraintSolverType
btConstraintSolver provides solver interface
Definition btConstraintSolver.h:33
BT_NNCG_SOLVER
@ BT_NNCG_SOLVER
Definition btConstraintSolver.h:36
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition btScalar.h:314
ATTRIBUTE_ALIGNED16
#define ATTRIBUTE_ALIGNED16(a)
Definition btScalar.h:99
btSequentialImpulseConstraintSolver.h
btAlignedObjectArray
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
Definition btAlignedObjectArray.h:46
btCollisionObject
btCollisionObject can be used to manage collision detection objects.
Definition btCollisionObject.h:51
btIDebugDraw
The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations.
Definition btIDebugDraw.h:27
btNNCGConstraintSolver
Definition btNNCGConstraintSolver.h:23
btNNCGConstraintSolver::m_pCF
btAlignedObjectArray< btScalar > m_pCF
Definition btNNCGConstraintSolver.h:29
btNNCGConstraintSolver::m_deltafCF
btAlignedObjectArray< btScalar > m_deltafCF
Definition btNNCGConstraintSolver.h:35
btNNCGConstraintSolver::m_deltafLengthSqrPrev
btScalar m_deltafLengthSqrPrev
Definition btNNCGConstraintSolver.h:25
btNNCGConstraintSolver::BT_DECLARE_ALIGNED_ALLOCATOR
BT_DECLARE_ALIGNED_ALLOCATOR()
btNNCGConstraintSolver::btNNCGConstraintSolver
btNNCGConstraintSolver()
Definition btNNCGConstraintSolver.h:47
btNNCGConstraintSolver::m_deltafC
btAlignedObjectArray< btScalar > m_deltafC
Definition btNNCGConstraintSolver.h:34
btNNCGConstraintSolver::m_deltafNC
btAlignedObjectArray< btScalar > m_deltafNC
Definition btNNCGConstraintSolver.h:33
btNNCGConstraintSolver::m_deltafCRF
btAlignedObjectArray< btScalar > m_deltafCRF
Definition btNNCGConstraintSolver.h:36
btNNCGConstraintSolver::m_pCRF
btAlignedObjectArray< btScalar > m_pCRF
Definition btNNCGConstraintSolver.h:30
btNNCGConstraintSolver::getSolverType
virtual btConstraintSolverType getSolverType() const
Definition btNNCGConstraintSolver.h:49
btNNCGConstraintSolver::m_pC
btAlignedObjectArray< btScalar > m_pC
Definition btNNCGConstraintSolver.h:28
btNNCGConstraintSolver::m_onlyForNoneContact
bool m_onlyForNoneContact
Definition btNNCGConstraintSolver.h:54
btNNCGConstraintSolver::m_pNC
btAlignedObjectArray< btScalar > m_pNC
Definition btNNCGConstraintSolver.h:27
btPersistentManifold
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
Definition btPersistentManifold.h:65
btSequentialImpulseConstraintSolver
The btSequentialImpulseConstraintSolver is a fast SIMD implementation of the Projected Gauss Seidel (...
Definition btSequentialImpulseConstraintSolver.h:52
btTypedConstraint
TypedConstraint is the baseclass for Bullet constraints and vehicles.
Definition btTypedConstraint.h:76
btContactSolverInfo
Definition btContactSolverInfo.h:76