Esempio n. 1
0
        virtual void readRecord(RecordInputStream& in, Document& document)
        {
            /*int colorNameIndex =*/ in.readInt16();
            uint16 flags = in.readUInt16();
            osg::Vec3d coord = in.readVec3d();
            osg::Vec4f packedColor = in.readColor32();
            int colorIndex = in.readInt32(-1);

            Vertex vertex;
            vertex.setCoord(coord*document.unitScale());

            // color
            if (flags & PACKED_COLOR)
                vertex.setColor(packedColor);                                             // Packed color
            else if( ( (flags & NO_COLOR) == 0 ) &&
                     ( colorIndex >= 0 ) )
            {
                // Only use the color index if the NO_COLOR bit is _not_ set
                // and the index isn't negative.
                vertex.setColor(getColorFromPool(colorIndex, document.getColorPool()));   // Color from pool
            }

            if (_parent.valid())
                _parent->addVertex(vertex);
        }
    virtual void readRecord(RecordInputStream& in, Document& document)
    {

    	float32 red = in.readFloat32();
    	float32 green = in.readFloat32();
    	float32 blue = in.readFloat32();

    	int32 textureidx = in.readInt32();
    	int32 uvidx = in.readInt32();

    	OSG_WARN << "Ambient Map base_color " << red << " " << green << " " << blue << std::endl;
    	OSG_WARN << "  TEXTURE_ID  UV_INDEX" << std::endl;
    	for(int i =0; i < 4; ++i) {
    		OSG_WARN << "  " << textureidx << "   " << uvidx << std::endl;
    		if(textureidx >=0 ) {
    			dynamic_cast<ExtendedMatrlHdr *>(document.getCurrentExtendedMaterial())->_textureLayers.push_back(TextureUVs(textureidx, -1, uvidx));
    		}
    		// Read the next texture map info
    		textureidx = in.readInt32();
    		uvidx = in.readInt32();
    	}



    }