Closed elmfrain closed 2 years ago
Hello, I saw that you create Minecraft Mods.
Are you planning to use this on a Minecraft project ?
Haha yeah! I would like to create an offroading kart that simulates the suspension of a real vehicle. It's a dream of mine since I started to learn to code.
Ah great ! Good luck !
Do you have en email or a discord so we can chat ?
Yeah my email is elmfer10@gmail.com.
@elmfrain: I appreciate your contribution and will study it soon.
In the future, contact me before writing code you plan to contribute. I'd hate to accidentally duplicate your efforts!
Sure thing! I'll let you know next time I plan to contribute another feature.
@elmfrain: I'd like to request a couple changes, please:
What do you think?
@stephengold: I did some tests on what bullet will do if you passed in a non-unit vector in setAxis()
. It turns out that a non-unit vector essentially multiplies its magnitude with the gear ratio of the constraint, but nothing crazy happened. This is undesirable, but I think we can agree that the user is responsible to make sure to pass in a unit vector.
Additionally, I do agree about your concern about the arbitrary boundary between unit vectors and non-unit vectors because the margin for error is small; a small rounding error can unnecessarily crash an entire application.
@elmfrain Thanks for your contribution to the project!
Gear Joint Constraint
Implemented Bullet's
btGearConstraint
in Java with theGearJoint
class.Why I Added This
I am using this library to simulate a vehicle for a future project, and I am modifying it so it can be suited for that. The gear constraint is crucial to simulate the gearbox, axles, and differential. Also, since this feature is mentioned on the "Whats Missing" section, I took it as an opportunity to contribute.
Demo
In my application, there is a block (called 'testGear') on top of the vehicle that is hinged to the chassis and gear constrained to the front right wheel.
And here is the result:
https://www.youtube.com/watch?v=rAgXH9XIMvE