~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/gameengine/SceneGraph/SG_Spatial.h

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 * $Id: SG_Spatial.h,v 1.7 2004/03/22 22:02:17 jesterking Exp $
 
2
 * $Id: SG_Spatial.h,v 1.10 2004/05/26 12:06:41 kester Exp $
3
3
 *
4
4
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
5
5
 *
37
37
#include <MT_Point3.h>
38
38
#include <MT_Matrix3x3.h> // or Quaternion later ?
39
39
#include "SG_IObject.h"
 
40
#include "SG_BBox.h"
 
41
 
40
42
 
41
43
class SG_Node;
42
44
class SG_ParentRelation;
43
45
 
 
46
/**
 
47
 * SG_Spatial contains spatial information (local & world position, rotation 
 
48
 * and scaling) for a Scene graph node.
 
49
 * It also contains a link to the node's parent.
 
50
 */
44
51
class SG_Spatial : public SG_IObject
45
52
{
46
53
 
47
54
protected:
48
55
        MT_Point3               m_localPosition;
49
 
        MT_Matrix3x3    m_localRotation;
 
56
        MT_Matrix3x3            m_localRotation;
50
57
        MT_Vector3              m_localScaling;
51
58
 
52
59
        MT_Point3               m_worldPosition;
53
 
        MT_Matrix3x3    m_worldRotation;
 
60
        MT_Matrix3x3            m_worldRotation;
54
61
        MT_Vector3              m_worldScaling;
55
62
        
56
 
        SG_ParentRelation * m_parent_relation;
 
63
        SG_ParentRelation *     m_parent_relation;
 
64
        
 
65
        SG_BBox                 m_bbox;
 
66
        MT_Scalar               m_radius;
 
67
        
57
68
 
58
69
public:
59
70
 
164
175
        GetWorldScaling(
165
176
        ) const ;
166
177
 
167
 
 
168
 
        void    ComputeWorldTransforms(         const SG_Spatial *parent);
169
 
 
 
178
        MT_Transform GetWorldTransform() const;
 
179
 
 
180
        bool    ComputeWorldTransforms(         const SG_Spatial *parent);
 
181
 
 
182
        /**
 
183
         * Bounding box functions.
 
184
         */
 
185
        SG_BBox& BBox();
 
186
        void SetBBox(SG_BBox & bbox);
 
187
        bool inside(const MT_Point3 &point) const;
 
188
        void getBBox(MT_Point3 *box) const;
 
189
        void getAABBox(MT_Point3 *box) const;
 
190
        
 
191
        MT_Scalar Radius() const { return m_radius; }
 
192
        void SetRadius(MT_Scalar radius) { m_radius = radius; }
170
193
        
171
194
protected:
172
195
        friend class SG_Controller;
194
217
         * any controllers to update this object. 
195
218
         */ 
196
219
 
197
 
                void 
 
220
                bool 
198
221
        UpdateSpatialData(
199
222
                const SG_Spatial *parent,
200
223
                double time