- Home /
Penetration based on shape
Pointy objects tend to penetrate deeper into stuff, than rounded, or flat objects. In the real world, this is because a pointy object applies more force per unit of area (because the point is a tiny area).
I’m looking for idea’s on how can I implement something like this using the Unity physics engine as a base. My intent is to override the OnCollision functions, AND add a “hardness” variable to RigidBody objects. In this function I will determine if objects should bounce, or penetrate one RigidBody(the harder one) into the other RigidBody (the softer one).
Computing the “depth” of the penetration is where I’m running into mental roadblocks, especially considering how important the relative orientations of the objects are (e.g. while the pointy part of cone might impale a sphere given sufficient force, the flat side of a cone would not, given the same force). Idea’s so far: Perhaps computing the "overlap" volume during OnCollision? The lower the volume, the sharper the point? Problem: wouldn’t this volume change depending on how fast the objects collide? Not sure how to compute such an “overlap” volume either.
Your answer
Follow this Question
Related Questions
Shaking physics body container while preventing penetration 1 Answer
More accurate collision detection 1 Answer
Compound collider object behaving as a whole? 1 Answer
Keep Horizontal Momentum after Jump 2 Answers
How to stop sphere from clipping through cube edges aside from lowering Time.FixedDeltaTime? 1 Answer