Merge branch 'main/atys-live' into ryzom/ark-features
[ryzomcore.git] / nel / samples / pacs / object.h
bloba380c70284ae35ec2316ffd65d06b3a2c622a346
1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef NL_OBJECT_H
18 #define NL_OBJECT_H
20 #include "nel/misc/types_nl.h"
21 #include "nel/misc/vector.h"
22 #include "nel/misc/vectord.h"
23 #include "nel/pacs/u_move_primitive.h"
24 #include "nel/pacs/u_global_position.h"
25 #include "nel/3d/u_instance.h"
27 // External classes
29 namespace NLNET
31 class CPacsClient;
34 namespace NLPACS
36 class UMoveContainer;
37 class UMovePrimitive;
38 class UGlobalPosition;
41 namespace NL3D
43 class UScene;
46 /**
47 * object for the test
49 * \author Cyril 'Hulud' Corvazier
50 * \author Nevrax France
51 * \date 2001
53 class CObjectDyn
55 public:
57 /// Box constructor
58 CObjectDyn (double width, double depth, double height, double orientation, const NLMISC::CVectorD& pos,
59 const NLMISC::CVectorD& speed, bool obstacle, NLPACS::UMoveContainer &container, NL3D::UScene &scene,
60 NLPACS::UMovePrimitive::TReaction reaction, NLPACS::UMovePrimitive::TTrigger trigger,
61 uint8 worldImage, uint8 nbImage, uint8 insertWorldImage);
63 /// Cylinder constructor
64 CObjectDyn (double radius, double height, const NLMISC::CVectorD& pos, const NLMISC::CVectorD& speed,
65 bool obstacle, NLPACS::UMoveContainer &container, NL3D::UScene &scene,
66 NLPACS::UMovePrimitive::TReaction reaction, NLPACS::UMovePrimitive::TTrigger trigger,
67 uint8 worldImage, uint8 nbImage, uint8 insertWorldImage);
69 /// Set position
70 void setPos (const NLMISC::CVectorD& pos);
71 void setGlobalPos (NLPACS::UGlobalPosition& gpos, NLMISC::CVectorD& pos, uint8 worldimage);
73 /// Set position
74 void setSpeed (const NLMISC::CVectorD& speed);
76 /// Set position
77 const NLMISC::CVectorD& getPos () const
79 return _Position;
82 /// Set position
83 const NLMISC::CVectorD& getSpeed () const
85 return _Speed;
88 /// Simulate
89 void tryMove (double deltaTime, NLPACS::UMoveContainer &container, uint8 worldImage);
90 void doMove (double deltaTime, uint8 worldImage);
92 /// Remove object from container
93 void remove (NLPACS::UMoveContainer &container, NL3D::UScene &scene);
95 bool Freezed;
97 private:
99 bool _TryMove;
100 NLMISC::CVectorD _Position;
101 NLMISC::CVectorD _TryPosition;
102 NLMISC::CVectorD _Speed;
103 NLPACS::UMovePrimitive *_MovePrimitive;
104 NL3D::UInstance _Instance;
108 #endif // NL_OBJECT_H
110 /* End of object.h */