Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-05-16 16:54:44 +0400
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-05-16 16:54:44 +0400
commitc50055204df1a73583f646bba688d5f7a76531a8 (patch)
tree07cc15029e144d08f138e7164e5f6d1edc4651d8 /source/gameengine/SceneGraph/SG_Spatial.h
parent3e6b05f60719f3e04e511c9d52a8f27d7ce3a1a4 (diff)
SceneGraph support for bounding boxs
Diffstat (limited to 'source/gameengine/SceneGraph/SG_Spatial.h')
-rw-r--r--source/gameengine/SceneGraph/SG_Spatial.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/source/gameengine/SceneGraph/SG_Spatial.h b/source/gameengine/SceneGraph/SG_Spatial.h
index 9536a4ff940..e029ce51919 100644
--- a/source/gameengine/SceneGraph/SG_Spatial.h
+++ b/source/gameengine/SceneGraph/SG_Spatial.h
@@ -37,10 +37,17 @@
#include <MT_Point3.h>
#include <MT_Matrix3x3.h> // or Quaternion later ?
#include "SG_IObject.h"
+#include "SG_BBox.h"
+
class SG_Node;
class SG_ParentRelation;
+/**
+ * SG_Spatial contains spatial information (local & world position, rotation
+ * and scaling) for a Scene graph node.
+ * It also contains a link to the node's parent.
+ */
class SG_Spatial : public SG_IObject
{
@@ -54,6 +61,8 @@ protected:
MT_Vector3 m_worldScaling;
SG_ParentRelation * m_parent_relation;
+
+ SG_BBox m_bbox;
public:
@@ -167,7 +176,15 @@ public:
void ComputeWorldTransforms( const SG_Spatial *parent);
-
+ /**
+ * Bounding box functions.
+ */
+ SG_BBox& BBox();
+ void SetBBox(SG_BBox & bbox);
+ bool inside(const MT_Point3 &point) const;
+ void getBBox(MT_Point3 *box) const;
+ void getAABBox(MT_Point3 *box) const;
+
protected:
friend class SG_Controller;