/usr/include/opencollada/COLLADAStreamWriter/COLLADASWCameraOptic.h is in opencollada-dev 0.1.0~20160714.0ec5063+dfsg1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | /*
Copyright (c) 2008-2009 NetAllied Systems GmbH
This file is part of COLLADAStreamWriter.
Licensed under the MIT Open Source License,
for details please see LICENSE file or the website
http://www.opensource.org/licenses/mit-license.php
*/
#ifndef __COLLADASTREAMWRITER_CAMERA_OPTIC_H__
#define __COLLADASTREAMWRITER_CAMERA_OPTIC_H__
#include "COLLADASWPrerequisites.h"
#include "COLLADASWStreamWriter.h"
#include "COLLADASWExtraTechnique.h"
#include "COLLADASWConstants.h"
namespace COLLADASW
{
/** A class that hold all information about an @a \<camera\> element.*/
class BaseOptic : public ElementWriter, public BaseExtraTechnique
{
private:
// Camera should be able to call the add() method.
friend class Camera;
protected:
/** Flags, if the values was set. */
bool mHasXFov;
bool mHasYFov;
bool mHasXMag;
bool mHasYMag;
bool mHasAspectRatio;
bool mHasZNear;
bool mHasZFar;
/** The aspect ratio of the field of view. If the <aspect_ratio>
element is not specified, it is calculated from the <xfov> or <yfov>
elements and the current viewport. The aspect ratio is defined as the
ratio of the field of view�s width over its height. */
float mAspectRatio;
String mAspectRatioSid;
/** The distance to the near clipping plane. */
float mZNear;
String mZNearSid;
/** The distance to the far clipping plane. */
float mZFar;
String mZFarSid;
/** The horizontal field of view in degrees - used for the perspective camera. */
float mXFov;
String mXFovSid;
/** The vertical field of view in degrees - used for the perspective camera. */
float mYFov;
String mYFovSid;
/** The horizontal (X) magnification of the view.
The X and Y magnifications are simple scale factors, applied to the
X and Y components of the orthographic viewport. As such, if your
default orthographic viewport is [[-1,1],[-1,1]] as in OpenGL and
DirectX, your COLLADASW orthographic viewport becomes
[[-xmag,xmag],[-ymag,ymag]]. This gives an orthographic width of
xmag/2 and an orthographic height of ymag/2.
- used for the orthographic camera.*/
float mXMag;
String mXMagSid;
/** The vertical (Y) magnification of the view.
The X and Y magnifications are simple scale factors, applied to the
X and Y components of the orthographic viewport. As such, if your
default orthographic viewport is [[-1,1],[-1,1]] as in OpenGL and
DirectX, your COLLADASW orthographic viewport becomes
[[-xmag,xmag],[-ymag,ymag]]. This gives an orthographic width of
xmag/2 and an orthographic height of ymag/2.
- used for the orthographic camera.*/
float mYMag;
String mYMagSid;
protected:
/** Adds the optics information. */
void add() const;
/** Adds the optic type specific information. */
virtual void addTypeSpecificInfos () const = 0;
public:
/**
* Constructor
* @param cameraId The id of the camera.
* @param cameraName The name of the camera.
*/
BaseOptic ( StreamWriter* streamWriter );
/** Destructor */
virtual ~BaseOptic() {}
/** The distance to the far clipping plane. */
void setZFar ( float val, const String& sid="" ) { mZFar = val; mZFarSid = sid; mHasZFar = true; }
void setZFar( const float val, const bool useDefaultSid, const String& sid="" );
/** Returns the default sid used for the zfar element*/
static const String& getZFarDefaultSid() { return CSWC::CSW_ELEMENT_ZFAR; }
/** The distance to the near clipping plane. */
void setZNear ( float val, const String& sid="" ) { mZNear = val; mZNearSid = sid; mHasZNear = true; }
void setZNear( const float val, const bool useDefaultSid, const String& sid="" );
/** Returns the default sid used for the znear element*/
static const String& getZNearDefaultSid() { return CSWC::CSW_ELEMENT_ZNEAR; }
/** The aspect ratio of the field of view. If the <aspect_ratio>
element is not specified, it is calculated from the <xfov> or <yfov>
elements and the current viewport. The aspect ratio is defined as the
ratio of the field of view�s width over its height. */
void setAspectRatio ( float val, const bool useDefaultSid = false, const String& sid="" );
/** The horizontal field of view in degrees - used for the perspective camera. */
void setXFov ( float val, const String& sid="" ) { mXFov = val; mXFovSid = sid; mHasXFov = true; }
void setXFov( float val, const bool useDefaultSid, const String& sid="" );
/** Returns the default sid used for the xfovelement*/
static const String& getXFovDefaultSid() { return CSWC::CSW_ELEMENT_XFOV; }
/** The vertical field of view in degrees - used for the perspective camera. */
void setYFov ( float val, const String& sid="" ) { mYFov = val; mYFovSid = sid; mHasYFov = true; }
void setYFov( float val, const bool useDefaultSid, const String& sid="" );
/** Returns the default sid used for the yfov element*/
static const String& getYFovDefaultSid() { return CSWC::CSW_ELEMENT_YFOV; }
/** The horizontal (X) magnification of the view.
The X and Y magnifications are simple scale factors, applied to the
X and Y components of the orthographic viewport. As such, if your
default orthographic viewport is [[-1,1],[-1,1]] as in OpenGL and
DirectX, your COLLADASW orthographic viewport becomes
[[-xmag,xmag],[-ymag,ymag]]. This gives an orthographic width of
xmag/2 and an orthographic height of ymag/2.
- used for the orthographic camera.*/
void setXMag ( float val, const String& sid="" ) { mXMag = val; mXMagSid = sid; mHasXMag = true; }
void setXMag ( float val, bool useDefaultSid, const String& sid="" );
/** Returns the default sid used for the xmag element*/
static const String& getXMagDefaultSid() { return CSWC::CSW_ELEMENT_XMAG; }
/** The vertical (Y) magnification of the view.
The X and Y magnifications are simple scale factors, applied to the
X and Y components of the orthographic viewport. As such, if your
default orthographic viewport is [[-1,1],[-1,1]] as in OpenGL and
DirectX, your COLLADASW orthographic viewport becomes
[[-xmag,xmag],[-ymag,ymag]]. This gives an orthographic width of
xmag/2 and an orthographic height of ymag/2.
- used for the orthographic camera.*/
void setYMag ( float val, const String& sid="" ) { mYMag = val; mYMagSid = sid; mHasYMag = true; }
void setYMag ( float val, bool useDefaultSid, const String& sid="" );
/** Returns the default sid used for the ymag element*/
static const String& getYMagDefaultSid() { return CSWC::CSW_ELEMENT_YMAG; }
};
/** Camera class for perspective camera.
The projection type. The COMMON profile defines the optics types
<perspective> and <orthographic>. All other <optics> types must be
specified within a profile-specific <technique>.
Perspective embodies the appearance of objects relative to each other
as determined by their distance from a viewer. Computer graphics
techniques apply a perspective projection in order to render 3-D
objects onto 2-D surfaces to create properly proportioned images on
display monitors. */
class PerspectiveOptic : public BaseOptic
{
public:
/**
* Constructor
* @param cameraId The id of the camera.
* @param cameraName The name of the camera.
*/
PerspectiveOptic ( StreamWriter* streamWriter )
: BaseOptic ( streamWriter )
{}
virtual ~PerspectiveOptic() {}
protected:
/** Adds the camera type specific information. */
void addTypeSpecificInfos () const;
};
/** Camera class for orthographic camera.
The COMMON profile defines the optics types
<perspective> and <orthographic>. All other <optics> types must be
specified within a profile-specific <technique>.
Orthographic projection describes a way of drawing a 3-D scene on a
2-D surface. In an orthographic projection, the apparent size of an
object does not depend on its distance from the camera. */
class OrthographicOptic : public BaseOptic
{
public:
/**
* Constructor
*/
OrthographicOptic ( StreamWriter* streamWriter )
: BaseOptic ( streamWriter ) {}
virtual ~OrthographicOptic() {}
protected:
/** Adds the optic type specific information. */
void addTypeSpecificInfos () const;
};
} //namespace COLLADASW
#endif //__COLLADASTREAMWRITER_CAMERA_OPTIC_H__
|