Google

Preliminary hack for btRaycastVehicle for bullet 2.75

A discussion on Python-Ogre, the library which allows you to drive OGRE directly from Python

Moderators: OGRE Team, Python-Ogre Moderators

Preliminary hack for btRaycastVehicle for bullet 2.75

Postby jackun » Wed Dec 16, 2009 4:45 pm

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
Code: Select all
    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 )
jackun
Gnoblar
 
Posts: 4
Kudos: 0
Joined: 16 Dec 2009

Re: Preliminary hack for btRaycastVehicle for bullet 2.75

Postby dermont » Thu Dec 17, 2009 6:22 am

Maybe try something like this (untested), if it works OK I'll submit to the tracker:
Code: Select all
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
dermont
Bugbear
 
Posts: 895
Kudos: 37
Joined: 27 Sep 2005

Re: Preliminary hack for btRaycastVehicle for bullet 2.75

Postby jackun » Thu Dec 17, 2009 7:57 am

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:
Code: Select all
--- 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.
jackun
Gnoblar
 
Posts: 4
Kudos: 0
Joined: 16 Dec 2009

Re: Preliminary hack for btRaycastVehicle for bullet 2.75

Postby andy » Thu Dec 17, 2009 8:23 am

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
Python-Ogre: High Performance Graphics and Gaming Libraries for Python
andy
Bugbear
 
Posts: 872
Kudos: 0
Joined: 10 Jul 2006
Location: Often Singapore..

Re: Preliminary hack for btRaycastVehicle for bullet 2.75

Postby jackun » Thu Dec 17, 2009 8:42 am

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.
jackun
Gnoblar
 
Posts: 4
Kudos: 0
Joined: 16 Dec 2009


Return to Python-Ogre

Who is online

Users browsing this forum: No registered users and 2 guests