bool ODERigidObject::ReadState(File& f) { Vector3 w,v; dReal pos[3]; dReal q[4]; if(!ReadArrayFile(f,pos,3)) return false; if(!ReadArrayFile(f,q,4)) return false; if(!ReadFile(f,w)) return false; if(!ReadFile(f,v)) return false; dBodySetPosition(bodyID,pos[0],pos[1],pos[2]); dBodySetQuaternion(bodyID,q); SetVelocity(w,v); return true; }
bool SplineBase<Key,Point>::Read(File& f) { if(!SplineTimeBase::Read(f)) return false; //if(!ReadArrayFile(f,keys,getNumKeys())) return false; if(!ReadArrayFile(f,&keys[0],getNumKeys())) return false; return true; }
bool ReadFile(File& f,vector<T>& v) { size_t n; if(!ReadFile(f,n)) return false; v.resize(n); if(!ReadArrayFile(f,&v[0],n)) return false; return true; }
bool ReadFile(File& f,string& s) { size_t n; if(!ReadFile(f,n)) return false; s.resize(n); if(n > 0) if(!ReadArrayFile(f,&s[0],n)) return false; return true; }
bool SplineTimeBase::Read(File& f) { int nt; if(!ReadFile(f,nt)) return false; init(nt); if(!ReadFile(f,flags)) return false; //if(!ReadArrayFile(f,times,nt)) return false; if(!ReadArrayFile(f,×[0],nt)) return false; return true; }