1 /*---------------------------------------------------------------------------*\
5 * Authors: David Kabala *
7 \*---------------------------------------------------------------------------*/
8 /*---------------------------------------------------------------------------*\
11 * This library is free software; you can redistribute it and/or modify it *
12 * under the terms of the GNU Library General Public License as published *
13 * by the Free Software Foundation, version 2. *
15 * This library is distributed in the hope that it will be useful, but *
16 * WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
18 * Library General Public License for more details. *
20 * You should have received a copy of the GNU Library General Public *
21 * License along with this library; if not, write to the Free Software *
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
24 \*---------------------------------------------------------------------------*/
26 #ifndef _OSGCAMERAUTILS_H_
27 #define _OSGCAMERAUTILS_H_
29 #include "OSGConfig.h"
30 #include "OSGUtilDef.h"
32 #include "OSGCamera.h"
33 #include "OSGPerspectiveCamera.h"
39 * \brief Set position and direction of camera to show all of a node.
41 * Sets the position and direction of a perspective camera such that the
42 * volume bounding the node is contained in the view of the camera. The near
43 * clipping plane is set to 0.1 times of the maximum axis of the volume of the
44 * node. The far clipping plane is set to 10 times of the maximum axis of the
45 * volume of the node. The Up direction is used when calculating the camera's
47 * @param[in,out] TheCamera The camera
48 * @param[in] Scene The node to view
49 * @param[in] Up The direction to use as the up direction when calculating the
54 void showAll(PerspectiveCamera
*pCamera
,
56 Vec3f vUp
= Vec3f(0.0f
, 1.0f
, 0.0f
));
59 * \brief Set position and direction of camera to show all of a node.
61 * Sets the position and direction of a perspective camera such that the
62 * volume bounding the node is contained in the view of the camera. The near
63 * clipping plane is set to 0.1 times of the maximum axis of the volume of the
64 * node. The far clipping plane is set to 10 times of the maximum axis of the
65 * volume of the node. The Up direction is used when calculating the camera's
66 * orientation. Currently this only works for perspective cameras.
67 * @param[in,out] TheCamera The camera
68 * @param[in] Scene The node to view
69 * @param[in] Up The direction to use as the up direction when calculating the
74 void showAll(Camera
*pCamera
,
76 Vec3f vUp
= Vec3f(0.0f
, 1.0f
, 0.0f
));
80 #endif //_OSGCAMERAUTILS_H_