Comments (4)
Currently there is no support for rigid bodies with motion type LinearCast vs sensors (they will be treated as Discrete vs sensors):
JoltPhysics/Jolt/Physics/PhysicsSystem.cpp
Lines 1837 to 1839 in ebccdcb
from joltphysics.
I see. Maybe that would we worth noting in the documentation?
Thank you for your quick response.
from joltphysics.
so the right approach would be to use ContactListener::OnContactValidate and do rejects there?
sensors seems to be misleading in a way (from intuition point of view)
but the docs do mention what:
To create a sensor, either set BodyCreationSettings::mIsSensor to true when constructing a body or set it after construction through Body::SetIsSensor. A sensor can only use the discrete motion quality type at this moment.
overall looks like what for games you need a lightweight/fast event system in ContactListener so it does checks only for bodies with associated events/callbacks.
from joltphysics.
so the right approach would be to use ContactListener::OnContactValidate and do rejects there?
You could use OnContactValidate to implement a sensor, but getting this call doesn't mean that this is the closest collision. Hits are roughly sorted based on closeness, so for an object with motion type LinearCast it may be that you later receive another call to OnContactValidate with a closer collision which will result in the actual contact point.
ContactListener::OnContactAdded indicates that there is an actual contact and you can specify that that contact should be treated as a sensor by setting ContactSettings::mIsSensor. This disables the contact, but since we only store the closest contact point during the LinearCast sweep, this also means that the body could penetrate the object behind the sensor.
from joltphysics.
Related Issues (20)
- HingeConstraint does not behave as expected HOT 2
- -mfpmath=sse is not added in 32bits build HOT 10
- Kinematic `BoxShape` sensor versus `MeshShape` fails to report contacts HOT 5
- Sample CharacterTest.cpp HOT 1
- NonCopyable is missing move operations HOT 3
- Crash on Mutex::lock() - 0x00007ffbd9232ff0 MSVCP140.dll!UnknownFunction HOT 2
- Spheres collide with internal edges despite mitigations HOT 6
- Compilation fails with g++ on Ubuntu 22.04 HOT 5
- Missing documentation on how to destroy a physics object. HOT 2
- `-mfpmath=sse` is not supported by Emscripten HOT 5
- Request for official vcpkg support HOT 8
- Serialized arrays are not compatible between 32 and 64 bit systems HOT 1
- VS2022_CL build fails with warning C4514 HOT 2
- Linux-on-ARM compile errors HOT 6
- Core.h defines JPH_USE_NEON HOT 3
- Error when generating build files for Ninja and clang-cl HOT 6
- Request for Anisotropic Friction HOT 1
- Compiles but doesn't run in Arch linux HOT 2
- [Feature request] Implement gravity override for all bodies and not just vehicle constraints
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 joltphysics.