10 ms·
The Rapier Physics Engine
- thecleaner 6y agoVery poor choice of name.
- leephillips 6y agoWhy?
- FascistsAreLame 6y agoSome people with very limited vocabularies and an even more limited world experience are wanting to ban things that rhyme or sound similar to words that they don’t like. It’s anti intellectual nonsense.
- DiabloD3 6y agoDo you not like swords?
- 0xdeadb00f 6y agoThey more than likely mean Rapier, the sword. But honestly, I agree. Why would you _choose_ a name that sounds like this?
- deleted 6y ago[deleted]
- mantap 6y agoThe only people who are upset about naming something after a sword are those who want to be upset. If someone desires to be upset and you make them upset, is that not a service?
- dang 6y agoPlease don't troll HN. We ban accounts for that. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- ccvannorman 6y ago- cross platform bit level determinism - fully serializable state Wow! Sounds like a boon for Javascript game engines like Bevy. I wonder if they'll support PlayCanvas as well.
- Impossible 6y agoBevy is a a Rust game engine https://bevyengine.org/ https://bevyengine.org/, although potentially it could be used with js when targeting WASM.
- lago 6y agorename: Crumble It's made of rust, it's physics-y: crumble. I think 'rapier' is not a good name, for (I hope) obvious reasons.
- cfcosta 6y agoI'm not a native speaker, and searching on urban dictionary I could not find anything. What's the problem with the name?
- finnegandewitt 6y agoBecause it sounds like rape
- deleted 6y ago[deleted]
- jbay808 6y agoSome other words we could stop using for the same reason: Rope, rap, rapper, crepe, paper, wrapper, rapid...
- JabavuAdams 6y agoNone of these are good examples. It's not the spelling. It's the pronunciation to native English speakers. "Rapey". There's no point getting on a high horse about people being adults, etc. Marketing and advertising empirically work, and not because people are stupid. A lot of time and money is spent thinking up good names and trying to avoid names with embarassing connotations. If a bunch of native English speakers are telling you that the name sounds bad to native English speakers, then it's worth at least considering rather than dismissing. EDIT> Reminds me of Rational Rose .petal files.
- chriswitts 6y agoAs a native English speaker I can attest that we sure as shit don't pronounce it "Rapey".
- nomadtwin 6y agoFrench people love their language a lot (to a point where they expect you to speak french when they go on vacation in Spain/Portugal ) Not saying it's a bad thing per se (although I find it a little rude) but that might explain why they don't see the very poorly made choice.
- chrisseaton 6y agoI'm baffled by people put off by the name. Is 'rapier' not a word used in US English? It's a type of sword. It's nothing to do with 'rape' if that's what you're thinking. It's neither spelt nor pronounced anything like 'rape'. I can't see any possible confusion or connection at all but several people are making it in this thread.
- p1necone 6y agoI'm also confused. Perhaps it's more commonly used in EU/Australian/New Zealand English? But even then I don't think so - that type of sword is called that in US made video games too.
- nomadtwin 6y agoThere's more to the world then US. English is the common tech language that almost everyone on HN is capable reading but not always fluent or mothertongue. I don't think "rapier" is a common word for non-native speakers.
- Mirioron 6y agoIf they at all play fantasy games (video or otherwise) or read fantasy or historical novels then they've run across this word.
- nkozyra 6y agoIt's not commonly used. I'd imagine most people know it but for those that don't I could understand the confusion and concern. I know the word and its meaning and my initial reaction was negative because I thought "this has very little metaphorical value for a physics engine." You think of kinesis, movement, reactions. "Box" makes sense because it's a physical constraint with coming and interesting physics effects across its physics. Rapier is - to me - just an inanimate object. But imagine you don't know the word. It could be jarring. And unlike words evoked by a sibling reply (paper, rap, etc) it's not nearly as commonly known or used.
- deleted 6y ago[deleted]
- rikroots 6y agoA few months back I tried - and failed - to write a basic 2d physics engine for my JS canvas library. Before then, I tried to use existing JS physics engines with the library ... but none of them integrated nicely; the closest I got to making something useful was with Matter.js (see Codepen demo[1]). Rapier has a WASM version, and JS bindings. I'm already looking forward to see if I can get the engine working with my code. Is there a JS-focussed community around Rapier where I can ask questions if I get stuck? [1] - https://codepen.io/kaliedarik/pen/zYvbwBy https://codepen.io/kaliedarik/pen/zYvbwBy
- teraku 6y agoThey have a discord, the link is on their github: https://github.com/dimforge/rapier https://github.com/dimforge/rapier
- sebcrozet 6y agoAuthor of Rapier here. The best way to get help would be to join our discord server [1]. There is a channel dedicated to rapier.js. So far most of us are Rust devs but we want to grow our JS community progressively. You can also ask questions/post issues on the rapier.js repository [2]. You will also find a WIP user-guide on the rapier website: [3]. Right now the JS bindings are not complete, so a couple of months of work is still needed to expose all the capabilities of Rapier through JS. [1]: https://discord.gg/vt9DJSW https://discord.gg/vt9DJSW [2]: https://github.com/dimforge/rapier.js https://github.com/dimforge/rapier.js [3]: https://www.rapier.rs/docs/user_guides/javascript/getting_started https://www.rapier.rs/docs/user_guides/javascript/getting_st...
- rikroots 6y agoMany thanks! I've joined the discord and will have a go at setting up a Rapier-driven demo in a canvas element this weekend.
- panzerklein 6y agoI've used Matter.js in a project with custom canvas renderer and it performed great. The only issue that I've had to patch up was tunnelling at high speeds. But this is a common problem with many engines.
- sali0 6y agoThe benchmarks are pretty interesting. Why is it that nphysics has such apparent inconsistency in its frame times?
- sebcrozet 6y agoThe main source of inconsistency for nphysics performances is its broad-phase algorithm. It is a tree-based approach which is admittedly not written very efficiently and has very unstable performances when most objects moves.
- Pfhreak 6y agoInteresting choice of name. It isn't particularly descriptive of a physics engine. (Compare to something like Box2D or PhysX which immediate conjures a mental image of what it does.) At first, I actually got it mixed up with the SABRE engine. Swords are so widely used they sorta lose meaning as names. The same with Greek or Roman gods. (How many projects are named Apollo, Artemis, etc.) I understand the other commenters who feel it's an awkward choice from a rapey-er (ie, more "rapey" which is a word I've heard English speakers use to describe dudes that were creepy). I don't think it's going to be the first thing people think of, but I think that they could pick a name that doesn't have that possible interpretation. Edit: Also, there's a whole world of swords out there, and Rapier is used in so many contexts already. Why this weapon, specifically? It's just not memorable.
- JabavuAdams 6y agoWell, at least it's not the rapey-est physics engine. Although, after some more performance tuning ...
- tmahle 6y agoBookmarking this comment section in case I ever need a prime example of bikeshedding.
- vosper 6y agoIt’s really out of hand. HN seemingly can’t help itself bikeshedding the naming of things, but you’d hope people would check to see all the other similar comments before posting their own not-so-unique take as a top-level comment... Easy, albeit predictable, fodder for n-gate, if they can be bothered.
- kjeetgill 6y agoYou spoke to soon, it's all buried now. The system works?
- kazinator 6y agoRegarding inane comments about the name, take a look at this: https://en.wikipedia.org/wiki/Windows_Mobile#Pocket_PC_2000 https://en.wikipedia.org/wiki/Windows_Mobile#Pocket_PC_2000 Pocket PC 2000, originally codenamed "Rapier", was released on April 19, 2000, and was based on the Windows CE 3.0 kernel.
- nightowl_games 6y agoCross Platform determinism and great serialization capabilities makes this a networked physics programmer's dream! I kinda wish this was in cpp, so that I could integrate it with Godot and have it be considered for upstreaming. Edit: Wait, no ray cast? I'm confused why that wouldn't be implemented. That's a very simple operation, is it not? No continuous collision detection is not so great either, but is okay if the performance is good enough to tick at a high rate.
- Zolomon 6y agoThere is another Rust crate[0] from the same author that does ray casting. Also, nothing prevents this from being used in Godot[1]. [0]: https://github.com/dimforge/ncollide https://github.com/dimforge/ncollide [1]: https://github.com/godot-rust/godot-rust https://github.com/godot-rust/godot-rust
- gridspy 6y agoI'm making a game in Godot and Rust, so I appreciate this physics engine. You can make Godot modules in Rust, so it could be an add-in (even in the Godot Asset library?) using a Godot Module. The Rust library to bind to Godot can be found here: https://github.com/godot-rust/godot-rust https://github.com/godot-rust/godot-rust
- sebcrozet 6y agoYeah, ray-casting and CCD are missing currently, mostly because I didn't have the time to implement them yet (though I did implement them on ncollide/nphysics (https://nphysics.org https://nphysics.org) so it is mostly a matter of adapting/rewriting them to fit in Rapier.)
- moonchild 6y agoThey mention wasm bindings. Are there c bindings as well?
- sebcrozet 6y agoNo C bindings so far. This is something I would like to consider doing at some point. Though when exactly it is done will depends on the demand since I have limited resources.
- skohan 6y agoI would try this out tomorrow if it had a C FFI. I've been working more with Rust, but I have a lot of existing work in other languages, and a C FFI would make it so much easier to consider this as an alternative.
- skohan 6y agoOn a side note, does anyone know what happened to Bullet3D? It seemed like this was a really good candidate for driving game physics a few years ago, but it's been rebranded as "PyBullet", the wiki's no longer available, and it seems to have pivoted towards simulation. Also it seems like Bullet3 never got a proper release. Is this a dead project?
- maeln 6y agoIt is still going strong and being actively developed : https://github.com/bulletphysics/bullet3 https://github.com/bulletphysics/bullet3 & https://pybullet.org/wordpress/ https://pybullet.org/wordpress/
- ur-whale 6y agoI think one of its main author was hired by Google AI when they (Google) realized that getting a big fat neural network to model the inverse problem of a physics engine (should call it a mechanics engine, really) had lots of very practical applications. In other news, bullet is alive and kicking. e.g. It's integration into blender lets you do amazing thing, especially wrt modeling natural environments fast.
- eikeegi 6y agoThis thread reminds me the WKUK "Grapist" sketch
- ramger252 6y agoWhy do the readmes for physics engines rarely specify how they solve contact constraints? This is one of the most difficult parts of writing a physics engine. It might be less important if you're just interested in visuals and making it "look OK" in a videogame, but it has an impact on the dynamics, so especially if you're interested in robotics or accurate simulation of real-world physics, this is really important to specify.
- lmilcin 6y agoI would add that the way the contact constraints are solved decides what kind of artifacts you will be getting and you need to understand that to be able to understand precision of your simulation. Even for a videogame this would be important. You may want to know if it is possible for fast moving objects to pass each other or not. You might then want to limit the velocity of objects (a cheap trick to solve the issue, but very effective), or you might want to choose an engine specifically for this (for example if you make a billiards game or a shooter).
- ur-whale 6y agoDo these type of physics engine use Newtonian F=MA at their hearts or do they rely on Lagrangian mechanics? My instinct tells me the first as it seems more straightforward, but then I realized I just have no idea. Anyone knowledgeable care to enlighten?
- lasagnaphil 6y agoThe former, because in order to formulate a physics engine in Lagrangian mechanics you need analytic differentiation (or you can just precalculate the partial derivatives with your own hands, but then it will be precisely the same as coding it in F=ma.)
- sebcrozet 6y agoYes, it uses a Newtonian formulation. Another physics engine (nphysics) I wrote before rapier, had a Lagrangian formulation of joints (using reduced-coordinates). This is something I intend to add to Rapier too at some points.
- mpartel 6y ago> Cross-platform determinism: if the enhanced-determinism feature of Rapier is enabled, it will behave in a bit-level cross-platform deterministic way in all platforms that comply with the IEEE 754-2008 floating point standard. Impressive! I've understood this to be a hard problem. Unity has promised this for years but still hasn't delivered, last time I looked. Is there anywhere we could read more about the tradeoffs and challenges involved? Also, how widely has this been tested? Perhaps most importantly: how can I extend this determinism to my own code?