void Generic1DOFJointSensorGroup::SetSensorsList(const SensorsList& list){ mSensorList.clear(); mSensorCount = 0; for(unsigned int i=0;i<list.size();i++){ Generic1DOFJointSensor *sensor = Generic1DOFJointSensor::Cast(list[i]); if(sensor){ mSensorList.push_back(sensor); mSensorCount ++; } } mPosition.Resize(mSensorCount,false); mVelocity.Resize(mSensorCount,false); mAcceleration.Resize(mSensorCount,false); mTorque.Resize(mSensorCount,false); mLimits[0].Resize(mSensorCount,false); mLimits[1].Resize(mSensorCount,false); mPosition.Zero(); mVelocity.Zero(); mAcceleration.Zero(); mTorque.Zero(); mLimits[0].Zero(); mLimits[1].Zero(); }
int Sensor::SensorsListSetFromStream(SensorsList & list,const void* memory){ char* mem = (char*) memory; for(size_t i=0;i<list.size();i++) mem += list[i]->SetFromStream(mem); return ((char*)mem)-((char*)memory); }
int Sensor::SensorsListStreamSize(SensorsList & list){ int result=0; for(size_t i=0;i<list.size();i++) result += list[i]->StreamSize(); return result; }