-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GRAPHICS: Add initial stubs for animation and animnode classes
- Loading branch information
Showing
8 changed files
with
344 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* xoreos - A reimplementation of BioWare's Aurora engine | ||
* | ||
* xoreos is the legal property of its developers, whose names can be | ||
* found in the AUTHORS file distributed with this source | ||
* distribution. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 3 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
* | ||
* The Infinity, Aurora, Odyssey and Eclipse engines, Copyright (c) BioWare corp. | ||
* The Electron engine, Copyright (c) Obsidian Entertainment and BioWare corp. | ||
*/ | ||
|
||
/** @file graphics/aurora/animation.cpp | ||
* An animation to be applied to a model. | ||
*/ | ||
|
||
#include "common/stream.h" | ||
|
||
#include "graphics/graphics.h" | ||
#include "graphics/camera.h" | ||
|
||
#include "graphics/aurora/model.h" | ||
#include "graphics/aurora/modelnode.h" | ||
#include "graphics/aurora/animation.h" | ||
#include "graphics/aurora/animnode.h" | ||
|
||
namespace Graphics { | ||
|
||
namespace Aurora { | ||
|
||
Animation::Animation() | ||
{ | ||
|
||
} | ||
|
||
Animation::~Animation() { | ||
} | ||
|
||
const Common::UString &Model::getName() const { | ||
return _name; | ||
} | ||
|
||
} // End of namespace Aurora | ||
|
||
} // End of namespace Graphics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
/* xoreos - A reimplementation of BioWare's Aurora engine | ||
* | ||
* xoreos is the legal property of its developers, whose names can be | ||
* found in the AUTHORS file distributed with this source | ||
* distribution. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 3 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
* | ||
* The Infinity, Aurora, Odyssey and Eclipse engines, Copyright (c) BioWare corp. | ||
* The Electron engine, Copyright (c) Obsidian Entertainment and BioWare corp. | ||
*/ | ||
|
||
/** @file graphics/aurora/animation.h | ||
* An animation to be applied to a model. | ||
*/ | ||
|
||
#ifndef GRAPHICS_AURORA_ANIMATION_H | ||
#define GRAPHICS_AURORA_ANIMATION_H | ||
|
||
#include <vector> | ||
#include <list> | ||
#include <map> | ||
|
||
#include "common/ustring.h" | ||
#include "common/transmatrix.h" | ||
#include "common/boundingbox.h" | ||
|
||
#include "graphics/types.h" | ||
#include "graphics/glcontainer.h" | ||
#include "graphics/renderable.h" | ||
|
||
#include "graphics/aurora/types.h" | ||
|
||
namespace Common { | ||
class SeekableReadStream; | ||
} | ||
|
||
namespace Graphics { | ||
|
||
namespace Aurora { | ||
|
||
class AnimNode; | ||
|
||
class Animation { | ||
public: | ||
Animation(); | ||
~Animation(); | ||
|
||
/** Get the animation's name. */ | ||
const Common::UString &getName() const; | ||
|
||
// Nodes | ||
|
||
/** Does the specified node exist in the current state? */ | ||
// bool hasNode(const Common::UString &node) const; | ||
|
||
/** Get the specified node, from the current state. */ | ||
// AnimNode *getNode(const Common::UString &node); | ||
/** Get the specified node, from the current state. */ | ||
// const AnimNode *getNode(const Common::UString &node) const; | ||
|
||
protected: | ||
typedef std::list<AnimNode *> NodeList; | ||
typedef std::map<Common::UString, AnimNode *, Common::UString::iless> NodeMap; | ||
|
||
Common::UString _name; ///< The model's name. | ||
|
||
/* | ||
public: | ||
// General loading helpers | ||
static void readValue(Common::SeekableReadStream &stream, uint32 &value); | ||
static void readValue(Common::SeekableReadStream &stream, float &value); | ||
static void readArrayDef(Common::SeekableReadStream &stream, | ||
uint32 &offset, uint32 &count); | ||
template<typename T> | ||
static void readArray(Common::SeekableReadStream &stream, | ||
uint32 offset, uint32 count, std::vector<T> &values); | ||
friend class AnimNode;*/ | ||
}; | ||
|
||
} // End of namespace Aurora | ||
|
||
} // End of namespace Graphics | ||
|
||
#endif // GRAPHICS_AURORA_ANIMATION_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* xoreos - A reimplementation of BioWare's Aurora engine | ||
* | ||
* xoreos is the legal property of its developers, whose names can be | ||
* found in the AUTHORS file distributed with this source | ||
* distribution. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 3 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
* | ||
* The Infinity, Aurora, Odyssey and Eclipse engines, Copyright (c) BioWare corp. | ||
* The Electron engine, Copyright (c) Obsidian Entertainment and BioWare corp. | ||
*/ | ||
|
||
/** @file graphics/aurora/modelnode.cpp | ||
* A node within a 3D model. | ||
*/ | ||
|
||
#include "common/util.h" | ||
#include "common/maths.h" | ||
|
||
#include "graphics/aurora/modelnode.h" | ||
#include "graphics/aurora/animnode.h" | ||
#include "graphics/aurora/animation.h" | ||
#include "graphics/aurora/model.h" | ||
|
||
namespace Graphics { | ||
|
||
namespace Aurora { | ||
|
||
|
||
AnimNode::AnimNode(Animation &animation) : | ||
_animation(&animation), _parent(0) | ||
{ | ||
} | ||
|
||
AnimNode::~AnimNode() { | ||
} | ||
|
||
AnimNode *AnimNode::getParent() { | ||
return _parent; | ||
} | ||
|
||
const AnimNode *AnimNode::getParent() const { | ||
return _parent; | ||
} | ||
|
||
void AnimNode::setParent(AnimNode *parent) { | ||
_parent = parent; | ||
} | ||
|
||
const Common::UString &AnimNode::getName() const { | ||
return _name; | ||
} | ||
|
||
} // End of namespace Aurora | ||
|
||
} // End of namespace Graphics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* xoreos - A reimplementation of BioWare's Aurora engine | ||
* | ||
* xoreos is the legal property of its developers, whose names can be | ||
* found in the AUTHORS file distributed with this source | ||
* distribution. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 3 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
* | ||
* The Infinity, Aurora, Odyssey and Eclipse engines, Copyright (c) BioWare corp. | ||
* The Electron engine, Copyright (c) Obsidian Entertainment and BioWare corp. | ||
*/ | ||
|
||
/** @file graphics/aurora/animnode.h | ||
* A node within an animation. | ||
*/ | ||
|
||
#ifndef GRAPHICS_AURORA_ANIMNODE_H | ||
#define GRAPHICS_AURORA_ANIMNODE_H | ||
|
||
#include <list> | ||
#include <vector> | ||
|
||
#include "common/ustring.h" | ||
#include "common/transmatrix.h" | ||
#include "common/boundingbox.h" | ||
|
||
#include "graphics/types.h" | ||
|
||
#include "graphics/aurora/types.h" | ||
#include "graphics/aurora/textureman.h" | ||
|
||
namespace Graphics { | ||
|
||
namespace Aurora { | ||
|
||
class Animation; | ||
|
||
class AnimNode { | ||
public: | ||
AnimNode(Animation &anim); | ||
~AnimNode(); | ||
|
||
/** Get the node's name. */ | ||
const Common::UString &getName() const; | ||
|
||
protected: | ||
Animation *_animation; ///< The animation this node belongs to. | ||
|
||
AnimNode *_parent; ///< The node's parent. | ||
std::list<AnimNode *> _children; ///< The node's children. | ||
|
||
Common::UString _name; ///< The node's name. | ||
|
||
//void render(RenderPass pass); | ||
|
||
public: | ||
// General helpers | ||
|
||
AnimNode *getParent(); ///< Get the node's parent. | ||
const AnimNode *getParent() const; ///< Get the node's parent. | ||
|
||
void setParent(AnimNode *parent); ///< Set the node's parent. | ||
|
||
//void reparent(AnimNode &parent); | ||
|
||
|
||
friend class Animation; | ||
}; | ||
|
||
} // End of namespace Aurora | ||
|
||
} // End of namespace Graphics | ||
|
||
#endif // GRAPHICS_AURORA_ANIMNODE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters