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

Small refactoring #230

Closed
9 of 26 tasks
sasha240100 opened this issue Apr 7, 2017 · 1 comment
Closed
9 of 26 tasks

Small refactoring #230

sasha240100 opened this issue Apr 7, 2017 · 1 comment

Comments

@sasha240100
Copy link
Member

sasha240100 commented Apr 7, 2017

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
@sasha240100
Copy link
Member Author

I also want to keep simplicity of current OrbitModule.
It will now extend ControlsModule and be renamed to OrbitControlsModule

@sasha240100 sasha240100 changed the title OrbitModule to ControlsModule Small refactoring Apr 8, 2017
sasha240100 added a commit that referenced this issue Apr 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant