13#include <unordered_map>
26 Ogre::Vector3 position;
28 float closest_distance;
42 unsigned int ref_count;
44 Ogre::Vector3* vertices;
46 Ogre::uint32* indices;
48 SMeshData() : ref_count(0), vertex_count(0), vertices(
nullptr), index_count(0), indices(
nullptr)
64 ECollisionType CollisionType;
71 Ogre::AxisAlignedBox Box;
76 void remove_static_data()
88 std::vector<SCollidableEntity> m_Entities;
89 std::unordered_map<const Ogre::Mesh*, SMeshData> m_MeshesData;
97 void register_entity(Ogre::Entity* Entity, ECollisionType CollisionType = COLLISION_ACCURATE);
100 void register_static_entity(Ogre::Entity* Entity,
const Ogre::Vector3& position,
const Ogre::Quaternion orientation,
const Ogre::Vector3 scale, ECollisionType CollisionType = COLLISION_ACCURATE);
103 void remove_entity(Ogre::Entity* Entity);
112 SCheckCollisionAnswer check_ray_collision(
const Ogre::Ray &ray,
const Ogre::uint32 queryMask = 0xFFFFFFFF,
void* ignore =
nullptr, Ogre::Real maxDistance = 0xffff,
bool stopOnFirstPositive =
false);
122 SCheckCollisionAnswer check_ray_collision(
const Ogre::Vector3& fromPoint,
const Ogre::Vector3& toPoint,
const float collisionRadius = 1.0f,
123 const float rayHeightLevel = 0.0f,
const Ogre::uint32 queryMask = 0xFFFFFFFF,
void* ignore =
nullptr,
bool stopOnFirstPositive =
false);
132 typedef std::pair<const SCollidableEntity*, Ogre::Real> RayQueryEntry;
133 std::list<RayQueryEntry> get_basic_ray_query_entities_list(
const Ogre::Ray &ray,
const Ogre::uint32 queryMask = 0xFFFFFFFF,
134 void* ignore =
nullptr, Ogre::Real maxDistance = 0xffff,
bool stopOnFirstPositive =
false);
137 friend bool compare_query_distance (
const CollisionTools::RayQueryEntry& first,
const CollisionTools::RayQueryEntry& second);
141 void add_mesh_data(
const Ogre::Mesh* mesh);
144 void remove_mesh_data(
const Ogre::Mesh* mesh);
148 void get_mesh_info(
const Ogre::Mesh* mesh,
149 size_t &vertex_count,
150 Ogre::Vector3* &vertices,
152 Ogre::uint32* &indices);