Why 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.
I 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).
Yeah, 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) so it is mostly a matter of adapting/rewriting them to fit in Rapier.)
I'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.
A 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?
Author 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.
I'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.
The 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.
> 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?
The 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.)
Yes, 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.
On 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.
I 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.
No 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.
I 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.
It’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.
The 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?
> I think 'rapier' is not a good name, for (I hope) obvious reasons.
Fine I'll bite, why's it not a good name? I immediately thought of the type of sword and the thrusting action it implies - which feels apt in the context of physics engines... no?
Every word sounds like some other words. Most adults make peace with this situation. But this reminds me of the crisis that ocurred a few years ago in the Washington, DC city government when a councilmember used the word “niggardly” in a meeting and other semi-literate councilmembers had strokes and heart attacks. This actually became an issue that was talked about for months.
I'm a native English speaker and I didn't get what their problem with it was either. I've never heard anyone voice such an objection to using the word outside of this thread. Bizarre reasoning imo.
The problem with this kind of slippery-slope way into self-censorhip, is that similarities are (n) an almost infinite possibility in most languages. more so having in mind you're going from french to english.
Same way of thinking got GitHub to try and replace master, for something else like mercurial's main.
Having master in the context nothing to do with slavery.
I get someone might be sensible to some words, but I don't see why someone else should keep a list of possible -not good- works declared and updated by the mob mafia of twitter and social media.
Come on man. Are you really going to call your product Poup and say "b-but it's french for Doll". It's not a political thing it's just the way the word rings in current English is bad. Jokes have been being made about "rapier wit" etc. for 50 years.
No offense intended to you at all, but "the way the word rings in current English" seems super subjective. Personally, the notion of "rape" never even occurred to me when I heard this name.
Incidentally, unlike "rapier", words like "raptor" and "rapture" are directly related to the word "rape". These words can be clearly traced back to ancient Greek (meaning something like 'to seize violently'), and perhaps beyond.
Well he might know it better as canola oil, which is the "rebranding" it received for precisely the same reason. So I'm not certain that's the intended point.
Oh give over that article says nothing about it being named Canola because of the word rapeseed containing the word rape. The earlier assumption about the naming of Canola oil is just incorrect.
None 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.
Consider the argument: "Tastier" doesn't bring to mind any associations with "Tasty" because we don't pronounce "Tastier" as "Tasty". Bad argument, right?
Also, why am I wasting time responding? But it is fascinating the extents to which people seem to almost purposefully misunderstand each other online. I sometimes like to explore the space I guess.
Ok just to clear things up for the repliers, what I should’ve said was that the first part of this word being rape is unfortunate, but not a big deal. It’s fine as a name, but not what I would go with. Like how Uranus is a fine name, but not what I would name it if I was the official namer of planets.
Ignoring that it's usually pronounced Uran-us rather than Ur-anus, really? I spend a lot of time around physicists and astrophysicists and I think you can probably guess how much of an issue this is (or for any adults)
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.
I'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.
On the one hand, I find myself surprised that a sizeable number of people seem to reach that association.
On the other hand, as a native English speaker, I understand the word to be pronounced such that it isn't much of a stretch to put it between "rapey" and "rapiest". While neither of those is, I think, particularly well established as a word in "proper" English, they are understood and used in less formal contexts (if jocularly).
There'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.
It'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.
I think your use of 'jarring' is appropriate. There's nothing that's actually wrong with the word--it's type of sword, we're all fine. On the other hand, that may not be worth the risk, compared to other words in a similar vein: scimitar or falchion or something.
Either way, this is a super cool project. You have to love it when someone puts their mind to it and produces something of this quality as open-source. I'm especially interested to see if this might kickstart some of the Rust efforts around GPGPU, which is currently so-so, since a cross-platform solution there seems like it would definitely be a benefit for this kind of project.
>>>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.... Rapier is - to me - just an inanimate object.
I looked at is as implying lightweight, nimble, and functional efficiency for small-scale uses, much like its namesake. I would assign much different metaphorical implications to something named "Zweihander" (Germanic two-handed sword) or an even more esoteric French polearm name such as "Bec de corbin" (a name probably only known to hoplophiles).
Let me see if I understand. A french author should be careful about using this french word on its project because, if someone in the US mispronounce it, it sounds like something that's reprehensible?
I hope I'm not misrepresenting your argument, but the way I understood it sounds very US-centered.
Better tell the British to rename their Rapier Missile System https://en.wikipedia.org/wiki/Rapier_(missile) beause their love for the French language means using a word that sounds vaguely similar to a bad English word.
Different market. Guys, this is just marketing which empirically works. It's hilarious to listen to a bunch of developers who are probably not that good at marketing opine about how this name is just great.
I mean to be empirical one could focus-test. But a controlled focus-test is probably out of reach for a lone developer on a hobby project.
Rapier is not (only) a French word. Sure it has French origins, but I'm sure you will find it in any English language dictionary too, English is made up of loan words.
(On a side note, Firefox's spellchecker marks uncapitalized "english" as incorrect, but not uncapitalized "french". Weird.)