Torque3D Documentation / _generateds / T3DSceneClient.h

T3DSceneClient.h

Engine/source/T3D/sceneComponent/T3DSceneClient.h

More...

Classes:

Detailed Description

 1
 2//-----------------------------------------------------------------------------
 3// Copyright (c) 2012 GarageGames, LLC
 4//
 5// Permission is hereby granted, free of charge, to any person obtaining a copy
 6// of this software and associated documentation files (the "Software"), to
 7// deal in the Software without restriction, including without limitation the
 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 9// sell copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21// IN THE SOFTWARE.
22//-----------------------------------------------------------------------------
23
24#ifndef _T3DSCENECLIENT_H_
25#define _T3DSCENECLIENT_H_
26
27#include "component/simComponent.h"
28#include "T3DSceneComponent.h"
29
30class T3DSceneClient : public SimComponent
31{
32   typedef SimComponent Parent;
33
34public:
35   T3DSceneClient()
36   {
37      _nextClient = NULL;
38      _sceneGroup = NULL;
39      _sceneGroupName = NULL;
40      _sceneClientName = NULL;
41   }
42
43   T3DSceneClient * getNextSceneClient() { return _nextClient; }
44   // TODO: internal
45   void setNextSceneClient(T3DSceneClient * client) { _nextClient = client; }
46
47   T3DSceneComponent * getSceneGroup() { return _sceneGroup; }
48
49   StringTableEntry getSceneGroupName() { return _sceneGroupName; }
50   void setSceneGroupName(const char * name);
51
52   StringTableEntry getSceneClientName() { return _sceneClientName; }
53   void setSceneClientName(const char * name) { _sceneClientName = StringTable->insert(name); }
54
55protected:
56
57   bool onComponentRegister(SimComponent * owner);
58   void registerInterfaces(SimComponent * owner);
59
60   T3DSceneClient * _nextClient;
61   T3DSceneComponent * _sceneGroup;
62   StringTableEntry _sceneGroupName;
63   StringTableEntry _sceneClientName;
64};
65
66class T3DSolidSceneClient : public T3DSceneClient, public ISolid3D, public Transform3D::IDirtyListener
67{
68public:
69
70   T3DSolidSceneClient()
71   {
72      _transform = NULL;
73      _objectBox = new ValueWrapperInterface<Box3F>();
74   }
75
76   Box3F getObjectBox() { return _objectBox->get(); }
77   void setObjectBox(const Box3F & box) { _objectBox->set(box); }
78   Box3F getWorldBox();
79   const MatrixF & getTransform();
80   Transform3D * getTransform3D() { return _transform; }
81
82   void OnTransformDirty();
83
84protected:
85
86
87   // TODO: internal
88   void setTransform3D(Transform3D *  transform);
89
90   Transform3D * _transform;
91   ValueWrapperInterface<Box3F> * _objectBox;
92};
93
94#endif // #ifndef _T3DSCENECLIENT_H_
95