wall physics

This topic contains 5 replies, has 4 voices, and was last updated by  warmi 7 years, 2 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #30246

    kellogs
    Member

    Hey,

    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 you

    #34217

    Joe Davis
    Member

    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.

    #34218

    kellogs
    Member

    Hey,

    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!

    #34219

    Aaron
    Member

    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.

    Regards,

    Aaron.

    #34220

    kellogs
    Member

    Hi Aaron,

    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.

    Thank !

    #34221

    warmi
    Member

    A node is essentially a spatial transformation – it can have a mesh ( or a camera/light) associated with it but it doesn’t have to.

    Internally POD files are simplistic scene graphs ( which is what most 3d apps use to represent their spatial relations )

Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.