// Copyright (C) 2010, Guy Barrand. All rights reserved. // See the file tools.license for terms. #ifndef tools_sg_sf_rotf #define tools_sg_sf_rotf #include "sf" #include "../lina/rotf" #include "../HEADER" namespace tools { namespace sg { class sf_rotf : public bsf { TOOLS_HEADER(sf_rotf,tools::sg::sf_rotf,bsf) public: virtual bool write(io::iwbuf& a_buffer) { const vec4& vec = m_value.quat(); const float* d = get_data(vec); return a_buffer.write_vec(vec.size(),d); } virtual bool read(io::irbuf& a_buffer) { vec4& vec = m_value.quat(); uint32 n; float* v; if(!a_buffer.read_vec(n,v)) return false; if(n!=vec.size()) { delete [] v; return false; } for(uint32 index=0;index