#include <visual_collision_manager_user.h>
Inheritance diagram for NL3D::CVisualCollisionManagerUser:
Nevrax France
Definition at line 48 of file visual_collision_manager_user.h.
Public Member Functions | |
virtual uint | addMeshCollision (const std::vector< CVector > &vertices, const std::vector< uint16 > &triangles) |
virtual UVisualCollisionEntity * | createEntity () |
CVisualCollisionManagerUser () | |
Constructor. | |
virtual void | deleteEntity (UVisualCollisionEntity *entity) |
virtual float | getCameraCollision (const CVector &start, const CVector &end, float radius, bool cone) |
virtual void | removeMeshCollision (uint id) |
virtual void | setLandscape (ULandscape *landscape) |
virtual void | setSunContributionPower (float power, float maxThreshold) |
Protected Types | |
typedef CPtrSet< CVisualCollisionEntityUser > | TVisualCollisionEntitySet |
Protected Attributes | |
TVisualCollisionEntitySet | _Entities |
CVisualCollisionManager | _Manager |
|
Definition at line 103 of file visual_collision_manager_user.h. |
|
Constructor.
Definition at line 53 of file visual_collision_manager_user.h. References NL3D_MEM_VISUAL_COLLISION.
00054 { 00055 NL3D_MEM_VISUAL_COLLISION 00056 } |
|
Add a Mesh to the collision manager. For now it is used only for Camera Collision number of vertices and number of triangles must not exceed 65535
Implements NL3D::UVisualCollisionManager. Definition at line 89 of file visual_collision_manager_user.h. References NL3D::CVisualCollisionManager::addMeshCollision(), NL3D_MEM_CAMERA_COLLISION, and uint.
00090 { 00091 NL3D_MEM_CAMERA_COLLISION 00092 return _Manager.addMeshCollision(vertices, triangles); 00093 } |
|
create an entity. NB: CVisualCollisionManager owns this ptr, and you must delete it with deleteEntity(). NB: all CVisualCollisionEntity are deleted when this manager is deleted. Implements NL3D::UVisualCollisionManager. Definition at line 65 of file visual_collision_manager_user.h. References _Entities, NL3D::CPtrSet< T >::insert(), and NL3D_MEM_VISUAL_COLLISION.
00066 { 00067 NL3D_MEM_VISUAL_COLLISION 00068 return _Entities.insert(new CVisualCollisionEntityUser(&_Manager)); 00069 } |
|
delete an entity. Implements NL3D::UVisualCollisionManager. Definition at line 71 of file visual_collision_manager_user.h. References _Entities, NL3D::CPtrSet< T >::erase(), and NL3D_MEM_VISUAL_COLLISION.
00072 { 00073 NL3D_MEM_VISUAL_COLLISION 00074 _Entities.erase(dynamic_cast<CVisualCollisionEntityUser*>(entity)); 00075 } |
|
Get Typical Camera 3rd person collision. For landscape, it is done only against TileFaces (ie only under approx 50 m) return a [0,1] value. 0 => collision at start. 1 => no collision.
Implements NL3D::UVisualCollisionManager. Definition at line 83 of file visual_collision_manager_user.h. References NL3D::CVisualCollisionManager::getCameraCollision(), and NL3D_MEM_CAMERA_COLLISION.
00084 { 00085 NL3D_MEM_CAMERA_COLLISION 00086 return _Manager.getCameraCollision (start, end, radius, cone); 00087 } |
|
Remove a Mesh from the collision manager. Implements NL3D::UVisualCollisionManager. Definition at line 95 of file visual_collision_manager_user.h. References NL3D_MEM_CAMERA_COLLISION, NL3D::CVisualCollisionManager::removeMeshCollision(), and uint.
00096 { 00097 NL3D_MEM_CAMERA_COLLISION 00098 _Manager.removeMeshCollision(id); 00099 } |
|
setup the landscape used for this collision manager. ptr is kept, and manager must be cleared when the landscape is deleted. Implements NL3D::UVisualCollisionManager. Definition at line 59 of file visual_collision_manager_user.h. References NL3D_MEM_VISUAL_COLLISION, and NL3D::CVisualCollisionManager::setLandscape().
00060 { 00061 NL3D_MEM_VISUAL_COLLISION 00062 _Manager.setLandscape(&(dynamic_cast<CLandscapeUser*>(landscape)->getLandscape()->Landscape)); 00063 } |
|
Build a lighting table to remap sun contribution from landscape to sun contribution for objects. The value remap the landscape sun contribution (0 ~ 1) to an object sun contribution (0 ~1) using the following formula: objectSunContribution = min ( powf ( landscapeSunContribution / maxThreshold, power ), 1 ); Default is 0.5 (=> sqrt) for power and 0.5 for maxThreshold. Implements NL3D::UVisualCollisionManager. Definition at line 77 of file visual_collision_manager_user.h. References NL3D_MEM_VISUAL_COLLISION, and NL3D::CVisualCollisionManager::setSunContributionPower().
00078 { 00079 NL3D_MEM_VISUAL_COLLISION 00080 _Manager.setSunContributionPower (power, maxThreshold); 00081 } |
|
Definition at line 104 of file visual_collision_manager_user.h. Referenced by createEntity(), and deleteEntity(). |
|
Definition at line 102 of file visual_collision_manager_user.h. |