Skip to content

Physics doesn't work for objects in groups #17

@mdibaiee

Description

@mdibaiee

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions