bool Costume::restoreState(SaveGame *state) { if (state->readBool()) { Common::String str = state->readString(); setColormap(str); } for (int i = 0; i < _numChores; ++i) { _chores[i]->restoreState(state); } for (int i = 0; i < _numComponents; ++i) { Component *c = _components[i]; if (c) { c->_visible = state->readBool(); c->_matrix.setPosition(state->readVector3d()); c->restoreState(state); } } int numPlayingChores = state->readLEUint32(); for (int i = 0; i < numPlayingChores; ++i) { int id = state->readLESint32(); _playingChores.push_back(_chores[id]); } _lookAtRate = state->readFloat(); _head->restoreState(state); _head->loadJoints(getModelNodes()); return true; }
void Costume::setHead(int joint1, int joint2, int joint3, float maxRoll, float maxPitch, float maxYaw) { _head->setJoints(joint1, joint2, joint3); _head->loadJoints(getModelNodes()); _head->setMaxAngles(maxPitch, maxYaw, maxRoll); }