1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
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.
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/>.
19 #include "nel/3d/shape.h"
20 #include "nel/3d/transform_shape.h"
21 #include "nel/3d/scene.h"
26 using namespace NLMISC
;
36 // ***************************************************************************
37 // ***************************************************************************
39 // ***************************************************************************
40 // ***************************************************************************
43 // ***************************************************************************
44 CTransformShape
*IShape::createInstance(CScene
&scene
)
46 CTransformShape
*mo
= (CTransformShape
*)scene
.createModel(NL3D::TransformShapeId
);
52 // ***************************************************************************
55 /* ***********************************************
56 * WARNING: This Class/Method must be thread-safe (ctor/dtor/serial): no static access for instance
57 * It can be loaded/called through CAsyncFileManager for instance
58 * ***********************************************/
64 // ***************************************************************************
65 void IShape::setDistMax(float distMax
)
68 // normalize infinite setup.
74 // ***************************************************************************
75 void IShape::getAABBox(CAABBox
&bbox
) const
77 bbox
.setCenter(CVector::Null
);
78 bbox
.setHalfSize(CVector::Null
);
82 // ***************************************************************************
83 // ***************************************************************************
85 // ***************************************************************************
86 // ***************************************************************************
89 // ***************************************************************************
90 CShapeStream::CShapeStream ()
96 // ***************************************************************************
97 CShapeStream::CShapeStream (IShape
* shape
)
100 setShapePointer (shape
);
104 // ***************************************************************************
105 void CShapeStream::setShapePointer (IShape
* shape
)
111 // ***************************************************************************
112 IShape
* CShapeStream::getShapePointer () const
118 // ***************************************************************************
119 void CShapeStream::serial(NLMISC::IStream
&f
)
121 // First, serial an header or checking if it is correct
122 f
.serialCheck (NELID("PAHS"));
124 // Then, serial the shape
125 f
.serialPolyPtr (_Shape
);