Skip to content

Small refactoring #230

@sasha240100

Description

@sasha240100

Components

  • WHS.Model -> WHS.Importer Reason: can handle group of objects

Modules

  • WHS.app.ModuleName -> WHS.ModuleName

Maintainance

  • Remove compact version

Presets

  • Make TestApp class that will behave like an App with BasicAppPreset

ControlsModule

A lot of Three.js controls have similar API (.update(), ...).

We can make a ControlsModule which will take:

  • A Three.js controls instance.

  • fix() - same as in TextureModule. Allows you to make changes to controls before they are added.

  • Concept

const controlsModule = new ControlsModule({
  controls: new THREE.OrbitControls(),
  
  fix(controls) {
    controls.customParameter = value;

    return controls;
  }
});

const app = new App([
  // ...
  controlsModule
]);

app.start();
  • Get original controls
console.log(controlsModule.controls); // THREE.OrbitControls
  • Shorter way
const app = new App([
  // ...
  ControlsModule.from(new THREE.OrbitControls())
]);
Version:
  • v2.x.x
  • v1.x.x
Issue type:
  • Bug
  • Proposal/Enhancement
  • Question
  • Discussion

Tested on:
Desktop
  • Chrome
  • Chrome Canary
  • Chrome dev-channel
  • Firefox
  • Opera
  • Microsoft IE
  • Microsoft Edge
Android
  • Chrome
  • Firefox
  • Opera
IOS
  • Chrome
  • Firefox
  • Opera

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions