Commit Graph

37 Commits

Author SHA1 Message Date
Robert Osfield
ac9a28051f Fixed the writeNode function so it was properly return FILE_NOT_HANDLED, fixing
a big with it writing out an empty .flt file.
2006-11-07 17:00:29 +00:00
Robert Osfield
d445995432 From Brede Johansen, "Here's a patch discussed in the thread "OpenFlight Loader Discarding
Material" on the osg-user mailing list."
2006-10-06 13:04:48 +00:00
Robert Osfield
392232ec06 From Brede Johansen, "This submission adds multitexture support for detecting translucent
images used to enable alpha blending.

Mesh was syncronized with featureset from Face record."
2006-10-03 09:55:28 +00:00
Robert Osfield
e686a9a4a5 From Brede Johansen, "I think some nitpicking is required. The loop duration was added in
OpenFlight version 15.8.  With the attached changes the flasher unit
on the spinnercar and the character_anim model from the Creator
gallery behaves."
2006-10-03 09:39:03 +00:00
Robert Osfield
02783e1dfd From Paul Martz, Bug fix for sequence node direction, It examines the number of children in the Group record destructor, so that the total duration of the sequence matches the specified loopDuration field. 2006-10-02 15:09:49 +00:00
Robert Osfield
61ce7dd5ac From Brede Johansen, "I have added "billboardCenter" as a reader option to use the center of
a billboard as the pivot point."
2006-10-01 19:09:00 +00:00
Robert Osfield
f03218215d From Colin McDonald, "I have corrected a byte swapping problem in the new OpenFlight
plugin.  It was only reading floats & doubles correctly on little
endian systems, which require byte swapping, and not on big
endian systems which don't require any swapping."
2006-10-01 19:00:39 +00:00
Robert Osfield
d91e1ff4bb From Loic Dachary, renamed _mips to of_mips to prevent compile problem under MIIPS 2006-09-21 09:50:10 +00:00
Robert Osfield
5a08afeb07 From Brede Johansen, "The previous submission didn't handle Objects with transforms. The
attached file corrects this.

I also removed the multitexture macro for the Object record.  Only
Face and Mesh records are valid targets."
2006-09-06 09:46:32 +00:00
Robert Osfield
aab03c3c6d From Brede Johansen, "I have added an optimization to the OpenFlight plugin. By default it
ignores the Object records if it's safe to do so.  The reader option
preserveObject prevents this optimization.

I have also removed the flat shading attribute set by the Object
record.  This flag is only intended for the "Calculate Shading"
operation in Creator."
2006-09-05 08:44:51 +00:00
Robert Osfield
8aceb4eec6 From Vaclav Bilek, "The purpose of this change is to suppress "re-reading" of osg::ProxyNodes
( in OF external references) after the OF file is loaded. The change do
conditional
execution of already existing code.

I use this for optimized preprocessing of large databases what can not
be loaded
in one pass because of memory limits."
2006-08-22 13:07:20 +00:00
Robert Osfield
7b53511251 From Paul Martz, "The gist of this change is, if the OpenFlight version of the
parent file is so old that it doesn't support Light Point palettes or Shader
palettes, then the parent file is not allowed to override those palettes in
the child."
2006-08-14 07:59:28 +00:00
Robert Osfield
25a91d97f0 From Chuck Sembroski, fixes for IRIX 2006-08-13 07:37:55 +00:00
Robert Osfield
5e33e13b34 Added nan dectecion and error reporting 2006-08-09 10:09:11 +00:00
Robert Osfield
bcd4aae4d5 Added TESSELATE_GEOMETRY to Optimizer pass to fix z fighting issues. 2006-08-08 16:08:06 +00:00
Robert Osfield
081b15c84d Fixed backColor implementation for LightPointAppearancePalette. 2006-08-08 11:59:53 +00:00
Robert Osfield
444f561c14 From Paul Martz, "This change causes the new OpenFlight plugin to behave as the
old plugin by returning the database origin latitude/longitude (extracted
from the header record) as userData of the top-level scene graph node."
2006-08-08 11:23:57 +00:00
Robert Osfield
553d017fd9 From Daniel Trstenjak, build fixes for Hpux 11.11, Irix 6.5, Solaris 8 and Aix 2006-08-02 10:43:26 +00:00
Robert Osfield
377c5710fe Added extra initializes 2006-07-19 14:46:40 +00:00
Robert Osfield
61b971ddea Fixed handling of back colour. 2006-07-19 11:25:26 +00:00
Robert Osfield
541433c7be Added share duplicates traversal to optimizer call 2006-07-13 14:58:37 +00:00
Robert Osfield
5e9b7bef88 From Brede Johansen,
"I found some artifacts on some models and traced it back to the
external palette override feature.  There are some changes in the
layout of the external record the loader have to take into
consideration.

The other fix is to remove the OF pools from the user data of the
external ProxyNode when it is no longer needed."
2006-07-12 09:40:03 +00:00
Robert Osfield
5622e0d202 From Brede Johansen, "Changed ">" to ">=" when testing for version 16.1 or later." 2006-07-05 20:56:37 +00:00
Robert Osfield
7c1926118a From Brede Johansen, renaned FLT_preserveFace to preserveFace 2006-07-05 08:55:23 +00:00
Robert Osfield
6c6c131452 From Paul Martz,
"Previously, the new OpenFlight plugin only allowed ext ref models to use
their own palettes. With this change, parent models can override child model
palettes with the parent palettes.

These changes are made against very current CVS (just updated about 1/2 hour
ago, eliminated conflicts, and retested before this posting).

To regurgitate what I did:

A new class, ParentPools (public osg::Referenced), is created when an ext
ref record is parsed, and it is populated with any parent model pools that
should override the child model pools (according to bits in the ext ref
record). The ParentPools object is then set as UserData on the ProxyNode
corresponding to the ext ref.

When the ReadExternalsVisitor hits the ProxyNode, it takes its UserData and
sets it as UserData in the Options parameter to the osgDB::ReadNode call,
which then read the ext ref model. In the course of parsing the Options
string, ReaderWriterFLT also looks at the Options UserData and sets the
parent pools in the Document class accordingly.

When palette records are encountered while loading a file, they are ignored
if the corresponding pool was set by the parent.

Thanks to Brede for consulting with me on the implementation.
"
2006-07-04 19:54:29 +00:00
Robert Osfield
c8aec2a07d Fixed warnings. 2006-07-04 11:24:36 +00:00
Robert Osfield
5e9076ec10 From Brede Johansen, set the default value of texture wrap mode to REPEAT to fix problem
with database without .attr files.
2006-07-03 20:28:26 +00:00
Robert Osfield
e4dea2b8c4 Fixed a couple of warnings. 2006-07-03 16:31:30 +00:00
Robert Osfield
07ac167fa8 Added merge geodes and geometries optimizer call 2006-07-03 10:47:16 +00:00
Robert Osfield
e12c6b7902 Form Brede Johansen, move from istrstream to istringstream.
From Robert Osfield, remapped Paul Martz's changes to Pools.h and PaletteRecords.cpp w.r.t texturePatternIndex being a in16, and converted a char* string to a std::string.
2006-06-29 09:34:41 +00:00
Robert Osfield
2e2684c05a From Paul Martz, added support to textured light points into osgSim and OpenFlight loader, as part of the OpenFlight v16.0 spec. 2006-06-08 14:32:02 +00:00
Robert Osfield
d42a8fd269 From Paul Martz, "This change is based on current CVS. (Note both Brede and I have submitted
changes to this plugin that aren't in current CVS yet -- this change is
based on current CVS, not our changed files.)

This changes how shader palette records are parsed to support GLSL per the
OpenFlight 16.1 spec. Existing functionality for 16.0 files is preserved.

The change to Document.h simply adds an enum for VERSION_16_1."
2006-05-15 13:22:59 +00:00
Robert Osfield
56d4c7a269 From Paul Martz, "add support for the v16.0 "Add" texture environment and "mirrored repeat" wrap mode." 2006-05-15 11:27:07 +00:00
Robert Osfield
fdda54e77e Changed instances of setCoord(const Vec3) to setCoord(const Vec3&) style. 2006-05-15 11:22:08 +00:00
Robert Osfield
132b355d4f From Brede Johansen,
"- Replaced some member attributes with local variables in Face record.
 - Multitexture support in Vertex class.
 - Renamed VertexList to VertexListRecord (VertexList is now a Vertex array)
 - new Mesh (with reserved field at offset 12, thanks to Paul Martz)
 - new LocalVertexPool
 - new MeshPrimitive
 - Use ProxyNode for externals.
 - Local cache for externals"
2006-05-15 11:18:50 +00:00
Robert Osfield
43f0efd6d2 Reorganised the Group::removeChild and Geode::removeDrawable methods so
that removeChild(Node*), removeChild(uint) and equivilant Geode methods are
now inline methods, not designed to be overriden, and seperated out the
multiple remove method to be called removeChildren(uint, uint) which is
now the only virtual method.  There removeChildren is now the method to
override in subclasses.

This reorganisation requires some call code to be rename removeChild usage
to removeChildren.
2006-05-02 09:45:31 +00:00
Robert Osfield
3246dde716 From Brede Johansen, new OpenFlight plugin!!!!!
By default the original flt plugin is still used, to select at runtime
the new plugin set the env OSG_OPEN_FLIGHT_PLUGIN=new
2006-03-08 21:38:37 +00:00