Commit Graph

2306 Commits

Author SHA1 Message Date
Tim Moore
3e40d624a8 Effects for models
Basically working, at last. Among other things, create effects in
 models loaded directly from .ac files; this can happen, for example,
with the random models from the materials library.
2009-11-13 22:41:11 +01:00
Tim Moore
63ce675914 Splicing visitor for rewriting scene graphs with a minimum of copying 2009-11-13 22:41:11 +01:00
Tim Moore
14e5e87a4d Dump texture attributes of StateSet into effect property tree
Also, decode blend function.
2009-11-13 22:41:11 +01:00
Tim Moore
e7e81c6639 getStateAttribute utility function
This provides a concise, typesafe way to get attributes from osg::StateSet.

Also, blew away BackRefInserter.
2009-11-13 22:41:11 +01:00
Tim Moore
23d0601d82 Add support for blend functions and alpha test functions in effects 2009-11-13 22:41:11 +01:00
Tim Moore
6db9138eeb wip for effects in models
multi-index for effect attributes
2009-11-13 22:41:10 +01:00
Tim Moore
6a7c200002 remove CopyPolicy from ModelRegistry
Put the responsibility for copying a loaded model directly in
SGReaderWriterXML.
2009-11-13 22:41:10 +01:00
Tim Moore
a25e859fa7 fix typo 2009-11-10 22:10:57 +01:00
Tim Moore
4e2eb2f24c Move propertyExpression code from flightgear to simgear
Also add a function (possibly redundant) to access the global property
root.
2009-11-09 15:53:10 +01:00
Tim Moore
b905f4b8aa Property system optimizations
Profiling startup with the new effects code exposed some performance
gotchas. The objective is to reduce allocation of std::string
temporaries, especially when looking up node path names. Also, I
changed some paths to initialize strings with strings instead of char *;
this causes less allocation, at least with glibc. Also, eliminate
the old version of find_node and its helper functions by writing the
template version of find_node_aux to handle an explicit index
parameter.

Also, add const char[] as an internal property type

This doesn't actually add a new type to the property system, but allows using
character arrays as arguments to certain templates.
2009-11-09 15:52:54 +01:00
Tim Moore
ecd0a53412 Add writeLocalData functions for internal scenegraph classes
This makes the scenegraph dump more complete and therefore more useful.
2009-09-22 12:56:28 +02:00
Tim Moore
3456434e37 check for null effect in EffectCullVisitor
An EffectGeode might not have any effect.
2009-09-18 15:43:46 +02:00
Tim Moore
454c5b1ed2 Merge branch 'tat/configure' into next 2009-09-17 12:25:19 +02:00
torsten
dc2c437a1a Tatsuhiro Nishioka:
Patches for configure.ac and Makefile.am files in FG/SG so Mac developers can build these in a unix way.
These also enables Mac developers to choose either PLIB framework or PLIB static libs.
2009-09-17 12:24:56 +02:00
Tim Moore
819d3f5ded Merge branch 'topic/projection' into next 2009-09-17 12:22:06 +02:00
frohlich
4f802689f2 Correct finite precision issues.
Use consistent function names.
Implement changes consistently over the different vector sizes.

Modified Files:
	SGVec2.hxx SGVec3.hxx SGVec4.hxx
2009-09-17 12:21:42 +02:00
Tim Moore
9cbbe55598 Merge branch 'frohlich/weak' into next 2009-09-17 12:18:33 +02:00
frohlich
7e2dafdcb8 Make the weak pointer work. Some bits were left when importing.
Modified Files:
	SGSharedPtr.hxx SGWeakPtr.hxx
2009-09-17 12:18:07 +02:00
jmt
c7873d68f7 Logging:less verbose sound loading. 2009-09-17 12:13:47 +02:00
jmt
939ec526a8 Logging: quiet down STG parsing. 2009-09-17 12:13:47 +02:00
jmt
b20a635db0 Logging: quiet down model/image loading policy. 2009-09-17 12:13:47 +02:00
jmt
a656bee0df Logging: quiet the BVH building policy. 2009-09-17 12:13:47 +02:00
jmt
42f07e3f14 Logging: quiet material loading. 2009-09-17 12:13:47 +02:00
jmt
5803b05bd5 Logging - downgrade play/stop messages to debug. 2009-09-17 12:13:47 +02:00
John Denker
ccf0ba50c4 Implement vector _projection_ functions. 2009-09-09 23:28:16 +02:00
John Denker
f3bc977d32 Make "repeat" start slower on pick-animation mouse events;
otherwise it is unusable.
2009-09-09 22:54:13 +02:00
ehofman
80609e0816 Dont execute code in case the soundmanager isn't properly initialized 2009-09-09 08:39:56 +02:00
frohlich
795d481ca6 Switch to new vector conversion functions.
Modified Files:
	simgear/math/SGGeod.cxx simgear/math/SGQuat.hxx
	simgear/math/SGVec2.hxx simgear/math/SGVec3.hxx
	simgear/math/SGVec4.hxx simgear/scene/material/Effect.cxx
	simgear/scene/model/SGInteractionAnimation.cxx
	simgear/scene/model/SGMaterialAnimation.cxx
	simgear/scene/model/SGRotateTransform.cxx
	simgear/scene/model/SGScaleTransform.cxx
	simgear/scene/model/SGTranslateTransform.cxx
	simgear/scene/model/animation.cxx
	simgear/scene/model/particles.cxx
	simgear/scene/model/placement.cxx
	simgear/scene/model/shadanim.cxx
	simgear/scene/sky/CloudShaderGeometry.cxx
	simgear/scene/sky/cloud.cxx simgear/scene/sky/cloudfield.cxx
	simgear/scene/sky/dome.cxx simgear/scene/sky/sky.cxx
	simgear/scene/tgdb/GroundLightManager.cxx
	simgear/scene/tgdb/SGOceanTile.cxx
	simgear/scene/tgdb/SGTexturedTriangleBin.hxx
	simgear/scene/tgdb/SGVasiDrawable.cxx
	simgear/scene/tgdb/TreeBin.cxx simgear/scene/tgdb/obj.cxx
 	simgear/scene/tgdb/pt_lights.cxx
	simgear/scene/util/SGUpdateVisitor.hxx
2009-09-09 08:39:55 +02:00
frohlich
1b936b9af8 Fix problem with ocean files not recognized as water.
Move dynamic casts to EffectGeode into the findMaterial method.

Modified Files:
	simgear/scene/material/matlib.cxx
	simgear/scene/material/matlib.hxx
	simgear/scene/model/BoundingVolumeBuildVisitor.hxx
2009-09-09 08:39:55 +02:00
frohlich
f141cc28b0 Add some comments.
Make sure floating point constants do not introduce useless upcasts.
Remove now unused and not really usefull method.

Modified Files:
	simgear/math/SGQuat.hxx
2009-09-05 17:01:58 +02:00
ehofman
4cb64b58be Also install coremag.hxx since it is being used by JSBSim now 2009-09-05 17:01:58 +02:00
frohlich
028af34d3d Remove unused member.
Modified Files:
	simgear/scene/util/SGSceneFeatures.hxx
2009-09-05 17:01:58 +02:00
frohlich
ce54997be5 Should be now more easy to make use of SGMath without having osg.
Modified Files:
	simgear/scene/sky/dome.cxx simgear/math/SGGeod.cxx
	simgear/math/SGGeod.hxx simgear/math/SGQuat.hxx
	simgear/math/SGVec2.hxx simgear/math/SGVec3.hxx
	simgear/math/SGVec4.hxx
2009-09-05 17:01:58 +02:00
frohlich
3d213fa713 Return a osg::Vec value instead of a non const reference.
Modified Files:
 	scene/model/SGMaterialAnimation.cxx
2009-09-05 17:01:58 +02:00
frohlich
e71f3790ce Avoid the non const SGVec*::osg() method.
Modified Files:
 	SGTranslateTransform.cxx SGScaleTransform.cxx
 	SGRotateTransform.cxx
2009-09-05 17:01:58 +02:00
frohlich
67b9cba4d3 Use const refs for const data.
Modified Files:
 	simgear/scene/model/CheckSceneryVisitor.hxx
	simgear/scene/model/CheckSceneryVisitor.cxx
2009-09-05 17:01:58 +02:00
torsten
78a471f684 Spare one node in the scenegraph if there is no <offsets> 2009-09-02 23:43:13 +02:00
timoore
d4289c5d54 Change trees code to use a faster OpenGL path
The (random) dimensions of a large number of trees is stored in an
array shared by all the tree geodes. The coordinates of the origin of
each tree are replicated in an another array. This allows an entire
block of trees to be rendered with a few OpenGL calls, instead of one
function call per tree.
2009-08-25 16:14:13 +02:00
torsten
0c17c5440a support osgText in models 2009-08-25 09:11:27 +02:00
torsten
c4116da564 support osgText in models. See docs/README.osgtext for details 2009-08-25 09:11:27 +02:00
torsten
d0821953bb Don't load materials without a name 2009-08-23 21:37:03 +02:00
torsten
e782adef94 Avoid NAN due to floating point rounding errors 2009-08-23 21:37:03 +02:00
ehofman
d3572c2562 prevent division by zero 2009-08-23 21:37:03 +02:00
torsten
1f3838b155 Alan Teeder: fix incomplete dbg_printf for non-gcc. 2009-08-23 21:37:03 +02:00
torsten
6aa459073e don't build tabbed_value_test, swap_test, openal_test1 and openal_test2 by default. 2009-08-23 21:37:03 +02:00
torsten
0932c33185 warning fix: unused variables 2009-08-23 21:37:03 +02:00
torsten
5e542aa841 extinguish many warnings (at least for gcc) 2009-08-23 21:37:03 +02:00
torsten
6d53abd5af warning fix: initializing members in the order they are declared keeps gcc happy 2009-08-23 21:37:03 +02:00
torsten
3ea58bf8db warning fixes 2009-08-23 21:37:03 +02:00
torsten
71a4c2c3d2 extinguish many warnings (at least for gcc) 2009-08-23 21:37:03 +02:00