Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

frame.h

Go to the documentation of this file.
00001 // frame.h
00002 // 
00003 // Copyright (C) 2003, Chris Laurel <claurel@shatters.net>
00004 //
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 
00010 #ifndef _CELENGINE_FRAME_H_
00011 #define _CELENGINE_FRAME_H_
00012 
00013 #include <celmath/vecmath.h>
00014 #include <celmath/quaternion.h>
00015 #include <celengine/astro.h>
00016 #include <celengine/selection.h>
00017 
00018 
00019 struct RigidTransform
00020 {
00021     RigidTransform() :
00022         translation(0.0, 0.0, 0.0), rotation(1.0, 0.0, 0.0, 0.0) {};
00023     RigidTransform(const UniversalCoord& uc) :
00024         translation(uc), rotation(1.0f) {};
00025     RigidTransform(const UniversalCoord& uc, const Quatd& q) :
00026         translation(uc), rotation(q) {};
00027     RigidTransform(const UniversalCoord& uc, const Quatf& q) :
00028         translation(uc), rotation(q.w, q.x, q.y, q.z) {};
00029     UniversalCoord translation;
00030     Quatd rotation;
00031 };
00032 
00033 
00034 struct FrameOfReference
00035 {
00036     FrameOfReference() :
00037         coordSys(astro::Universal) {};
00038     FrameOfReference(astro::CoordinateSystem _coordSys, Body* _body) :
00039         coordSys(_coordSys), refObject(_body) {};
00040     FrameOfReference(astro::CoordinateSystem _coordSys, Star* _star) :
00041         coordSys(_coordSys), refObject(_star) {};
00042     FrameOfReference(astro::CoordinateSystem _coordSys, DeepSkyObject* _deepsky) :
00043         coordSys(_coordSys), refObject(_deepsky) {};
00044     FrameOfReference(astro::CoordinateSystem _coordSys, const Selection& sel) :
00045         coordSys(_coordSys), refObject(sel) {};
00046     FrameOfReference(astro::CoordinateSystem _coordSys, const Selection& ref,
00047                      const Selection& target) :
00048         coordSys(_coordSys), refObject(ref), targetObject(target) {};
00049 
00050     RigidTransform toUniversal(const RigidTransform& xform, double t) const;
00051     RigidTransform fromUniversal(const RigidTransform& xform, double t) const;
00052 
00053     astro::CoordinateSystem coordSys;
00054     Selection refObject;
00055     Selection targetObject;
00056 };
00057 
00058 #endif // _CELENGINE_FRAME_H_

Generated on Sat Jan 14 22:30:27 2006 for Celestia by  doxygen 1.4.1