Hi, I want to use a MFC program to show the CollisionInterfaceDemo. I call the bullet Physics in the menu code. The code is:
void CMainFrame::OnCollisionDetection()
{
// TODO: Add your command handler code here
int screenWidth = 640;
int screenHeight = 480;
BulletCollisionDetection* pCollisionDetection = new BulletCollisionDetection;
pCollisionDetection->initPhysics();
pCollisionDetection->clientResetScene();
glutmain(__argc, __argv,screenWidth,screenHeight,"Collision Interface Demo",pCollisionDetection);
}
I compile the code, the VS2010 compiler says that:
error C2661: 'GlutDemoApplication::operator new' : no overloaded function takes 3 arguments
Can anybody help me? Thanks.
Getting errors using bullet demo in MFC
-
- Posts: 463
- Joined: Fri Nov 30, 2012 4:50 am
Re: Getting errors using bullet demo in MFC
1) You should check the demos, you would have seen that your line wasn't needed and instead you need something like:ptLeng wrote: BulletCollisionDetection* pCollisionDetection = new BulletCollisionDetection;
Code: Select all
m_collisionConfiguration = new btDefaultCollisionConfiguration();
m_dispatcher = new btCollisionDispatcher(m_collisionConfiguration);
-
- Posts: 4
- Joined: Sat May 17, 2014 4:12 am
Re: Getting errors using bullet demo in MFC
Thanks Basroil.
I use another way to show the bullet demo and it works.
That is:
code:
BulletCollisionDetection m_CollisionDetection;
m_CollisionDetection.initPhysics();
m_CollisionDetection.clientResetScene();
glutmain(__argc, __argv,screenWidth,screenHeight,"Collision Interface Demo",&m_CollisionDetection);
Now I test the way you told me.
-ptLeng
I use another way to show the bullet demo and it works.
That is:
code:
BulletCollisionDetection m_CollisionDetection;
m_CollisionDetection.initPhysics();
m_CollisionDetection.clientResetScene();
glutmain(__argc, __argv,screenWidth,screenHeight,"Collision Interface Demo",&m_CollisionDetection);
Now I test the way you told me.
-ptLeng
-
- Posts: 463
- Joined: Fri Nov 30, 2012 4:50 am
Re: Getting errors using bullet demo in MFC
ptLeng wrote:Thanks Basroil.
I use another way to show the bullet demo and it works.
That is:
code:
BulletCollisionDetection m_CollisionDetection;
m_CollisionDetection.initPhysics();
m_CollisionDetection.clientResetScene();
glutmain(__argc, __argv,screenWidth,screenHeight,"Collision Interface Demo",&m_CollisionDetection);
Now I test the way you told me.
-ptLeng
Looks like I mistook that demo class for the actual collision detection class. You can strike the other post since it's not going to work
-
- Posts: 1
- Joined: Thu Sep 18, 2014 2:55 am
Re: Getting errors using bullet demo in MFC
I also learning how to use bullet demo in MFC , but i can't find the related resources on the Internet , can you share your source to me ~thanks!!