Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Physics doesn't work for objects in groups #17

Open
mdibaiee opened this issue Dec 28, 2018 · 1 comment
Open

Physics doesn't work for objects in groups #17

mdibaiee opened this issue Dec 28, 2018 · 1 comment

Comments

@mdibaiee
Copy link

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 mdibaiee changed the title Physics for objects in groups Physics doesn't work for objects in groups Dec 28, 2018
@noahcoetsee
Copy link

@sasha240100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants