• Content Count

  • Joined

  • Last visited

  1. Hi Wingnut, First off, thanks so much for diving into the code and coming up with such an in-depth response! The original tutorial (Raanan's actually) had a playground for both Cannon and Oimo. I started using the Cannon one, for no particular reason. If you don't mind, could you elaborate on why ParticleImpostors aren't used very often? In that vein, I fixed the off-by-one error (whoops), and converted the cloth to use SphereImpostors with Cannon like you did and it behaves much better! RE: rotating the "cloth ground" and my translatePositions function, it's strange that rotating the cloth moved the ground itself but not its vertices. The vertices remain unchanged after a rotation: console.log(ground.getVerticesData(BABYLON.VertexBuffer.PositionKind)); // same result ground.rotate(BABYLON.Axis.X, Math.PI / 2); console.log(ground.getVerticesData(BABYLON.VertexBuffer.PositionKind)); // same result and I end up with a weird shadow cloth disembodied from the SphereImpostors. Using your playgrounds as examples, it's more like this than that. translatePositions ended up doing the trick, but there is some strange behavior here that I don't quite get. Last point: I think you were on the money with there being something funky about Cannon.js's ParticleImpostors, at least when they interact with certain other impostors (like the box). Here's a playground with the translatePositions method and a static sphere, that works fine. Here are some other playgrounds without using translatePositions, where the cloth behaves strangely when interacting with a BoxImpostor. (the second one is a pretty sweet magic carpet). I'd love to help hunt down further issues as best I can, but I'm not sure how useful I'll be at breaking down the inner workings of Cannon. Thanks again!
  2. Hi All, Disclaimer: I'm very new to Babylon. I was playing around with this cloth tutorial, and I wanted to make the cloth land on some sort of ground object. So far, I haven't been able to find one that works. You can see in this playground how the cloth reacts to a box impostor, side-by-side with a sphere behaving normally. I have the restitution of everything set to 0. The sphere stops nicely but the cloth shoots off into the distance. I've also tried this with a ground impostor (sphere works fine, cloth doesn't interact with the ground), and a plane impostor (cloth collides correctly, but sphere shoots up into the stratosphere). I have also tried adjusting the initial linear velocity of the cloth particles. More velocity = flies away faster, less velocity = falls right through the ground. My ultimate goal involves the cloth having an initial z velocity, so I'd like to be able to make that work. Can someone help me figure out what I'm missing here? Does it have something to do with the distance joints connecting the particles in the cloth? Should I try using sphere impostors instead of particles? Thanks! (side note: is there a better way to translate the cloth's position than the translatePositions function I made? The built-in ground.rotation.axis method rotates the cloth, but not the actual particles themselves)