Permalink
Browse files

add information about revision and platform to dae files exported

add camera to framework and loader (still incomplete)
  • Loading branch information...
opencollada-sebastian committed Feb 11, 2009
1 parent ba6ea63 commit 1af19d68c06441ae0d8c01d0676deb6a75034f6e
@@ -0,0 +1,134 @@
+/*
+ Copyright (c) 2008 NetAllied Systems GmbH
+
+ This file is part of COLLADAFramework.
+
+ 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 __COLLADAFW_CAMERA_H__
+#define __COLLADAFW_CAMERA_H__
+
+#include "COLLADAFWPrerequisites.h"
+#include "COLLADAFWObject.h"
+
+
+namespace COLLADAFW
+{
+
+ /** Camera class. The camera is either a perspective or an orthographic camera.
+ The CameraType indicates of which type the camera is which.
+ For perspective cameras mXFovOrXMag and mYFovOrYMag store the horizontal or vertical field of view,
+ for perspective cameras mXFovOrXMag and mYFovOrYMag store the horizontal or vertical magnification of the view.*/
+ class Camera : public ObjectTemplate < COLLADA_TYPE::CAMERA >
+ {
+ public:
+ /** The type of the camera.*/
+ enum CameraType
+ {
+ UNDEFINED_CAMERATYPE,
+ ORTHOGRAPHIC,
+ PERSPECTIVE
+ };
+
+ /** Defines which values are used to describe the perspective camera.*/
+ enum DescriptionType
+ {
+ UNDEFINED, //!< The perspective camera object is invalid
+ SINGLE_X, //!< Only xfov or xmag, respectively describes the camera
+ SINGLE_Y, //!< Only yfov or ymag, respectively describes the camera
+ X_AND_Y, //!< xfov and yfov or xmag and ymag, respectively describe the camera
+ ASPECTRATIO_AND_X, //!< aspect ratio and xfov or xmag, respectively describe the camera
+ ASPECTRATIO_AND_Y, //!< aspect ratio and yfov or <mag, respectivelydescribe the camera
+ };
+
+
+
+ private:
+ /** The name of the camera*/
+ String mName;
+
+ /** The type of the camera*/
+ CameraType mCameraType;
+
+ /** The type of description used to define the perspective camera.*/
+ DescriptionType mDescriptionType;
+
+ /** The horizontal field of view or magnification of the view.*/
+ double mXFovOrXMag;
+
+ /** The vertical field of view or magnification of the view.*/
+ double mYFovOrYMag;
+
+
+ /** The aspect ratio.*/
+ double mAspectRatio;
+
+ /** The near clipping plane.*/
+ double mNearClippingPlane;
+
+ /** The far clipping plane.*/
+ double mFarClippingPlane;
+ public:
+ /**
+ @param objectId The object id of the camera.*/
+ Camera( ObjectId objectId );
+
+ /** Destructor. */
+ virtual ~Camera();
+
+ /** Returns the name of the camera.*/
+ const COLLADAFW::String& getName() const { return mName; }
+
+ /** Sets the name of the camera.*/
+ void setName(const COLLADAFW::String& name) { mName = name; }
+
+ /** Returns the type of the camera.*/
+ CameraType getCameraType() const { return mCameraType; }
+
+ /** Sets the type of the camera.*/
+ void setCameraType( CameraType cameraType) { mCameraType = cameraType; }
+
+ /** Returns the type of description used to define the perspective camera.*/
+ DescriptionType getDescriptionType() const { return mDescriptionType; }
+
+ /** sets the type of description used to define the perspective camera.*/
+ void setDescriptionType(DescriptionType descriptionType) { mDescriptionType = descriptionType; }
+
+ /** Returns the horizontal field of view or magnification of the view.*/
+ double getXFovOrXMag() const { return mXFovOrXMag; }
+
+ /** Sets the horizontal field of view or magnification of the view.*/
+ void setXFovOrXMag(double xFov) { mXFovOrXMag = xFov; }
+
+ /** Returns the vertical field of view or magnification of the view.*/
+ double getYFovOrYMag() const { return mYFovOrYMag; }
+
+ /** Sets the vertical field of view or magnification of the view.*/
+ void setYFovOrYMag(double yFov) { mYFovOrYMag = yFov; }
+
+ /** Returns the aspect ratio.*/
+ double getAspectRatio() const { return mAspectRatio; }
+
+ /** Sets the aspect ratio.*/
+ void setAspectRatio(double aspectRatio) { mAspectRatio = aspectRatio; }
+
+ /** Returns the near clipping plane.*/
+ double getNearClippingPlane() const { return mNearClippingPlane; }
+
+ /** Sets the near clipping plane.*/
+ void setNearClippingPlane(double nearClippingPlane) { mNearClippingPlane = nearClippingPlane; }
+
+ /** Returns the far clipping plane.*/
+ double getFarClippingPlane() const { return mFarClippingPlane; }
+
+ /** Sets the far clipping plane.*/
+ void setFarClippingPlane(double farClippingPlane) { mFarClippingPlane = farClippingPlane; }
+
+ };
+
+} // namespace COLLADAFW
+
+#endif // __COLLADAFW_CAMERA_H__
@@ -22,6 +22,7 @@ namespace COLLADAFW
class LibraryNodes;
class Material;
class Effect;
+ class Camera;
/** Class that needs to be implemented by a writer.
@@ -75,6 +76,10 @@ namespace COLLADAFW
@return The writer should return true, if writing succeeded, false otherwise.*/
virtual bool writeEffect( const Effect* effect ) = 0;
+ /** When this method is called, the writer must write the camera.
+ @return The writer should return true, if writing succeeded, false otherwise.*/
+ virtual bool writeCamera( const Camera* camera ) = 0;
+
private:
/** Disable default copy ctor. */
@@ -295,6 +295,10 @@
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
+ <File
+ RelativePath="..\src\COLLADAFWCamera.cpp"
+ >
+ </File>
<File
RelativePath="..\src\COLLADAFWColor.cpp"
>
@@ -437,6 +441,10 @@
RelativePath="..\include\COLLADAFWArrayPrimitiveType.h"
>
</File>
+ <File
+ RelativePath="..\include\COLLADAFWCamera.h"
+ >
+ </File>
<File
RelativePath="..\include\COLLADAFWCode.h"
>
@@ -0,0 +1,36 @@
+/*
+ Copyright (c) 2008 NetAllied Systems GmbH
+
+ This file is part of COLLADAFramework.
+
+ Licensed under the MIT Open Source License,
+ for details please see LICENSE file or the website
+ http://www.opensource.org/licenses/mit-license.php
+*/
+
+#include "COLLADAFWStableHeaders.h"
+#include "COLLADAFWCamera.h"
+
+
+namespace COLLADAFW
+{
+
+ //------------------------------
+ Camera::Camera( ObjectId objectId)
+ : ObjectTemplate< COLLADA_TYPE::CAMERA >(objectId)
+ , mCameraType(UNDEFINED_CAMERATYPE)
+ , mDescriptionType( UNDEFINED )
+ , mXFovOrXMag(0)
+ , mYFovOrYMag(0)
+ , mAspectRatio(0)
+ , mNearClippingPlane(0)
+ , mFarClippingPlane(0)
+ {
+ }
+
+ //------------------------------
+ Camera::~Camera()
+ {
+ }
+
+} // namespace COLLADAFW
View
@@ -15,6 +15,10 @@ Requirements:
- MS Visual Studio 2005.
+- SVN comand line tool, especially svnversion (optional)
+ Available at http://subversion.tigris.org/
+ svnversion must be in your path
+
Building:
---------
@@ -88,6 +88,8 @@ namespace COLLADAMax
/** The id of the @a \<scene\> element.*/
static const String SCENE_ID;
+ static const String AUTHORING_TOOL;
+
/** A map, that hold all already exported objects with their ids*/
ObjectExportNodeMap mExportedObjects;
@@ -40,6 +40,7 @@ namespace COLLADAFW
class UniqueId;
class LibraryNodes;
class Node;
+ class Camera;
}
namespace COLLADAMax
@@ -210,6 +211,11 @@ namespace COLLADAMax
@return True on succeeded, false otherwise.*/
virtual bool writeEffect( const COLLADAFW::Effect* effect );
+ /** Writes the camera.
+ @return True on succeeded, false otherwise.*/
+ virtual bool writeCamera( const COLLADAFW::Camera* camera );
+
+
private:
/** Disable default copy ctor. */
Oops, something went wrong.

0 comments on commit 1af19d6

Please sign in to comment.