Skip to content
DevMeme
375 of 7435
Unfortunate Variable Names in Physics Engines
GameDev Post #439, on Jun 5, 2019 in TG

Unfortunate Variable Names in Physics Engines

Description

This image is a screenshot of a comment on a platform that resembles Reddit, showing a post by user 'AraneusAdoro' with 27 points from 3 years prior. The comment introduces a line of code found in a physics engine. The text says 'From a physics engine:', followed by a code block containing a single line: 'double penetration; // ouch'. The humor arises from the double entendre of the variable name 'double penetration'. In the context of a physics engine, this term would refer to a bug where two distinct objects or meshes incorrectly pass through each other, occupying the same space simultaneously. However, the term has a well-known sexual connotation, and the developer's humorous, self-aware comment '// ouch' plays on this secondary meaning, making the code snippet unintentionally hilarious

Comments

7
Anonymous ★ Top Pick There are only two hard problems in computer science: cache invalidation, naming things, and off-by-one errors. This developer clearly solved the second one with flair
  1. Anonymous ★ Top Pick

    There are only two hard problems in computer science: cache invalidation, naming things, and off-by-one errors. This developer clearly solved the second one with flair

  2. Anonymous

    In this physics engine PR, the nastiest collision wasn’t between rigid bodies - it was HR slamming into the diff after spotting `double penetration` in the narrow-phase solver

  3. Anonymous

    The real challenge isn't explaining collision detection algorithms to management - it's explaining why your physics engine's penetration depth calculations keep triggering the corporate content filter

  4. Anonymous

    Ah yes, the classic physics engine dilemma: technically correct variable naming that makes every code review awkward. When your collision detection algorithm is so accurate it calculates penetration depth to double precision, but HR keeps flagging your commits. This is why seasoned game developers learn to use 'overlap_distance' or 'intersection_depth' instead - not because it's more technically precise, but because explaining 'penetration vectors' in standup gets old fast. The real engineering wisdom here isn't in the physics math; it's knowing that sometimes the best code is the code that doesn't make your colleagues uncomfortable during pair programming sessions

  5. Anonymous

    Physics engines: where 'rigid bodies' promise no-clipping, but deliver double penetration from under-iterated solvers - tune BaP or brace for ghosting meshes

  6. Anonymous

    Only in a physics engine can a valid C++ line spark both an IEEE‑754 debate about float vs double and an HR review of your variable naming

  7. Anonymous

    PR comment: s/double penetration/float overlapDepth/ - reduces nondeterminism and HR incidents by 50%

Use J and K for navigation