Пример #1
0
 shared_ptr <GLTFAnimation> convertOpenCOLLADAAnimationToGLTFAnimation(const COLLADAFW::Animation* animation)
 {
     shared_ptr <GLTFAnimation> cvtAnimation(new GLTFAnimation());
     if (animation->getAnimationType() == COLLADAFW::Animation::ANIMATION_CURVE) {
         std::vector <shared_ptr <GLTFAnimation::Parameter> >* animationParameters = cvtAnimation->parameters();
         
         const COLLADAFW::AnimationCurve* animationCurve = (const COLLADAFW::AnimationCurve*)animation;
         
         std::string animationID = animation->getOriginalId();
         if (animationID.size() == 0) {
             animationID = uniqueIdWithType("animation", animation->getUniqueId());
         }
         cvtAnimation->setID(animationID);
         
         cvtAnimation->setCount(animationCurve->getKeyCount());
         
         /** Returns the input values of the animation. */
         const COLLADAFW::FloatOrDoubleArray &inputArray =  animationCurve->getInputValues();
         const COLLADAFW::FloatOrDoubleArray &outputArray =  animationCurve->getOutputValues();
         
         const std::string originalID = animationCurve->getOriginalId();
         
         shared_ptr <GLTFBufferView> inputBufferView = convertFloatOrDoubleArrayToGLTFBufferView(inputArray);
         shared_ptr <GLTFBufferView> outputBufferView = convertFloatOrDoubleArrayToGLTFBufferView(outputArray);
         
         //build up input parameter, typically TIME
         shared_ptr <GLTFAnimation::Parameter> inputParameter(new GLTFAnimation::Parameter("TIME"));
         
         inputParameter->setType("FLOAT");
         inputParameter->setBufferView(inputBufferView);
         inputParameter->setByteOffset(0);
         inputParameter->setCount(cvtAnimation->getCount());
         
         animationParameters->push_back(inputParameter);
         
         //build up output parameter
         shared_ptr <GLTFAnimation::Parameter> outputParameter(new GLTFAnimation::Parameter("OUTPUT"));
         
         outputParameter->setBufferView(outputBufferView);
         outputParameter->setByteOffset(0);
         
         animationParameters->push_back(outputParameter);
     }
     
     return cvtAnimation;
 }
Пример #2
0
void Binder::realBind(std::size_t aPosition, Poco::Data::MetaColumn::ColumnDataType aFieldType, const void* aBufferPtr, std::size_t aLength)
{
	try
	{
		if (aPosition >= _bindVector.size())
		{
			_bindVector.resize(aPosition + 1);
		}

		InputParameter inputParameter(aFieldType, aBufferPtr, aLength);

		_bindVector[aPosition] = inputParameter;
	}
	catch (std::bad_alloc&)
	{
		PostgreSQLException("Memory allocation error while binding");
	}
}