- August 13, 2010 at 1:27 pm #30246
does PowerVR SDK has anything I should be looking at regarding wall physics ? What I need is to make the camera not to cross any surfaces.
thank youAugust 13, 2010 at 2:45 pm #34217
The primary purpose of the SDK is to assist development of 3D graphics. For this reason, there are very few examples in the SDK that go beyond this scope.
The best way to solve this issue would be to introduce collision detection in your application for this case, either by coding this behaviour yourself or using an existing physics engine. There are a number of free (e.g. Bullet) and commercial physics engines that can help you solve this problem as well as more complex physics your application may require.August 15, 2010 at 3:27 pm #34218
I can understand that, but however, I have found this little helper function in pvrtmisc.h which seems to be the main thing I am in need of. Function is PVRTMiscCalculateIntersectionLinePlane.
Now all there needs to be done is test if the returned intersection point is inside any triange from the plane in discussion that is present in my .pod file. I can foresee a big FPS drop if I were to test this for each plane in my 3d model and for each triangle in those planes.
Correct me if I am mistaken please (my models are huge building interiors). If nothing to correct, then I have a question – how do I label each triangle so that I can split my model in sectors, and only have a smaller working set to test for camera-wall collisions ?
Maybe using the SPODNode::pszName ?
Thanks again!August 16, 2010 at 9:31 am #34219
I should imagine that to optimise (ie cut down the number of line/plane tests) you would want to generate a bounding box for each object (node), then generate a quad- or oct-tree. Or alternatively if all this geometry is static (or perhaps even if it isn’t) you could use a BSP tree. That’s certainly not a complete list, there are lots of options here.
Aaron.August 16, 2010 at 11:54 am #34220
this is what I have been researching too, but I do not have any idea of how to bind the “bounding spheres” to various objects / meshes in my design. Should I include these bounding spheres as information in the 3d design ? If it is not possible with .pod, then how do I go about this one ?
Also, I thought the equivalence was: objects = meshes and vertices = nodes. Did I get it wrong and in fact an object is the same thing as a node ?
As for the octrees – there are some implementations on the net and are probably the most straightforward to use. Could I use perhaps bounding spheres together with octrees ? Being on OGLES, all the speed is needed.