示例#1
0
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;
}
示例#2
0
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;
}
示例#3
0
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;
}
示例#4
0
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;
}
示例#5
0
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,&times[0],nt)) return false;
	return true;
}