@@ -13,13 +13,15 @@ interface IJoints {
1313 * the robot joints
1414 */
1515export class URDFControls extends GUI {
16+ private _orbitControlsFolder : any ;
1617 private _workspaceFolder : any ;
1718 private _sceneFolder : any ;
1819 private _jointsFolder : any ;
1920 private _jointsEditorFolder : any ;
2021 private _workingPath = '' ;
2122
2223 controls : any = {
24+ orbitControls : { } ,
2325 path : { } ,
2426 scene : {
2527 background : { } ,
@@ -59,6 +61,9 @@ export class URDFControls extends GUI {
5961 'dg editor-folder'
6062 ) ;
6163
64+ this . _orbitControlsFolder = this . addFolder ( 'Orbit Controls' ) ;
65+ this . _orbitControlsFolder . domElement . setAttribute ( 'class' , 'dg camera-folder' ) ;
66+
6267 this . _workspaceFolder = this . addFolder ( 'Workspace' ) ;
6368 this . _workspaceFolder . domElement . setAttribute (
6469 'class' ,
@@ -129,6 +134,51 @@ export class URDFControls extends GUI {
129134 } ) ;
130135 }
131136
137+ /**
138+ * Creates controls for panSpeed, zoomSpeed, rotateSpeed
139+ *
140+ * @returns - The controls to trigger callbacks when settings change
141+ */
142+ createOrbitControls ( ) {
143+ if ( this . _isEmpty ( this . controls . orbitControls ) ) {
144+ const orbitControlSettings = {
145+ panSpeed : 2 ,
146+ zoomSpeed : 1 ,
147+ rotateSpeed : 2
148+ } ;
149+
150+ const minValue = 0.1 ;
151+ const maxValue = 5 ;
152+ this . controls . orbitControls = {
153+ panSpeed : this . _orbitControlsFolder . add (
154+ orbitControlSettings ,
155+ 'panSpeed' ,
156+ minValue ,
157+ maxValue
158+ ) ,
159+ zoomSpeed : this . _orbitControlsFolder . add (
160+ orbitControlSettings ,
161+ 'zoomSpeed' ,
162+ minValue ,
163+ maxValue
164+ ) ,
165+ rotateSpeed : this . _orbitControlsFolder . add (
166+ orbitControlSettings ,
167+ 'rotateSpeed' ,
168+ minValue ,
169+ maxValue
170+ )
171+ } ;
172+
173+ this . _enforceNumericInput ( this . controls . orbitControls . panSpeed ) ;
174+ this . _enforceNumericInput ( this . controls . orbitControls . zoomSpeed ) ;
175+ this . _enforceNumericInput ( this . controls . orbitControls . rotateSpeed ) ;
176+
177+ this . _orbitControlsFolder . open ( )
178+ }
179+ return this . controls . orbitControls ;
180+ }
181+
132182 /**
133183 * Creates an input box and a button to modify the working path
134184 *
0 commit comments