00001 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- 00002 00003 this file is part of rcssserver3D 00004 Fri May 9 2003 00005 Copyright (C) 2002,2003 Koblenz University 00006 Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group 00007 $Id: basenode.h,v 1.11 2004/04/27 09:58:57 rollmark Exp $ 00008 00009 This program is free software; you can redistribute it and/or modify 00010 it under the terms of the GNU General Public License as published by 00011 the Free Software Foundation; version 2 of the License. 00012 00013 This program is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with this program; if not, write to the Free Software 00020 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00021 00022 BaseNode 00023 00024 NOTE: 00025 00026 HISTORY: 00027 05.11.02 - MK 00028 - Initial version 00029 00030 TODO: 00031 00032 TOFIX: 00033 */ 00034 #ifndef OXYGEN_BASENODE_H 00035 #define OXYGEN_BASENODE_H 00036 00037 #include <salt/matrix.h> 00038 #include <salt/bounds.h> 00039 #include <zeitgeist/node.h> 00040 00041 namespace oxygen 00042 { 00043 00044 class Scene; 00045 00052 class BaseNode : public zeitgeist::Node 00053 { 00054 // 00055 // Functions 00056 // 00057 public: 00058 BaseNode(); 00059 virtual ~BaseNode(); 00060 00061 // transformation related 00062 00065 virtual const salt::Matrix& GetLocalTransform() const; 00066 00069 virtual const salt::Matrix& GetWorldTransform() const; 00070 00072 virtual void SetLocalTransform(const salt::Matrix &transform); 00073 00075 virtual void SetWorldTransform(const salt::Matrix &transform); 00076 00077 // bounding box related 00078 00080 virtual void ComputeBoundingBox(); 00081 00083 const salt::AABB3& GetWorldBoundingBox() const; 00084 00085 // scene graph update passes 00086 00088 void PrePhysicsUpdate(float deltaTime); 00089 00091 void PostPhysicsUpdate(); 00092 00095 void UpdateHierarchy(); 00096 00098 boost::shared_ptr<Scene> GetScene(); 00099 00101 void EnableDebugMode(); 00102 00104 void DisableDebugMode(); 00105 00107 bool ImportScene(const std::string& fileName, 00108 boost::shared_ptr<zeitgeist::ParameterList> parameter); 00109 00110 protected: 00113 salt::Vector3f GetLocalPos(const salt::Vector3f& worldPos); 00114 00116 virtual void PrePhysicsUpdateInternal(float deltaTime); 00117 00119 virtual void PostPhysicsUpdateInternal(); 00120 00123 virtual void UpdateHierarchyInternal(); 00124 00125 // 00126 // Members 00127 // 00128 protected: 00130 static const salt::Matrix mIdentityMatrix; 00131 00133 bool mDebugMode; 00134 00136 salt::AABB3 mLocalBoundingBox; 00137 00139 salt::AABB3 mWorldBoundingBox; 00140 }; 00141 00142 DECLARE_CLASS(BaseNode); 00143 00144 } //namespace oxygen 00145 #endif //OXYGEN_BASENODE_H