Add sphere to function names where a sphere is expected.

This commit is contained in:
kovacsv 2021-07-27 08:14:31 +02:00
parent 669c06ffdd
commit 9901ba1f4c
4 changed files with 9 additions and 9 deletions

View File

@ -36,13 +36,13 @@ OV.Init3DViewerElement = function (parentDiv, modelUrls, parameters)
let boundingSphere = viewer.GetBoundingSphere ((meshUserData) => { let boundingSphere = viewer.GetBoundingSphere ((meshUserData) => {
return true; return true;
}); });
viewer.AdjustClippingPlanes (boundingSphere); viewer.AdjustClippingPlanesToSphere (boundingSphere);
if (parameters.camera) { if (parameters.camera) {
viewer.SetCamera (parameters.camera); viewer.SetCamera (parameters.camera);
} else { } else {
viewer.SetUpVector (importResult.upVector, false); viewer.SetUpVector (importResult.upVector, false);
} }
viewer.FitToWindow (boundingSphere, false); viewer.FitSphereToWindow (boundingSphere, false);
}, },
onTextureLoaded : () => { onTextureLoaded : () => {
viewer.Render (); viewer.Render ();

View File

@ -228,7 +228,7 @@ OV.Viewer = class
this.Render (); this.Render ();
} }
FitToWindow (boundingSphere, animation) FitSphereToWindow (boundingSphere, animation)
{ {
if (boundingSphere === null) { if (boundingSphere === null) {
return; return;
@ -244,7 +244,7 @@ OV.Viewer = class
} }
} }
AdjustClippingPlanes (boundingSphere) AdjustClippingPlanesToSphere (boundingSphere)
{ {
if (boundingSphere === null) { if (boundingSphere === null) {
return; return;

View File

@ -53,14 +53,14 @@ OV.Embed = class
let boundingSphere = this.viewer.GetBoundingSphere ((meshUserData) => { let boundingSphere = this.viewer.GetBoundingSphere ((meshUserData) => {
return true; return true;
}); });
this.viewer.AdjustClippingPlanes (boundingSphere); this.viewer.AdjustClippingPlanesToSphere (boundingSphere);
let camera = this.hashHandler.GetCameraFromHash (); let camera = this.hashHandler.GetCameraFromHash ();
if (camera !== null) { if (camera !== null) {
this.viewer.SetCamera (camera); this.viewer.SetCamera (camera);
} else { } else {
this.viewer.SetUpVector (importResult.upVector, false); this.viewer.SetUpVector (importResult.upVector, false);
} }
this.viewer.FitToWindow (boundingSphere, false); this.viewer.FitSphereToWindow (boundingSphere, false);
} }
InitViewer (canvas) InitViewer (canvas)

View File

@ -210,9 +210,9 @@ OV.Website = class
return this.navigator.IsMeshVisible (meshUserData.originalMeshIndex); return this.navigator.IsMeshVisible (meshUserData.originalMeshIndex);
}); });
if (onLoad) { if (onLoad) {
this.viewer.AdjustClippingPlanes (boundingSphere); this.viewer.AdjustClippingPlanesToSphere (boundingSphere);
} }
this.viewer.FitToWindow (boundingSphere, animation); this.viewer.FitSphereToWindow (boundingSphere, animation);
} }
FitMeshToWindow (meshIndex) FitMeshToWindow (meshIndex)
@ -220,7 +220,7 @@ OV.Website = class
let boundingSphere = this.viewer.GetBoundingSphere ((meshUserData) => { let boundingSphere = this.viewer.GetBoundingSphere ((meshUserData) => {
return meshUserData.originalMeshIndex === meshIndex; return meshUserData.originalMeshIndex === meshIndex;
}); });
this.viewer.FitToWindow (boundingSphere, true); this.viewer.FitSphereToWindow (boundingSphere, true);
} }
UpdateMeshesVisibility () UpdateMeshesVisibility ()