Preliminary hack for btRaycastVehicle for bullet 2.75

jackun

16-12-2009 15:45:42

I don't know if a patch is already in the works, but svn didn't have it yet. I have been trying out python-ogre for a while (like 1.5 weeks trying it to get compiled properly and few days doing some demos) and after colliding some boxes i wanted to make a car, but btRaycastVehicle was excluded, so this needs some testing.

Ok, now to the point. I added constructor to btWheelInfo struct like this:
File bullet-2.75/src/BulletDynamics/Vehicle/btWheelInfo.h

void* m_clientInfo;//can be used to store pointer to sync transforms...
+ btWheelInfo(){}
btWheelInfo(btWheelInfoConstructionInfo& ci)


You also have to put ::btRaycastVehicle::setRaycastWheelInfo to the exclude list in python-ogre/code_generators/bullet/generate_code.py because it is only in header.
Maybe i should have done some testing before posting here :P
No patch yet though.
(I'm probably slow to respond to this forum, sry :P )

dermont

17-12-2009 05:22:42

Maybe try something like this (untested), if it works OK I'll submit to the tracker:

Index: generate_code.py
===================================================================
--- generate_code.py (revision 1054)
+++ generate_code.py (working copy)
@@ -103,11 +103,7 @@
,'::btSimpleBroadphase::createProxy'
,'::btDispatcher::getInternalManifoldPointer'

- ## TOFIX Wheels seem broken ?? ## had to remove raycastcehicle all together
- ,'::btRaycastVehicle::addWheel'
- ,'::btRaycastVehicle::getWheelInfo'
- ,'::btRaycastVehicle::updateWheelTransformsWS'
- ,'::btRaycastVehicle::rayCast'
+ ,'::btRaycastVehicle::setRaycastWheelInfo' ## only implemented in header, causes undefined symbol import

## stuff in headers but not in library
,'::btCollisionAlgorithm::getDispatcherId'
@@ -157,7 +153,6 @@
,'::btAlignedObjectArray< void* >'
,'::btAlignedObjectArray< btMultiSapBroadphase::btBridgeProxy* >'
,'::btAlignedObjectArray< btMultiSapBroadphase::btMultiSapProxy* >'
- ,'::btRaycastVehicle'
,'::btAlignedAllocator< btRaycastVehicle*, 16u >'
,'::btThreadSupportInterface'
,'::btAlignedAllocator< btRigidBody*, 16u >'
@@ -178,7 +173,7 @@
# c.exclude()

excludes = ['::btPolyhedralConvexShape::m_optionalHull' ## needs Hull from Extras
- ,'::btRaycastVehicle::m_wheelInfo' ## TOFIX -- might be a bullet issue with wheels
+ #,'::btRaycastVehicle::m_wheelInfo' ## TOFIX -- might be a bullet issue with wheels
]
for e in excludes:
try:
@@ -203,7 +198,7 @@
o.exclude()
global_ns.class_('btQuaternion').operators("operator-", arg_types=[]).exclude()

- noncopy = ['btDbvtBroadphase']
+ noncopy = ['btDbvtBroadphase','btRaycastVehicle']
for c in noncopy:
main_ns.class_(c).noncopyable = True

jackun

17-12-2009 06:57:23

So far my hack seems to work, but i didn't see that 'noncopy' exclude list though at first. I'll try your patch too.

Also needs to be patched:
--- bullet-2.75/src/BulletDynamics/Vehicle/btWheelInfo.h 2009-02-19 00:52:03.000000000 +0200
+++ bullet-2.75/src/BulletDynamics/Vehicle/btWheelInfo.h 2009-12-17 09:00:50.000000000 +0200
@@ -77,6 +77,7 @@

void* m_clientInfo;//can be used to store pointer to sync transforms...

+ btWheelInfo(){}
btWheelInfo(btWheelInfoConstructionInfo& ci)

{

Should build with svn version of python-ogre wrapper code generator.

andy

17-12-2009 07:23:37

Not sure why you need to add the default constructor to the bullet header -- should be fine without it OR the noncopyable setting should solve any issues you have with the code generation...

If you could try it with the noncopyable (and without the bullet patch) and let me know how it goes -- also I'd really appreciate any test code you happen to have that I could add to the SVN

Many Thanks
Andy

jackun

17-12-2009 07:42:44

Ah, ok. Currently compiling without the bullet patch and with noncopy and so far so good.
I'll try to do a 'simple' demo with numeric output only, but i'm still learning :P

Edit: Yep, seems to work for me.