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/visual_collision_entity_user.h"
20 #include "nel/3d/driver_user.h"
21 #include "nel/misc/hierarchical_timer.h"
30 H_AUTO_DECL( NL3D_UI_VisualCollisionEntity
)
31 H_AUTO_DECL( NL3D_Misc_VisualCollisionEntity_Snap
)
32 H_AUTO_DECL( NL3D_Misc_VisualCollisionEntity_GetLight
)
34 #define NL3D_HAUTO_UI_VCE H_AUTO_USE( NL3D_UI_VisualCollisionEntity )
35 #define NL3D_HAUTO_SNAP_VCE H_AUTO_USE( NL3D_Misc_VisualCollisionEntity_Snap )
36 #define NL3D_HAUTO_LIGHT_VCE H_AUTO_USE( NL3D_Misc_VisualCollisionEntity_GetLight )
39 // ****************************************************************************
40 bool CVisualCollisionEntityUser::snapToGround(CVector
&pos
)
44 return _Entity
->snapToGround(pos
);
46 bool CVisualCollisionEntityUser::snapToGround(CVector
&pos
, CVector
&normal
)
50 return _Entity
->snapToGround(pos
, normal
);
55 void CVisualCollisionEntityUser::setGroundMode(bool groundMode
)
59 _Entity
->setGroundMode(groundMode
);
61 void CVisualCollisionEntityUser::setCeilMode(bool ceilMode
)
65 _Entity
->setCeilMode(ceilMode
);
67 bool CVisualCollisionEntityUser::getGroundMode() const
71 return _Entity
->getGroundMode();
73 bool CVisualCollisionEntityUser::getCeilMode() const
77 return _Entity
->getCeilMode();
81 void CVisualCollisionEntityUser::setSnapToRenderedTesselation(bool snapMode
)
85 _Entity
->setSnapToRenderedTesselation(snapMode
);
87 bool CVisualCollisionEntityUser::getSnapToRenderedTesselation() const
91 return _Entity
->getSnapToRenderedTesselation();
95 bool CVisualCollisionEntityUser::getStaticLightSetup(NLMISC::CRGBA sunAmbient
, const CVector
&pos
, std::vector
<CPointLightInfluence
> &pointLightList
,
96 uint8
&sunContribution
, NLMISC::CRGBA
&localAmbient
)
100 return _Entity
->getStaticLightSetup(sunAmbient
, pos
, pointLightList
, sunContribution
, localAmbient
);
103 void CVisualCollisionEntityUser::displayDebugGrid(UDriver
&drv
) const
105 CDriverUser
&drvUser
= static_cast<CDriverUser
&>(drv
);
106 _Entity
->displayDebugGrid(*drvUser
.getDriver());
109 bool CVisualCollisionEntityUser::getSurfaceInfo(const CVector
&pos
, CSurfaceInfo
&surfaceInfo
)
111 return _Entity
->getSurfaceInfo (pos
, surfaceInfo
);