Comments (6)
Ok, that makes sense. I would be happy to try my hand at a V-HACD implementation. I'll try to keep an eye on the changelog, but if you can ping this thread once support for 3D convex polyhedron lands on master, then I will get started then.
from rapier.
Hi! Sorry for the late answer.
Yes, the main missing component is the MassProperties
computation. Implementing this will allow meshes to be dynamic.
However, it should be kept in mind that most game physics engines don't allow dynamic triangle-meshes because they can quickly suffer from some collision-detection problems causing the to be stuck (mostly because triangles-meshes are generally considered to not have any interior).
I don't have any references to give you on this. What we need here is to be able to compute the triangle mesh's volume and angular inertia tensor.
Once you have these:
- The TriMesh mass is equal to the volume multiplied by the collider's density.
- The TriMesh principal inertia is obtained by the Eigendecomposition of the angular inertia tensor like this.
from rapier.
No worries, thanks for the details @sebcrozet. My ultimate goal is to turn an arbitrary glTF into a dynamic collider, and I figured implementing a collider for trimesh was the correct path. Can you explain a little more on how game engines don't allow dynamic triangle-meshes? How do they simulate collisions on arbitrary 3D models (eg Source engine)? Is there some way of translating models into a group of non-triangular primitive shapes that you link together?
from rapier.
For arbitrary non-deformable 3D models, game physics engines generally require the model to be represented as a set of convex polyhedrons. So the solution is generally to compute a (often approximate) convex decomposition of the mesh with an algorithm like V-HACD, and use these convex parts as the collider shapes. ncollide has an implementation of HACD (which is a bit older than V-HACD) but it is not extremely robust.
Now even if we had a working V-HACD implementation, you could not achieve your goal with the current version of Rapier because it does not support arbitrary 3D convex polyhedron yet. Though my current works on capsule shapes will make it much easier to support 3D convex polyhedron too.
So I guess two things are possibles (and both are things we would like to support at some point):
- Find a way to compute the mass properties of triangle meshes.
- Implement an algorithm like V-HACD, and wait for Rapier to support arbitrary 3D convex polyhedron shapes (should land in one or two months).
from rapier.
This is can be closed now that there is V-HACD in parry2d and rapier right?
from rapier.
Computing mass-properties of a 3D triangle mesh has been added to Rapier 0.12 (non-alpha version).
from rapier.
Related Issues (20)
- Benchmarks webpage is not working HOT 1
- Need predict_position_using_velocity() without forces
- panic_bounds_check when solving spring joint HOT 2
- How do you simulate refraction? HOT 5
- Objects retain all velocity while moving through a Sensor HOT 4
- `KinematicCharacterController` climbing and sliding along along vertical walls are broken
- `KinematicCharacterController` doesn't respect `offest` HOT 1
- `dyn PhysicsHooks` cannot be shared between threads safely --> WASM compile fails HOT 1
- Perfectly Elastic Ball Loses Velocity After Bounces in Zero Gravity Environment HOT 2
- 2D Rigidbody type changing from Kinematic->Dynamic at runtime doesn't work HOT 2
- Bug: Incrementally-updated `QueryPipeline` memory usage linearly grows over time.
- How do I properly enable parallel in rapier3d? HOT 2
- Feature: Add support for custom friction and bounce CombineRules HOT 2
- Very large 2d cuboid "ground" destabilizes simulation
- Perfectly elastic objects gain energy with TGS soft in Newton's cradle example HOT 1
- parry2d v0.15.0 yanked HOT 5
- rapier3d doesn't compile with simd-nightly HOT 6
- Cuboid Collider Gets Stuck After Contact with Polyline Collider HOT 2
- MultibodyJoint behaves incorrectly - does not react to angular momentum changes
- Feature: Rotation visualization for Ball 2d collider in debug mode HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rapier.