Ejemplo n.º 1
0
shared_ptr<JSONObject> serializeAnimation(GLTFAnimation* animation, void *context) {
    shared_ptr <JSONObject> animationObject(new JSONObject());
    shared_ptr <JSONObject> parametersObject(new JSONObject());
    //GLTFConverterContext* converterContext = (GLTFConverterContext*)context;

    animationObject->setUnsignedInt32("count", animation->getCount());
    animationObject->setValue("samplers", animation->samplers());
    animationObject->setValue("channels", animation->channels());

    animationObject->setValue("parameters", animation->parameters());

    return animationObject;
}
Ejemplo n.º 2
0
    shared_ptr<JSONObject> serializeAnimation(GLTFAnimation* animation) {
        shared_ptr <JSONObject> animationObject(new JSONObject());
        shared_ptr <JSONObject> parametersObject(new JSONObject());

        animationObject->setUnsignedInt32("count", animation->getCount());
        animationObject->setValue("samplers", animation->samplers());
        animationObject->setValue("channels", animation->channels());
        
        std::vector <shared_ptr <GLTFAnimation::Parameter> >  *parameters = animation->parameters();
        for (size_t i = 0 ; i < parameters->size() ; i++) {
            shared_ptr<JSONObject> parameterObject = serializeAnimationParameter((*parameters)[i].get());
            
            parametersObject->setValue((*parameters)[i]->getID(), parameterObject);
        }
        animationObject->setValue("parameters", parametersObject);
        
        return animationObject;
    }