MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / resetCameraToViewAll

Method resetCameraToViewAll

testbed/src/Scene.cpp:62–73  ·  view source on GitHub ↗

Set the camera so that we can view the whole scene

Source from the content-addressed store, hash-verified

60
61// Set the camera so that we can view the whole scene
62void Scene::resetCameraToViewAll() {
63
64 // Move the camera to the origin of the scene
65 mCamera.translateWorld(-mCamera.getOrigin());
66
67 // Move the camera
68 mCamera.translateWorld(mCenterScene);
69
70 // Set the zoom of the camera so that the scene center is
71 // in negative view direction of the camera
72 mCamera.setZoom(mInitZoom);
73}
74
75// Map the mouse x,y coordinates to a point on a sphere
76bool Scene::mapMouseCoordinatesToSphere(double xMouse, double yMouse,

Callers

nothing calls this directly

Calls 3

translateWorldMethod · 0.80
getOriginMethod · 0.80
setZoomMethod · 0.80

Tested by

no test coverage detected