work-in-progress Bullet 3.x GPU raytest

work-in-progress P2P constraint for b3GpuDynamicsWorld
This commit is contained in:
erwincoumans
2013-06-17 13:47:35 -07:00
parent 02a858e7c1
commit 161c48d331
14 changed files with 192 additions and 60 deletions

View File

@@ -15,9 +15,9 @@ subject to the following restrictions:
///create 125 (5x5x5) dynamic object
#define ARRAY_SIZE_X 25
#define ARRAY_SIZE_Y 20
#define ARRAY_SIZE_Z 25
#define ARRAY_SIZE_X 1//25
#define ARRAY_SIZE_Y 20//20
#define ARRAY_SIZE_Z 1//25
//maximum number of objects (and allow user to shoot additional boxes)
#define MAX_PROXIES (ARRAY_SIZE_X*ARRAY_SIZE_Y*ARRAY_SIZE_Z + 1024)
@@ -283,8 +283,9 @@ void BasicGpuDemo::initPhysics()
//create a few dynamic rigidbodies
// Re-using the same collision is better for memory usage and performance
btBoxShape* colShape = new btBoxShape(btVector3(SCALING*1,SCALING*1,SCALING*1));
//btCollisionShape* colShape = new btSphereShape(btScalar(1.));
//btBoxShape* colShape = new btBoxShape(btVector3(SCALING*1,SCALING*1,SCALING*1));
btCollisionShape* colShape = new btSphereShape(btScalar(SCALING*1.f));
m_collisionShapes.push_back(colShape);
/// Create Dynamic Objects

View File

@@ -76,7 +76,7 @@ GpuDemo::CreateFunc* allDemos[]=
// GpuConvexScene::MyCreateFunc,
//ConcaveSphereScene::MyCreateFunc,
//GpuRaytraceScene::MyCreateFunc,
@@ -108,7 +108,7 @@ GpuDemo::CreateFunc* allDemos[]=
PairBench::MyCreateFunc,
GpuRaytraceScene::MyCreateFunc,
//GpuRigidBodyDemo::MyCreateFunc,
//BroadphaseBenchmark::CreateFunc,

View File

@@ -235,8 +235,8 @@ GpuRaytraceScene::GpuRaytraceScene()
m_raytraceData = new GpuRaytraceInternalData;
m_raytraceData->m_texId = new GLuint;
m_raytraceData->textureWidth = 256;//1024;
m_raytraceData->textureHeight = 256;
m_raytraceData->textureWidth = 1024;//1024;
m_raytraceData->textureHeight = 1024;
//create new texture
glGenTextures(1, m_raytraceData->m_texId);
@@ -354,7 +354,7 @@ b3AlignedObjectArray<b3RayInfo> rays;
void GpuRaytraceScene::renderScene()
{
GpuBoxPlaneScene::renderScene();
//GpuBoxPlaneScene::renderScene();
B3_PROFILE("raytrace");
//raytrace into the texels
@@ -458,7 +458,10 @@ void GpuRaytraceScene::renderScene()
}
m_raycaster->castRaysHost(rays, hits, this->m_data->m_np->getNumRigidBodies(), m_data->m_np->getBodiesCpu(), m_data->m_np->getNumCollidablesGpu(), m_data->m_np->getCollidablesCpu());
//m_raycaster->castRaysHost(rays, hits, this->m_data->m_np->getNumRigidBodies(), m_data->m_np->getBodiesCpu(), m_data->m_np->getNumCollidablesGpu(), m_data->m_np->getCollidablesCpu());
m_raycaster->castRays(rays, hits, this->m_data->m_np->getNumRigidBodies(), m_data->m_np->getBodiesCpu(), m_data->m_np->getNumCollidablesGpu(), m_data->m_np->getCollidablesCpu());
{
B3_PROFILE("write texels");