• Content Count

  • Joined

  • Last visited

  1. This fixed the issue, thank you! Additionally, to have my sphere player able to still move and not fall asleep along with the boxes, I had to do: sphere.physicsImpostor.physicsBody.allowSleep = false;
  2. I am using CannonJS with BabylonJS, and I want to make a stack of 3 boxes, all the same size, but when I do, they slowly slide around until the stack topples. I have tried setting restitution to 0, and various values for gravity, mass, and friction, and regardless, the stack always topples itself undesirably. I only want them to topple when rammed with some other object. How can I achieve this?
  3. I attached spheres as children to the 5 sided prism, positioned just inside the prism mesh, giving it feet, and it worked, however it was very hard to line up the spheres, because the axis were not the same as in world-space, and it really confused me. I think until MeshImpostor can collide with other shapes than just sphere and plane, I will have to just use more basic shapes, because it takes too long and too much code to attach all sorts of sub-shapes to everything. It's really messy. I don't really understand why a HeightmapImpostor which I have working, can collide with other shapes, but a MeshImpostor can't. It seems like a silly limitation. Thanks for the help Wingnut and Raggar. Hopefully in future versions of BabylonJS, they make the MeshImpostor able to collide with other shapes.
  4. The traditional triangle is what I want, as created with BABYLON.MeshBuilder.CreateCylinder('triangularPrism1', {tessellation: 3}, this.scene), it looks right, however when I attach a CylinderImpostor to it, the prism rolls like a cylinder, which is not what I want.
  5. Hmm, so is there any option then, to have a triangular prism with mass, collide with a BoxImpostor (the ground)? I don't want the prisms to be fixed in place.
  6. MeshImpostors don't collide with each other, and I can't figure out how to flatten the SphereImpostor. I can visually flatten the mesh with mesh.scaling.y = 0.1, but the physics body doesn't get scaled with it. I tried setScalingUpdated(true) and forceUpdate(), but the scaling on the physics body still remains as its original shape.
  7. Thanks Wingnut, MeshImpostor is almost perfect, the sphere collides with the prism in the correct ways, except I didn't want the prism to have mass: 0, but if I give it a mass, it falls through the floor. The floor is a BoxImpostor...
  8. I am new to 3D game dev, and I'm wondering how to make a triangular prism that a sphere could roll down. I think I'm missing something huge, because physics libraries only seem to support the most basic geometries, excluding triangular prisms and other important shapes. Could someone please point me to some resources or explain how to deal with physical interactions between more complicated shapes? I notice that BabylonJS makes it easy to create lots of neat meshes, however, I'm missing how to simulate their shapes on the CannonJS side of things. I want to make a game where the player controls a sphere by rolling it around various scenes, but it just doesn't seem possible using only spheres and boxes, for example.