Thanks Jason, changes built fine and are now checked into svn/trunk.

Merging these changes reminded me of the scaling problem, and that the
old Quake plugin had the same problem originally, but I vaguely recall
fixing this.  So I've just done a review of the old quake3 bsp code
and found a hacky fix for the scaling in
Q3BSPReader::convertFromBSP(..).  This hack hardwires the scaling to
0.03.

Could it be that the Q3 models are scaled in inches rather than
metres?  Could it be that the Valve models have the same scale?

My inclination is to pull the hacky code out of the the Q3 codepath
and place an optional static MatrixTransform above the whole scene
graph for both the Valve and the Q3 paths.  I the mdl and md2 plugins
would probably also need such a transform too.  We could standardise
of a ReaderWriter::Option string that enables/disables this scaling
across all the plugins to keep things consistent.

Thoughts?
Robert.

On Sat, Dec 20, 2008 at 6:46 AM, Jason Daly <[email protected]> wrote:
>
> Hi, Robert,
>
> I've been busy working on the Source engine plugins.  There are several
> contributions in this submission:
>
> osgDB/FileUtils.cpp:
> Needed this extra code to allow a true case-insensitive search.  This is
> because the HL2 map and model files are often sloppy with case.  For
> example, the file might look for materials/models/alyx/alyx_sheet.vtf, but
> the file is actually in materials/Models/Alyx/alyx_sheet.vtf.  In
> case-insensitive mode, the new code recursively disassembles the path and
> checks each path element without regard to case.  In case-sensitive mode,
> the code behaves exactly as it used to.  The new code is also mostly skipped
> on Windows because of the case-insensitive file system.  Previously, I did
> all of this with custom search code in the .bsp plugin, but this allows the
> user to tailor the search using OSGFILEPATH.  There are some instructions in
> the plugins' README files about this.
>
> osgPlugins/mdl:
> This is a new plug-in for Half-Life 2 models (as opposed to maps).  This
> allows you to load Source models individually, as well as allowing the .bsp
> plugin to load models (props) that are embedded into maps.  Mdl files can
> contain simple object (crates, barrels, bottles), as well as fully
> articulated characters with skeletal animations.  Currently, it can load the
> simple objects.  It can also load the characters, but it can't load the
> skeletons or animations.
>
> osgPlugins/bsp:
> This contains all of the changes needed to load props along with the basic
> map geometry.  There are also
> several bugs fixed.
>
> osgPlugins/vtf:
> This is the loader for Valve's texture format.  Previously, we had agreed to
> put this in with the bsp plugin, but I didn't think of the .mdl plugin at
> that time.  It's conceivable that a user might want to load models
> individually (not as part of a map), so the vtf reader does have to be
> separate.  I also fixed a rather significant bug.
>
> I tested all of this code on RHEL 5.2 (32-bit), and Fedora 9 (64-bit).  I'll
> be testing on Windows soon.
>
> I also attached a simple .mdl file, along with it's associated files and
> textures.  Just extract the tarball into it's own directory, set your
> OSGFILEPATH to point at that directory, and load the model like this:
>
>  osgviewer models/props_junk/gascan001a.mdl
>
> Please let me know if you have any problems with any of these.
>
> --"J"
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to