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

euler is possible to allow prefix params like "_xyz" instead of "xyz" ? #1

Open
jonlepage opened this issue Mar 24, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@jonlepage
Copy link

jonlepage commented Mar 24, 2022

hi friend, thanks for this awesome controller !
Its would be awesome if you can found a hack to allow prefixed variable.
ex:

  const params = {
    euler: { _x: 0.0, _y: 0.0, _z: 0.0 },
  }
  pane.addInput(params, 'euler', {
    view: 'rotation',
    rotationMode: 'euler',
    order: 'XYZ',
    unit: 'deg',
  });

I suppose if you not allowed this yet is may related to architecture limitation of plugins API ?


My user case is because in usage of a game engine rendering (webgl), we need use a custom update loop with requestAnimationFrame where is run in loop and will apply data like.
image


So in this kind of case , the update run like this, and the gui should mutate private "._xyz" value instead of setter values ".xyz".

	update(): void {
		this.proj.scale.set( this._zoom );
		this.proj.euler.set( this.euler._x, this.euler._y, this.euler._z ); // apply _.x and not .x
		this.setPlanes( this._focus, this._near, this._far, this._orthographic );
	}

if the Gui apply euler data on setter in same time as the game update, every math break and go weird.
Is there a way to use param like euler: { _x: 0.0, _y: 0.0, _z: 0.0 } instead of euler: { x: 0.0, y: 0.0, z: 0.0 }

I add a dirty temp hack on my side to make this work, but i should not really not hack my engine to make it work with a gui, is really not a good idea 🤣
image
so i add a custom object in hight level, where the update use it instead the low level .


i also have another question ,is there a way to reduce the mouse sensibility ?
i tried add a very low value in step like step: 0.001 without success !

		folder2.addInput( $, '_eulers', {
			view: 'rotation',
			rotationMode: 'euler',
			order: 'XYZ',
			unit: 'rad', 
			step: 0.0001, // sensivity ? seem not work.
			picker: 'inline',
			expanded: true, 
		} );

Sorry for pock you and for the inconvenience and thanks you @0b5vr for any time you can give :)

@0b5vr
Copy link
Owner

0b5vr commented May 25, 2022

Sorry for the late reply 🙇
Thank you for the detailed description of your circumstance.

I remembered I just followed how the API design goes in the original tweakpane APIs when I implement this but let me check this again.
Honestly I'm also bothered by the interface (I want to get the result in Array format).

Also I'm 80% sure that I did no mouse sensitivity stuff when I do this, which is worth considering I believe.

@0b5vr 0b5vr added the enhancement New feature or request label May 25, 2022
@0b5vr 0b5vr self-assigned this May 25, 2022
@jonlepage
Copy link
Author

you are not alone, I was interested in it to make a plugin and I also found that the API was very restrictive and not very intuitive. I am not a fan of technologies and architecture choosed by the API.
Feel free to update if you found a solution, i will update my dirty code on my side :)

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

No branches or pull requests

2 participants