bullet3/examples/OpenCL/rigidbody/GpuRigidBodyDemo.h
Erwin Coumans dcd02a1e15 add option to terminate PGS constraint solvers based on a least square residual threshold
(for example solverInfo().m_leastSquaresResidualThreshold = 1e-7 and use large m_numSolverIterations
disable sphere-sphere contact cache, it is buggy (some contact point stay in the cache, when sphere penetrates more than total margins)
tweak some gpu demo settings
2016-12-16 18:09:52 -08:00

49 lines
1.0 KiB
C++

#ifndef GPU_RIGID_BODY_DEMO_H
#define GPU_RIGID_BODY_DEMO_H
#include "Bullet3Common/b3Vector3.h"
#include "../CommonOpenCL/CommonOpenCLBase.h"
class GpuRigidBodyDemo : public CommonOpenCLBase
{
protected:
class GLInstancingRenderer* m_instancingRenderer;
class GLPrimitiveRenderer* m_primRenderer;
class CommonWindowInterface* m_window;
struct GpuRigidBodyDemoInternalData* m_data;
public:
GpuRigidBodyDemo(GUIHelperInterface* helper);
virtual ~GpuRigidBodyDemo();
virtual void initPhysics();
virtual void setupScene();
virtual void destroyScene(){};
virtual void exitPhysics();
virtual void renderScene();
void resetCamera();
virtual void stepSimulation(float deltaTime);
//for picking
b3Vector3 getRayTo(int x,int y);
virtual bool mouseMoveCallback(float x,float y);
virtual bool mouseButtonCallback(int button, int state, float x, float y);
virtual bool keyboardCallback(int key, int state);
unsigned char* loadImage(const char* fileName, int& width, int& height, int& n);
};
#endif //GPU_RIGID_BODY_DEMO_H