Aloush154 / bullet

Automatically exported from code.google.com/p/bullet
Other
0 stars 0 forks source link

btDbvtBroadphase not copy-constructable or constructor-initializable #789

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
With bullet-2.82-r2704, using g++ 4.6.3 (no compiler option flags), the 
following code:

- - - - -

#include "BULLET/src/btBulletCollisionCommon.h"

class example
{
  public:

  btDbvtBroadphase collision_broadphase;
  btDefaultCollisionConfiguration collision_configuration;
  btCollisionDispatcher collision_dispatcher;
  btCollisionWorld collision_world;

  example()
  : collision_broadphase(btDbvtBroadphase()),
    collision_configuration(btDefaultCollisionConfiguration()),
    collision_dispatcher(btCollisionDispatcher(&collision_configuration)),
    collision_world(btCollisionWorld(
      &collision_dispatcher, &collision_broadphase, &collision_configuration))
  {}
};

int main(int argc, char **argv)
{
  example();
  return 0;
}

- - - - -

Gives the compilation error:

- - - - -

In file included from 
BULLET/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h:27:0,
                 from BULLET/src/btBulletCollisionCommon.h:54,
                 from Articulator.hpp:4,
                 from main.cpp:8:
./BULLET/src/BulletCollision/BroadphaseCollision/btDbvt.h: In copy constructor 
‘btDbvtBroadphase::btDbvtBroadphase(const btDbvtBroadphase&)’:
./BULLET/src/BulletCollision/BroadphaseCollision/btDbvt.h:389:2: error: 
‘btDbvt::btDbvt(const btDbvt&)’ is private
BULLET/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.h:62:8: error: 
within this context
In file included from main.cpp:8:0:
Articulator.hpp: In constructor ‘Articulator::Articulator()’:
Articulator.hpp:146:79: note: synthesized method 
‘btDbvtBroadphase::btDbvtBroadphase(const btDbvtBroadphase&)’ first 
required here 

- - - - -

Copy constructing btDbvtBroadphase should be enabled to allow initialization of 
btDbvtBroadphase in a constructor initialization list. Making btDbvt's copy 
constructor public fixes the problem.

Original issue reported on code.google.com by Gelatino...@gmail.com on 31 Jan 2014 at 6:56

GoogleCodeExporter commented 8 years ago
moved to https://github.com/bulletphysics/bullet3/issues/62

Original comment by erwin.coumans on 30 Mar 2014 at 5:06