static shared_ptr <GLTFAnimation::Parameter> __SetupAnimationParameter(shared_ptr <GLTFAnimation> cvtAnimation, const std::string& parameterSID, const std::string& parameterType) { //setup shared_ptr <GLTFAnimation::Parameter> parameter(new GLTFAnimation::Parameter(parameterSID)); parameter->setCount(cvtAnimation->getCount()); parameter->setType(parameterType); __SetupSamplerForParameter(cvtAnimation, parameter.get()); cvtAnimation->parameters()->push_back(parameter); return parameter; }
/* Handles Parameter creation / addition / write */ static void __SetupAndWriteAnimationParameter(shared_ptr <GLTFAnimation> cvtAnimation, const std::string& parameterSID, const std::string& parameterType, shared_ptr <GLTFBufferView> bufferView, std::ofstream &animationsOutputStream) { //setup shared_ptr <GLTFAnimation::Parameter> parameter(new GLTFAnimation::Parameter(parameterSID)); parameter->setCount(cvtAnimation->getCount()); parameter->setType(parameterType); __SetupSamplerForParameter(cvtAnimation, parameter.get()); cvtAnimation->parameters()->push_back(parameter); //write parameter->setByteOffset(static_cast<size_t>(animationsOutputStream.tellp())); animationsOutputStream.write((const char*)( bufferView->getBufferDataByApplyingOffset()), bufferView->getByteLength()); }