physics-module-ammonext icon indicating copy to clipboard operation
physics-module-ammonext copied to clipboard

Physics doesn't work for objects in groups

Open mdibaiee opened this issue 6 years ago • 1 comments

Hi,

Applying any kind of PHYSICS.XXXModule to an object inside a group doesn't apply physics to that object.

An example:

This works:

  const mesh = new WHS.Plane({
    geometry: {
      width: 1000,
      height: 1000,
    },
    rotation: new THREE.Euler(-Math.PI / 2,0,0),
    modules: [
      new PHYSICS.PlaneModule({
        mass: 0,
        restitution: 0,
      }),
    ],
    material: new THREE.MeshPhongMaterial({ color: 0xffffff })
  });

ground.addTo(app);

But if I replace the last line by:

const group = new WHS.Group(ground);
group.addTo(app);

The plane will not have any physics.

mdibaiee avatar Dec 28 '18 16:12 mdibaiee

@sasha240100

noahcoetsee avatar Jan 03 '19 13:01 noahcoetsee