[osg-users] Advice requested: Is OSG what I need for my project?

Scott Schultz prvteye at yahoo.com
Wed Sep 5 10:55:34 PDT 2018


;tldr version:

Given a start point and end point, can OSG give me a list of collisions with geometry along the specified line segment?

Longer use-case explanation:

I have a serialized scene graph from a defunct online game client. The game assets have been repurposed into a XMPP chat program that uses the old game client as a front-end and the XMPP server to transmit specialized protocol information between clients to handle the motion of the 3D game avatars. (In short, this is not a game emulator, per se; it's a chat client with a fancy front-end.)

I am working on what amounts to a chat-bot that controls one of these 3D avatars as if it was a player. The upshot of it is that for the computer-controlled avatar to move freely around the 3D environment rather than moving strictly "on rails", it needs to know the "shape" of that environment and/or a pathing database of 'safe' places to move around in.

The format of the serialized scene graph is known, which means it can be de-serialized, and the actual geometry doesn't matter to the bot because it can't "see" it. All it cares about is the bounds of the objects in the scene graph, and those bounding boxes/spheres are decipherable from the game asset files. The human end-users live in Paragon City, but for all practical purposes, the bot lives in Boxtown or Sphereville.

Which leads to my reason for posting here - My ultimate interest is in using the scene graph for predicting collisions between the bot avatar and the surrounding geometry. The various examples and web pages about OSG range in age from recent to quite old and in the end, I'm still confused about whether I can use current versions of OSG to do simple line segment/raycasting collision tests or whether I need a separate piece of software like ODE to get that functionality.

Aside from the bot "feeling" the terrain, one other feature of the serialized scene graph is a list of beacons and "spawn points" that were used by the original game and that essentially represent known waypoints that could be used to create a graph suitable for a path-finding algorithm. Creating such a graph, though, would mean brute-force testing of EVERY segment between those waypoints and then disposing of those edges that collide with objects in the scene. (Fortunately, this only needs to be done once per map, after which the saved graph could be used by a bot without knowing anything at all about the geometry.)

Both use cases require some way to specify a line segment or ray and return a list of potential collisions given the current position and facing of the bot's avatar. As I mentioned, googling around for this information produces conflicting info and examples, depending upon the age of the sources. Rather than guess what's what, I figured I'd just ask the people who are currently using the software.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74671#74671







More information about the osg-users mailing list