WhitestormJS / physics-module-ammonext

Physics module for Whitestorm.js [Beta]

Home Page:https://whsjs.readme.io/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Physics doesn't work for objects in groups

mdibaiee opened this issue · 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.