How would I detect if a BSP map and the Camera's Hull/elipsoid are colliding?
A simple bool is great.
Map and Camera Hull collision detection.
-
- Posts: 18
- Joined: Fri Sep 11, 2009 4:31 am
Actually, what you need is not that far off from those examples. You load your scene, create triangle selectors for your geometry, and then run collision detection against the triangles from the selectors. Yo could steal the collision code from the ISceneManager::getCollisionResultPosition().
Travis
Travis
-
- Posts: 18
- Joined: Fri Sep 11, 2009 4:31 am
So far I have this:
But I'm a bit confused as to where to get the other parameters.
I simply copied a bunch of those from
I'm also using the Collision example as a base for testing things out.
Code: Select all
smgr->getSceneCollisionManager()->getCollisionResultPosition(selector,camera->getPosition()+core::vector3df(0,30,0),core::vector3df(30,50,30),core::vector3df(0,-10,0));
I simply copied a bunch of those from
Code: Select all
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, camera, core::vector3df(30,50,30),
core::vector3df(0,-10,0),
core::vector3df(0,30,0));
camera->addAnimator(anim);
anim->drop();