8000 RFC: Vehicle support · Issue #221 · aerys/minko · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

RFC: Vehicle support #221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Ithamar opened this issue Sep 20, 2015 · 1 comment
Open

RFC: Vehicle support #221

Ithamar opened this issue Sep 20, 2015 · 1 comment
Labels

Comments

@Ithamar
Copy link
Contributor
Ithamar commented Sep 20, 2015

The one feature I'm missing in Minko that makes it less attractive for my current projects is vehicle support. Since we already have a physics plugin using Bullet, exposing the Bullet vehicle support should not be too much work.

I'm experimenting with an implementation at the moment, but not sure how to fit it into the current bullet plugin. My current setup is like this:

Vehicle class, which is a subclass of the bullet::Collider class (since a Vehicle chassis is basically a "normal" Bullet RigidBody with some very special constraints).

The Vehicle class has methods to connect the wheels (VehicleWheel class, another bullet::Collider subclass), allowing to specify the per-wheel tuning parameters.

Once this is done, the Vehicle class can be used to setSteeringValue() and/or applyEngineForce() and such.

The above is almost working ( 😄 ) but before I start cleaning up and posting a pull request, is this an acceptable design, does anyone see problems with this, and especially, @promethe42 , do think this design could work with the Blender plugin in future integrations?

@JMLX42 JMLX42 added the feature label Sep 21, 2015
@JMLX42
Copy link
Member
JMLX42 commented Sep 21, 2015

Vehicle class, which is a subclass of the bullet::Collider class (since a Vehicle chassis is basically a "normal" Bullet RigidBody with some very special constraints).

I think you should avoid inheritance. Maybe your Vehicle class component should create and add a Collider component instead of extending it.

The Vehicle class has methods to connect the wheels (VehicleWheel class, another bullet::Collider subclass), allowing to specify the per-wheel tuning parameters.

Because of this implementation of the comment above, you'll end up with a design issue I've yet to come around: dependency injection. This setup works as long as you're not trying to clone the subtree to instanciate multiple vehicles. We have an existing - but very unsatisfying - way to handle this scenario and you'll have to use it.

But I'm totally open to suggestions regarding how to "reconnect" components/nodes after a clone. This might be interesting: http://blog.leapmotion.com/hello-world-meet-autowiring-c/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
0