I'm new to bullet - so far I like what I see :p.
My question concerns how to proceed. I have a choice here of replacing things like bounding boxes, spheres and so on with actual bullet classes, or making some kind of adaptor. Should I rework my code to fully integrate bullet, or is the adapter route the best way to go to prevent too tight a coupling between bullet and my software?
How do you experts manage things? I suppose for efficiency it's better to use actual bullet classes.
How do you integrate with your existing code?
-
- Posts: 2
- Joined: Sun Aug 21, 2011 12:12 am
-
- Posts: 237
- Joined: Tue Jun 29, 2010 10:27 pm
Re: How do you integrate with your existing code?
Well I'm sure people have different ways of doing it, but in my work, we have wrapper classes for various collision objects, which hold the bullet class plus various stuff specific to our applications.
MyPhysicsBox
MyPhysicsSphere
etc.
Also our main dev't language is objective-c, so wrappers make things a bit easier in that sense too.
MyPhysicsBox
MyPhysicsSphere
etc.
Also our main dev't language is objective-c, so wrappers make things a bit easier in that sense too.
-
- Posts: 2
- Joined: Sun Aug 21, 2011 12:12 am
Re: How do you integrate with your existing code?
Thanks for you reply. I suppose that's the route to take, yes.
-
- Posts: 25
- Joined: Thu Aug 11, 2011 6:42 pm
Re: How do you integrate with your existing code?
I kinda take a Component approach and load all of my game object data from files, instead of having a billion subclasses. The files specify model components and shape components, and then at runtime the program sticks everything together, including putting all of the shapes in a compound collision shape if there's more than one of them.
Then I just use a subclass of MotionState to keep the two synced.
Yeah my graphics and physics are pretty tightly linked together so if you're looking for a more abstracted route then my way probably isn't the best to take
Then I just use a subclass of MotionState to keep the two synced.
Yeah my graphics and physics are pretty tightly linked together so if you're looking for a more abstracted route then my way probably isn't the best to take