@@ -84,15 +84,15 @@ export class Camera implements ICamera {
8484 * @param segment - Optional segment to save as the camera position
8585 */
8686 async save ( segment ?: Segment ) {
87- this . _savedPosition = segment ?? await this . _rpc . RPCGetCameraPosition ( )
87+ this . _savedPosition = segment ?? await this . _rpc . RPCGetCameraView ( )
8888 }
8989
9090 /**
9191 * Resets the camera to the last saved position
9292 */
9393 restoreSavedPosition ( blendTime : number = this . _defaultBlendTime ) {
9494 if ( ! this . _savedPosition ) return
95- this . _rpc . RPCSetCameraPosition ( this . _savedPosition , blendTime )
95+ this . _rpc . RPCSetCameraView ( this . _savedPosition , blendTime )
9696 }
9797
9898 /**
@@ -102,7 +102,7 @@ export class Camera implements ICamera {
102102 restoreLastPosition ( blendTime : number = this . _defaultBlendTime ) {
103103 if ( this . _lastPosition ?. isValid ( ) ) {
104104 console . log ( 'Restoring camera position: ' , this . _lastPosition )
105- this . _rpc . RPCSetCameraPosition ( this . _lastPosition , blendTime )
105+ this . _rpc . RPCSetCameraView ( this . _lastPosition , blendTime )
106106 }
107107 }
108108
@@ -120,7 +120,7 @@ export class Camera implements ICamera {
120120 }
121121
122122 set ( position : THREE . Vector3 , target : THREE . Vector3 , blendTime : number = this . _defaultBlendTime ) {
123- this . _rpc . RPCSetCameraPosition ( new Segment ( position , target ) , blendTime )
123+ this . _rpc . RPCSetCameraView ( new Segment ( position , target ) , blendTime )
124124 }
125125
126126 /**
@@ -137,7 +137,7 @@ export class Camera implements ICamera {
137137 * @returns Promise that resolves when the framing animation is complete
138138 */
139139 async frameAll ( blendTime : number = this . _defaultBlendTime ) : Promise < Segment | undefined > {
140- const segment = await this . _rpc . RPCFrameAll ( blendTime )
140+ const segment = await this . _rpc . RPCFrameScene ( blendTime )
141141 this . _savedPosition = this . _savedPosition ?? segment
142142 return segment
143143 }
@@ -148,31 +148,32 @@ export class Camera implements ICamera {
148148 * @param blendTime - Duration of the camera animation in seconds (defaults to 0.5)
149149 */
150150 async frameBox ( box : THREE . Box3 , blendTime : number = this . _defaultBlendTime ) : Promise < Segment | undefined > {
151- const segment = await this . _rpc . RPCFrameBox ( box , blendTime )
151+
152+ const segment = await this . _rpc . RPCFrameAABB ( box , blendTime )
152153 this . _savedPosition = this . _savedPosition ?? segment
153154 return segment
154155 }
155156
156157 /**
157158 * Frames specific nodes of a Vim model in the camera view
158159 * @param vim - The Vim model containing the nodes to frame
159- * @param nodes - Array of node indices to frame, or 'all' to frame the entire model
160+ * @param elements - Array of element indices to frame, or 'all' to frame the entire model
160161 * @param blendTime - Duration of the camera animation in seconds (defaults to 0.5)
161162 * @returns Promise that resolves when the framing animation is complete
162163 */
163- async frameVim ( vim : Vim , nodes : number [ ] | 'all' , blendTime : number = this . _defaultBlendTime ) : Promise < Segment | undefined > {
164+ async frameVim ( vim : Vim , elements : number [ ] | 'all' , blendTime : number = this . _defaultBlendTime ) : Promise < Segment | undefined > {
164165 let segment : Segment | undefined
165- if ( nodes === 'all' ) {
166+ if ( elements === 'all' ) {
166167 segment = await this . _rpc . RPCFrameVim ( vim . handle , blendTime ) ;
167168 } else {
168- segment = await this . _rpc . RPCFrameInstances ( vim . handle , nodes , blendTime ) ;
169+ segment = await this . _rpc . RPCFrameElements ( vim . handle , elements , blendTime ) ;
169170 }
170171 this . _savedPosition = this . _savedPosition ?? segment
171172 return segment
172173 }
173174
174175 async frameObject ( object : Element3D , blendTime : number = this . _defaultBlendTime ) : Promise < Segment | undefined > {
175- const segment = await this . _rpc . RPCFrameInstances ( object . vim . handle , [ object . instance ] , blendTime )
176+ const segment = await this . _rpc . RPCFrameElements ( object . vim . handle , [ object . element ] , blendTime )
176177 this . _savedPosition = this . _savedPosition ?? segment
177178 return segment
178179 }
0 commit comments