From 12315f4d0e0ae993805f141f64cb8c73c5297311 Mon Sep 17 00:00:00 2001 From: Hans Lambermont Date: Sat, 12 Oct 2002 11:37:38 +0000 Subject: Initial revision --- source/gameengine/SceneGraph/Makefile | 41 ++++ source/gameengine/SceneGraph/SG_Controller.cpp | 49 ++++ source/gameengine/SceneGraph/SG_Controller.h | 116 ++++++++++ source/gameengine/SceneGraph/SG_IObject.cpp | 153 ++++++++++++ source/gameengine/SceneGraph/SG_IObject.h | 220 ++++++++++++++++++ source/gameengine/SceneGraph/SG_Node.cpp | 231 ++++++++++++++++++ source/gameengine/SceneGraph/SG_Node.h | 208 +++++++++++++++++ source/gameengine/SceneGraph/SG_ParentRelation.h | 116 ++++++++++ source/gameengine/SceneGraph/SG_Spatial.cpp | 283 +++++++++++++++++++++++ source/gameengine/SceneGraph/SG_Spatial.h | 205 ++++++++++++++++ 10 files changed, 1622 insertions(+) create mode 100644 source/gameengine/SceneGraph/Makefile create mode 100644 source/gameengine/SceneGraph/SG_Controller.cpp create mode 100644 source/gameengine/SceneGraph/SG_Controller.h create mode 100644 source/gameengine/SceneGraph/SG_IObject.cpp create mode 100644 source/gameengine/SceneGraph/SG_IObject.h create mode 100644 source/gameengine/SceneGraph/SG_Node.cpp create mode 100644 source/gameengine/SceneGraph/SG_Node.h create mode 100644 source/gameengine/SceneGraph/SG_ParentRelation.h create mode 100644 source/gameengine/SceneGraph/SG_Spatial.cpp create mode 100644 source/gameengine/SceneGraph/SG_Spatial.h (limited to 'source/gameengine/SceneGraph') diff --git a/source/gameengine/SceneGraph/Makefile b/source/gameengine/SceneGraph/Makefile new file mode 100644 index 00000000000..bc184c8faba --- /dev/null +++ b/source/gameengine/SceneGraph/Makefile @@ -0,0 +1,41 @@ +# +# $Id$ +# +# ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** +# +# 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 2 +# of the License, or (at your option) any later version. The Blender +# Foundation also sells licenses for use in proprietary software under +# the Blender License. See http://www.blender.org/BL/ for information +# about this. +# +# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. +# All rights reserved. +# +# The Original Code is: all of this file. +# +# Contributor(s): none yet. +# +# ***** END GPL/BL DUAL LICENSE BLOCK ***** +# +# + +LIBNAME = scenegraph +DIR = $(OCGDIR)/gameengine/$(LIBNAME) + +include nan_compile.mk + +CCFLAGS += $(LEVEL_1_CPP_WARNINGS) + +CPPFLAGS += -I$(NAN_MOTO)/include diff --git a/source/gameengine/SceneGraph/SG_Controller.cpp b/source/gameengine/SceneGraph/SG_Controller.cpp new file mode 100644 index 00000000000..4a5735bb4c0 --- /dev/null +++ b/source/gameengine/SceneGraph/SG_Controller.cpp @@ -0,0 +1,49 @@ +/** + * $Id$ + * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * + * 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 2 + * of the License, or (at your option) any later version. The Blender + * Foundation also sells licenses for use in proprietary software under + * the Blender License. See http://www.blender.org/BL/ for information + * about this. + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL/BL DUAL LICENSE BLOCK ***** + */ + +#include "SG_Controller.h" + + + void +SG_Controller:: +SetObject(SG_IObject* obj) +{ + m_pObject = obj; // no checks yet ? +} + + void +SG_Controller:: +ClearObject( +){ + m_pObject = NULL; +} + + diff --git a/source/gameengine/SceneGraph/SG_Controller.h b/source/gameengine/SceneGraph/SG_Controller.h new file mode 100644 index 00000000000..9753af45a99 --- /dev/null +++ b/source/gameengine/SceneGraph/SG_Controller.h @@ -0,0 +1,116 @@ +/** + * Implementationclass to derive controllers from + * + * $Id$ + * + * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * + * 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 2 + * of the License, or (at your option) any later version. The Blender + * Foundation also sells licenses for use in proprietary software under + * the Blender License. See http://www.blender.org/BL/ for information + * about this. + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL/BL DUAL LICENSE BLOCK ***** + */ + +#ifndef __SG_CONTROLLER_H +#define __SG_CONTROLLER_H + + +#include "SG_IObject.h" +class SG_Controller +{ +public: + SG_Controller( + ) : + m_pObject(NULL) { + } + + virtual + ~SG_Controller( + ) {}; + + virtual + bool + Update( + double time + )=0; + + virtual + void + SetObject ( + SG_IObject* object + ); + + void + ClearObject( + ); + + virtual + void + SetSimulatedTime( + double time + )=0; + + virtual + SG_Controller* + GetReplica( + class SG_Node* destnode + )=0; + + /** + * Hacky way of passing options to specific controllers + * @param option An integer identifying the option. + * @param value The value of this option. + * @attention This has been placed here to give sca-elements + * @attention some control over the controllers. This is + * @attention necessary because the identity of the controller + * @attention is lost on the way here. + */ + virtual + void + SetOption( + int option, + int value + )=0; + + /** + * Option-identifiers: SG_CONTR__