Skip to content
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

Double-precision support for non-rigid body physics objects #19

Closed
aecsocket opened this issue Nov 15, 2022 · 10 comments
Closed

Double-precision support for non-rigid body physics objects #19

aecsocket opened this issue Nov 15, 2022 · 10 comments
Labels
enhancement New feature or request

Comments

@aecsocket
Copy link

Similar to #9 , I am using Libbulletjme for use in a Minecraft plugin, which requires double-precision in world positions, since coordinates can go up to 30 million on the X/Z axes. I see there has already been work done to get/set double-precision physics positions and rotations on PhysicsRigidBody instances, however I also use PhysicsGhostObjects, which from what I can see don't support the *Dp methods.
Could double-precision get/set support be added for object types apart from RigidBody (specifically GhostObjects and SoftBodys), and if possible a double-precision variant of get/set Transform methods (at least for the position component)? I make extensive use of Transforms rather than pure vectors, and double-precision utils for those would be very useful.

@stephengold
Copy link
Owner

It should be a simple matter. Thanks for the suggestion!

@stephengold stephengold added the enhancement New feature or request label Nov 15, 2022
@stephengold
Copy link
Owner

@aecsocket: the work took a week longer than it should've, but I believe v17.1.0 should meet your needs. Please try it and let me know whether it does or not.

@aecsocket
Copy link
Author

1.7.10 provides a lot of the methods needed, and is almost perfect for my needs. However it's still missing a few methods which would be useful:

  • CollisionSpace.rayTestDp
  • PhysicsGhostObject.setPhysicsRotationDp
  • ManifoldPoints.getPositionWorldOnADp
  • ManifoldPoints.getPositionWorldOnBDp
  • TransformDp.combineWithParent
  • TransformDp.transformInverseVector
  • Quatd.toRotationMatrix

@stephengold
Copy link
Owner

Thanks for the feedback. I'll keep this issue open until those suggestions are addressed.

@aecsocket
Copy link
Author

Doing another pass over my code, one place where double precision would be useful is in joints and constraints. Specifically New6Dof's Vector3f and Matrix3f parameters: if the A end is in world space, the Vector3f may not be precise enough to express the extremes of coordinates. However this is a more niche use-case, since in my code most of the time bodies will be constrained to other bodies.

@stephengold
Copy link
Owner

I'll take a look at New6Dof and add methods that seem appropriate to me.

I'm curious about your Minecraft plugin. What is its name and purpose?

@stephengold
Copy link
Owner

I started implementing a double-precision constructor for a single-ended New6Dof. The impact of that change rippled through the com.jme3.bullet.joints package. It seems a much bigger project than I'm prepared to tackle right now, so I'm going to revert the changes and publish v17.2.0 without them.

@aecsocket
Copy link
Author

Yes it sounds like joints and constraints will need a lot more work to add dp support. It seems more of an edge case though, so it shouldn't be too high priority.

I'm trying to write a server-side physics framework for Minecraft servers (project CraftBullet), and also developing a (pseudo-)entity-component-system on top of that to allow me to make generic entities (project Sokol). I appreciate your work greatly since without it my ideas wouldn't even be possible!
My more long-term aim is to make server-side weapons and vehicles frameworks (projects Calibre, Diesel), for which physics - and a robust ECS - would be essential. On top of those frameworks I could make any project I wanted, one which I have ideas for currently is a first person shooter. I know that you've seen DynamX, which I was also partially inspired by, and although it's an impressive mod, it still requires clients to download it manually, which is why I'm writing server-side plugins. I'd love to show some of it, but right now I don't have anything really "presentable" - maybe in the future!

@stephengold
Copy link
Owner

Thanks for sharing details about CraftBullet. I'm glad to help out.

Currently the 17.2.0 release is being delayed by an authentication issue at the build server. I've opened a ticket ...

@stephengold
Copy link
Owner

stephengold commented Nov 27, 2022

The 17.2.0 release has been published, so I'm closing this issue. If you wish to propose new features, I invite you to open (a) new issue(s) here at GitHub.

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

No branches or pull requests

2 participants