//---------------------------------------------------------------------
    void SkeletonSerializer::writeKeyFrame(const Skeleton* pSkel, 
        const TransformKeyFrame* key)
    {

        writeChunkHeader(SKELETON_ANIMATION_TRACK_KEYFRAME, 
            calcKeyFrameSize(pSkel, key));

        // float time                    : The time position (seconds)
        float time = key->getTime();
        writeFloats(&time, 1);
        // Quaternion rotate            : Rotation to apply at this keyframe
        writeObject(key->getRotation());
        // Vector3 translate            : Translation to apply at this keyframe
        writeObject(key->getTranslate());
        // Vector3 scale                : Scale to apply at this keyframe
        if (key->getScale() != Vector3::UNIT_SCALE)
        {
            writeObject(key->getScale());
        }
    }
Example #2
0
 //---------------------------------------------------------------------
 void Serializer::writeObject(const Vector3& vec)
 {
     writeFloats(vec.ptr(), 3);
 }
Example #3
0
 //---------------------------------------------------------------------
 void Serializer::writeObject(const Quaternion& q)
 {
     float tmp[4] = { q.x, q.y, q.z, q.w };
     writeFloats(tmp, 4);
 }
Example #4
0
	void Serializer::writeObject(const Vector3& vec)
	{
		float tmp[3]  = {vec.x, vec.y, vec.z};
		writeFloats(tmp, 3);
	}
Example #5
0
 FixedStrT<N>::FixedStrT(const Nimble::Matrix3 & v, int digits)
 { writeFloats(v.data(), 9, digits); }
Example #6
0
 FixedStrT<N>::FixedStrT(Nimble::Vector4 v, int digits)
 { writeFloats(v.data(), 4, digits); }
Example #7
0
 FixedStrT<N>::FixedStrT(float v, int digits)
 {
   writeFloats(&v, 1, digits);
 }
 //---------------------------------------------------------------------
 void Writer::writeObject(const Ogre::Vector3& v)
 {
     writeFloats(&v.x);
     writeFloats(&v.y);
     writeFloats(&v.z);
 }