UVisualCollisionEntity implementation. More...
#include <visual_collision_entity_user.h>
Inherits NL3D::UVisualCollisionEntity.
Public Member Functions | |
| CVisualCollisionEntityUser (CVisualCollisionManager *manager) | |
| Constructor. create entity. | |
| ~CVisualCollisionEntityUser () | |
| dtor, delete the entity. | |
| virtual bool | snapToGround (CVector &pos) |
| Snap the entity onto the ground. | |
| virtual bool | snapToGround (CVector &pos, CVector &normal) |
| Snap the entity onto the ground. | |
| virtual void | setGroundMode (bool groundMode) |
| If groundMode is true, the entity is snapped on faces with normal.z > 0. | |
| virtual void | setCeilMode (bool ceilMode) |
| If ceilMode is true, the entity is snapped on faces with normal.z < 0. | |
| virtual bool | getGroundMode () const |
| virtual bool | getCeilMode () const |
| virtual void | setSnapToRenderedTesselation (bool snapMode) |
| By default, the visual collision entity is snapped on rendered/geomorphed tesselation (true). | |
| virtual bool | getSnapToRenderedTesselation () const |
| virtual bool | getSurfaceInfo (const CVector &pos, CSurfaceInfo &surfaceInfo) |
| Get surface informations. | |
| virtual bool | getStaticLightSetup (NLMISC::CRGBA sunAmbient, const CVector &pos, std::vector< CPointLightInfluence > &pointLightList, uint8 &sunContribution, NLMISC::CRGBA &localAmbient) |
| Get the static Light Setup, using landscape under us. | |
| virtual void | displayDebugGrid (UDriver &drv) const |
| Draw lines for the landscape quadgrid collision faces under us NB: a drv.setMatrixMode3D() should have been done before. | |
Private Attributes | |
| CVisualCollisionManager * | _Manager |
| CVisualCollisionEntity * | _Entity |
UVisualCollisionEntity implementation.
Definition at line 43 of file visual_collision_entity_user.h.
| NL3D::CVisualCollisionEntityUser::CVisualCollisionEntityUser | ( | CVisualCollisionManager * | manager | ) | [inline] |
Constructor. create entity.
Definition at line 48 of file visual_collision_entity_user.h.
References _Entity, _Manager, and NL3D::CVisualCollisionManager::createEntity().
| NL3D::CVisualCollisionEntityUser::~CVisualCollisionEntityUser | ( | ) | [inline] |
dtor, delete the entity.
Definition at line 54 of file visual_collision_entity_user.h.
References _Entity, _Manager, and NL3D::CVisualCollisionManager::deleteEntity().
| void NL3D::CVisualCollisionEntityUser::displayDebugGrid | ( | UDriver & | drv | ) | const [virtual] |
Draw lines for the landscape quadgrid collision faces under us NB: a drv.setMatrixMode3D() should have been done before.
Implements NL3D::UVisualCollisionEntity.
Definition at line 107 of file visual_collision_entity_user.cpp.
References _Entity, NL3D::CVisualCollisionEntity::displayDebugGrid(), and NL3D::CDriverUser::getDriver().
| bool NL3D::CVisualCollisionEntityUser::getCeilMode | ( | ) | const [virtual] |
Implements NL3D::UVisualCollisionEntity.
Definition at line 77 of file visual_collision_entity_user.cpp.
References _Entity, NL3D::CVisualCollisionEntity::getCeilMode(), and NL3D_HAUTO_UI_VCE.
| bool NL3D::CVisualCollisionEntityUser::getGroundMode | ( | ) | const [virtual] |
Implements NL3D::UVisualCollisionEntity.
Definition at line 71 of file visual_collision_entity_user.cpp.
References _Entity, NL3D::CVisualCollisionEntity::getGroundMode(), and NL3D_HAUTO_UI_VCE.
| bool NL3D::CVisualCollisionEntityUser::getSnapToRenderedTesselation | ( | ) | const [virtual] |
Implements NL3D::UVisualCollisionEntity.
Definition at line 91 of file visual_collision_entity_user.cpp.
References _Entity, NL3D::CVisualCollisionEntity::getSnapToRenderedTesselation(), and NL3D_HAUTO_UI_VCE.
| bool NL3D::CVisualCollisionEntityUser::getStaticLightSetup | ( | NLMISC::CRGBA | sunAmbient, | |
| const CVector & | pos, | |||
| std::vector< CPointLightInfluence > & | pointLightList, | |||
| uint8 & | sunContribution, | |||
| NLMISC::CRGBA & | localAmbient | |||
| ) | [virtual] |
Get the static Light Setup, using landscape under us.
append lights to pointLightList. NB: if find no landscape faces, don't modify pointLightList, set sunContribution=255, and return false Else, use CPatch::TileLightInfluences to get lights, and use CPatch::Lumels to get sunContribution. NB: because CPatch::Lumels encode the gouraud shading on the surface, return lumelValue*2 so the object won't be too darken.
Implements NL3D::UVisualCollisionEntity.
Definition at line 99 of file visual_collision_entity_user.cpp.
References _Entity, NL3D::CVisualCollisionEntity::getStaticLightSetup(), and NL3D_HAUTO_LIGHT_VCE.
| bool NL3D::CVisualCollisionEntityUser::getSurfaceInfo | ( | const CVector & | pos, | |
| CSurfaceInfo & | info | |||
| ) | [virtual] |
Get surface informations.
pos is checked with polygons that are at least (cache dependent) at +- 10m in altitude.
| info | will be filled with surface informations if the method returns true. |
Implements NL3D::UVisualCollisionEntity.
Definition at line 113 of file visual_collision_entity_user.cpp.
References _Entity, and NL3D::CVisualCollisionEntity::getSurfaceInfo().
| void NL3D::CVisualCollisionEntityUser::setCeilMode | ( | bool | ceilMode | ) | [virtual] |
If ceilMode is true, the entity is snapped on faces with normal.z < 0.
Default is false. NB: if both groundMode and ceilMode are false, snapToGround is a no-op.
Implements NL3D::UVisualCollisionEntity.
Definition at line 65 of file visual_collision_entity_user.cpp.
References _Entity, NL3D_HAUTO_UI_VCE, and NL3D::CVisualCollisionEntity::setCeilMode().
| void NL3D::CVisualCollisionEntityUser::setGroundMode | ( | bool | groundMode | ) | [virtual] |
If groundMode is true, the entity is snapped on faces with normal.z > 0.
Default is true. NB: if both groundMode and ceilMode are false, snapToGround is a no-op.
Implements NL3D::UVisualCollisionEntity.
Definition at line 59 of file visual_collision_entity_user.cpp.
References _Entity, NL3D_HAUTO_UI_VCE, and NL3D::CVisualCollisionEntity::setGroundMode().
| void NL3D::CVisualCollisionEntityUser::setSnapToRenderedTesselation | ( | bool | snapMode | ) | [virtual] |
By default, the visual collision entity is snapped on rendered/geomorphed tesselation (true).
Use this method to change this behavior. if false, the entity is snapped to the tile level tesselation according to noise etc...
Implements NL3D::UVisualCollisionEntity.
Definition at line 85 of file visual_collision_entity_user.cpp.
References _Entity, NL3D_HAUTO_UI_VCE, and NL3D::CVisualCollisionEntity::setSnapToRenderedTesselation().
Snap the entity onto the ground.
pos.z is modified so that it lies on the ground, according to rendered landscapes and meshes setuped into the visual collision manager. pos is checked with polygons that are at least (cache dependent) at +- 10m in altitude.
| normal | the ret normal of where it is snapped. NB: if return false, not modified. |
Implements NL3D::UVisualCollisionEntity.
Definition at line 50 of file visual_collision_entity_user.cpp.
References _Entity, NL3D_HAUTO_SNAP_VCE, and NL3D::CVisualCollisionEntity::snapToGround().
Snap the entity onto the ground.
pos.z is modified so that it lies on the ground, according to rendered landscapes and meshes setuped into the visual collision manager. pos is checked with polygons that are at least (cache dependent) at +- 10m in altitude.
Implements NL3D::UVisualCollisionEntity.
Definition at line 44 of file visual_collision_entity_user.cpp.
References _Entity, NL3D_HAUTO_SNAP_VCE, and NL3D::CVisualCollisionEntity::snapToGround().
Definition at line 85 of file visual_collision_entity_user.h.
Referenced by CVisualCollisionEntityUser(), displayDebugGrid(), getCeilMode(), getGroundMode(), getSnapToRenderedTesselation(), getStaticLightSetup(), getSurfaceInfo(), setCeilMode(), setGroundMode(), setSnapToRenderedTesselation(), snapToGround(), and ~CVisualCollisionEntityUser().
Definition at line 84 of file visual_collision_entity_user.h.
Referenced by CVisualCollisionEntityUser(), and ~CVisualCollisionEntityUser().
1.6.1