Hi, On Thu, 2009-03-12 at 15:03 -0500, Patrick Hartling wrote: > Allen Bierbaum wrote: > > What is PrimeMaterial? > > > > I have some old code that is not compiling now because I try to do: > > > > OSG::ChuckMaterialMTRecPtr material = OSG::getDefaultMaterial(); > > > > Evidently getDefaultMaterial now returns a PrimeMaterial*
Yes but before it returned a Material *, so that piece of code should have never compiled it either form, there is a cast missing. > > What is it > > I don't know the answer to the above questions, but ... > > > and can I store it as a ChunkMaterial? the complement to a composite material. The difference is that the prime material is what can be directly used for rendering whereas for the composite materials one has to first select the one that is used. All of the old materials, except the SwitchMaterials fall into the PrimeMaterial category and derive from it (Prime and Composite sit just below Material in the inheritance hierarchy). So yes you can store as a ChunkMaterial once you downcasted it correctly. > ... make sure that you include OpenSG/OSGPrimeMaterial.h in the .cpp file > where the compile error is occurring. OSGMaterial.h uses a forward > declaration of OSG::PrimeMaterial. This is strange for the above code to work there should have been a downcast to ChunkMaterial * in some way or form and that needs an include of OSGChunkMaterial.h which in turn include OSGPrimeMaterial.h so something seems really strange because just switching the returnValue of getDefaultMaterial should not have broken this. Except if our RefPtrs suddenly allow an implicit downcast. kind regards, gerrit ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
