HLIB 20030825 review
DownloadHLIB is a C++ library for loading 3D world files
|
|
HLIB is a C++ library for loading 3D world files. HLIB is a C++ library intended to facilitate the use of ".MAP" files in
applications. ".MAP" files are produced by the "Valve Hammer Editor" availlable at: http://collective.valve-erc.com/ .
This is the editor used to create Half-Life, Team Fortress Classic, Counter-Strike and Day of Defeat maps. A lot of models are availlable in this format on the internet and the abillity to read such format may greatly help game programmer. HLIB is intended to be portable accross many platforms including: GNU/Linux, All UNIX*S, MS-Windows > 95.
How it works:
HLIB doesn't impose you anything about how the map data will be presented in memory. Instead the library calls the methods of a "builder" object you supplied, to inform your program that some kind of 3D objects has been found in the map file. For instance when the library finds a polygon it calls: BeginPolygon(); then all subsequent method call will refer to this polygon. When there is no more data about the polygon, the library calls: EndPolygon();
A map is made of many entities. Each entity can have many key-value pairs (such as: "classname" "player", which says: this entity is of class player). In addition, an entity can have some brushes. A brush is a convex set of polygons. Each polygon has:
- one texture name
- at least 3 vertex
- one normal per vertex
- one UV coordinate per vertex
Requirements:
PLIB
Installation:
Obviously you have to install PLIB first. (At least SG)
Then run:
$> ./configure
$> make clean
$> make
$> make install
To link against HLIB you can use the hlib-config program:
- hlib-config --cflags, gives the gcc command line options for compiling
- hlib-config --libs, gives the linker command line options
- hlib-config --prefix, gives the current HLIB installation prefix
HLIB 20030825 keywords