Skip to content

You can't control OrbitControls from DesktopModule. #22

@mrEuler

Description

@mrEuler

Currently user has to write next code to access OrbitControls:

const orbitControls = modulesProcessor.modulesInstances.get(DesktopModule)[1];

It should be the same as for DesktopActionController, so just accessing Agent:

const controls = modulesProcessor.agents.get(Controls);

ControlsAgent should provide user with ability to set different positions for different platforms. For example:

const controls: ControlsAgent = modulesProcessor.agents.get(Controls);
controls.setPositions({
    DESKTOP: new Vector3(1,2,3) / [1, 2, 3] / 0,
    QUEST: new Vector3(1,2,3) / [1, 2, 3] / 0,
    PLATFORM_Z: new Vector3(1,2,3) / [1, 2, 3] / 0
})

The same should be for rotations.
To get specific controls, user can write next code:

const controls: ControlsAgent = modulesProcessor.agents.get(Controls);
const orbitControls: OrbitControls = controls.getSpecific(OrbitControls);

To be continued...

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions