move b3RaycastInfo.h so it can be used without OpenCL dependency
add b3Assert to make sure m_maxShapeCapacityInBytes is not exceeded in GLInstancingRenderer prepare for CpuSoftClothDemo
This commit is contained in:
@@ -100,12 +100,14 @@ struct EmptyDemo : public CpuDemo
|
|||||||
};
|
};
|
||||||
#include "rendering/RenderDemo.h"
|
#include "rendering/RenderDemo.h"
|
||||||
#include "rigidbody/RigidBodyDemo.h"
|
#include "rigidbody/RigidBodyDemo.h"
|
||||||
|
#include "deformable/CpuSoftBodyDemo.h"
|
||||||
|
|
||||||
|
|
||||||
b3AlignedObjectArray<const char*> demoNames;
|
b3AlignedObjectArray<const char*> demoNames;
|
||||||
int selectedDemo = 0;
|
int selectedDemo = 0;
|
||||||
CpuDemo::CreateFunc* allDemos[]=
|
CpuDemo::CreateFunc* allDemos[]=
|
||||||
{
|
{
|
||||||
|
//CpuSoftClothDemo::MyCreateFunc,
|
||||||
RigidBodyDemo::MyCreateFunc,
|
RigidBodyDemo::MyCreateFunc,
|
||||||
RenderDemo::MyCreateFunc,
|
RenderDemo::MyCreateFunc,
|
||||||
EmptyDemo::MyCreateFunc,
|
EmptyDemo::MyCreateFunc,
|
||||||
@@ -627,7 +629,7 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
|
|
||||||
int maxObjectCapacity=1024*1024;//128*1024;
|
int maxObjectCapacity=1024*1024;//128*1024;
|
||||||
int maxShapeCapacityInBytes=128*1024;
|
int maxShapeCapacityInBytes=10*1024*1024;
|
||||||
|
|
||||||
//maxObjectCapacity = b3Max(maxObjectCapacity,ci.arraySizeX*ci.arraySizeX*ci.arraySizeX+10);
|
//maxObjectCapacity = b3Max(maxObjectCapacity,ci.arraySizeX*ci.arraySizeX*ci.arraySizeX+10);
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ struct RigidBodyDemo : public CpuDemo
|
|||||||
{
|
{
|
||||||
|
|
||||||
struct b3DynamicBvhBroadphase* m_bp;
|
struct b3DynamicBvhBroadphase* m_bp;
|
||||||
struct b3CpuNarrowPhase* m_np;
|
class b3CpuNarrowPhase* m_np;
|
||||||
|
|
||||||
struct b3CpuRigidBodyPipeline* m_rb;
|
struct b3CpuRigidBodyPipeline* m_rb;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "GpuRigidBodyDemo.h"
|
#include "GpuRigidBodyDemo.h"
|
||||||
#include "Bullet3Common/b3AlignedObjectArray.h"
|
#include "Bullet3Common/b3AlignedObjectArray.h"
|
||||||
#include "Bullet3OpenCL/Raycast/b3RaycastInfo.h"
|
#include "Bullet3Collision/NarrowPhaseCollision/b3RaycastInfo.h"
|
||||||
|
|
||||||
class GpuConvexScene : public GpuRigidBodyDemo
|
class GpuConvexScene : public GpuRigidBodyDemo
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -665,6 +665,9 @@ int GLInstancingRenderer::registerShape(const float* vertices, int numvertices,
|
|||||||
char* dest= (char*)glMapBuffer( GL_ARRAY_BUFFER,GL_WRITE_ONLY);//GL_WRITE_ONLY
|
char* dest= (char*)glMapBuffer( GL_ARRAY_BUFFER,GL_WRITE_ONLY);//GL_WRITE_ONLY
|
||||||
int vertexStrideInBytes = 9*sizeof(float);
|
int vertexStrideInBytes = 9*sizeof(float);
|
||||||
int sz = numvertices*vertexStrideInBytes;
|
int sz = numvertices*vertexStrideInBytes;
|
||||||
|
int totalUsed = vertexStrideInBytes*gfxObj->m_vertexArrayOffset+sz;
|
||||||
|
b3Assert(totalUsed<this->m_maxShapeCapacityInBytes);
|
||||||
|
|
||||||
memcpy(dest+vertexStrideInBytes*gfxObj->m_vertexArrayOffset,vertices,sz);
|
memcpy(dest+vertexStrideInBytes*gfxObj->m_vertexArrayOffset,vertices,sz);
|
||||||
glUnmapBuffer( GL_ARRAY_BUFFER);
|
glUnmapBuffer( GL_ARRAY_BUFFER);
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ subject to the following restrictions:
|
|||||||
|
|
||||||
|
|
||||||
#include "Bullet3Common/b3AlignedObjectArray.h"
|
#include "Bullet3Common/b3AlignedObjectArray.h"
|
||||||
#include "Bullet3OpenCL/Raycast/b3RaycastInfo.h"
|
#include "Bullet3Collision/NarrowPhaseCollision/b3RaycastInfo.h"
|
||||||
|
|
||||||
class b3CpuRigidBodyPipeline
|
class b3CpuRigidBodyPipeline
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include "Bullet3OpenCL/Initialize/b3OpenCLInclude.h"
|
#include "Bullet3OpenCL/Initialize/b3OpenCLInclude.h"
|
||||||
|
|
||||||
#include "Bullet3Common/b3AlignedObjectArray.h"
|
#include "Bullet3Common/b3AlignedObjectArray.h"
|
||||||
#include "b3RaycastInfo.h"
|
#include "Bullet3Collision/NarrowPhaseCollision/b3RaycastInfo.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ subject to the following restrictions:
|
|||||||
#include "Bullet3Collision/NarrowPhaseCollision/b3Config.h"
|
#include "Bullet3Collision/NarrowPhaseCollision/b3Config.h"
|
||||||
|
|
||||||
#include "Bullet3Common/b3AlignedObjectArray.h"
|
#include "Bullet3Common/b3AlignedObjectArray.h"
|
||||||
#include "Bullet3OpenCL/Raycast/b3RaycastInfo.h"
|
#include "Bullet3Collision/NarrowPhaseCollision/b3RaycastInfo.h"
|
||||||
|
|
||||||
class b3GpuRigidBodyPipeline
|
class b3GpuRigidBodyPipeline
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user