Can OGRE's shadow technique interfere with PhysX raycasting?

xius

03-05-2009 15:29:38

Hello, reader!

Using SHADOWTYPE_TEXTURE_MODULATIVE is perfectly ok, but ugly. When trying SHADOWTYPE_STENCIL_ADDITIVE/MODULATIVE, raycasting provided by PhysX can't hit any shape:


SceneManager *mgr = mRoot->createSceneManager(ST_GENERIC, "Default SceneManager");
mgr->setAmbientLight(ColourValue(1.0, 1.0, 1.0));
mgr->setShadowTechnique(SHADOWTYPE_STENCIL_ADDITIVE); // <- there



NxActor * pick(int x, int y) {
letGo();
NxRay ray;
viewUnProject(x, y, 0.0f, ray.orig);
viewUnProject(x, y, 1.0f, ray.dir);
ray.dir -= ray.orig;
ray.dir.normalize();

NxRaycastHit hit;
NxShape* closestShape = PxScene->raycastClosestShape(ray, NX_ALL_SHAPES, hit); // returns NULL O_o
...


I'm not very experienced OGRE, nor PhysX user so that I'm lost now. Is there a certain reason why shadow technique affects raycasting? (or something is rotten in my code?)

betajaen

03-05-2009 16:04:49

Nope, They are absolutely and totally not related what so ever in any possible way.

xius

03-05-2009 16:32:33

Good to know that my instinct is sometimes right. :)

If anyone has any ideas why I'm experiencing this, I'll be glad to know.

kaneyxt

04-05-2009 07:30:27

maybe the ray just can not hit anything... you need to double check the starting point, the max distance, and if there is an object along the ray.
Is there scale difference between your Ogre world and PhysX world? Or take a look at raycasting sample of PhysX SDK first and make sure you are using it in right way.

xius

08-05-2009 13:02:14

kaneyxt: Thanks for ideas. I've tried them... then move to another computer and whoa! Everything works. Seems like there is something broken in my own. :/ Even textures are missplaced... (on other computers are not... and yes, code is the same :)) I think I'm going to reinstall the whole OS. I'm pretty much unable to find out which part is causing this.