mgckeyframecontroller.h

来自「《3D游戏引擎设计》的源码」· C头文件 代码 · 共 98 行

H
98
字号
// Magic Software, Inc.
// http://www.magic-software.com
// Copyright (c) 2000, All Rights Reserved
//
// Source code from Magic Software is supplied under the terms of a license
// agreement and may not be copied or disclosed except in accordance with the
// terms of that agreement.  The various license agreements may be found at
// the Magic Software web site.  This file is subject to the license
//
// RESTRICTED USE SOURCE CODE
// http://www.magic-software.com/License/restricted.pdf

#ifndef MGCKEYFRAMECONTROLLER_H
#define MGCKEYFRAMECONTROLLER_H

#include "MgcController.h"
#include "MgcMatrix3.h"
class MgcQuaternion;
class MgcSpatial;


class MgcKeyframeController : public MgcController
{
    MgcDeclareRTTI;
    MgcDeclareStream;

public:
    MgcKeyframeController (MgcSpatial* pkObject = 0);
    virtual ~MgcKeyframeController ();

    void SetTranslationQuantity (unsigned int uiTQuantity);
    void SetTranslationTimes (MgcReal* afTTime);
    void SetTranslations (MgcVector3* akTData);
    unsigned int GetTranslationQuantity () const;
    MgcReal* GetTranslationTimes () const;
    MgcVector3* GetTranslations () const;

    void SetRotationQuantity (unsigned int uiRQuantity);
    void SetRotationTimes (MgcReal* afRTime);
    void SetRotations (MgcQuaternion* akRData);
    unsigned int GetRotationQuantity () const;
    MgcReal* GetRotationTimes () const;
    MgcQuaternion* GetRotations () const;

    void SetScaleQuantity (unsigned int uiSQuantity);
    void SetScaleTimes (MgcReal* afSTime);
    void SetScales (MgcReal* afSData);
    unsigned int GetScaleQuantity () const;
    MgcReal* GetScaleTimes () const;
    MgcReal* GetScales () const;

    void SetSharedQuantity (unsigned int uiQuantity);
    void SetSharedTimes (MgcReal* afTime);
    unsigned int GetSharedQuantity () const;
    MgcReal* GetSharedTimes () const;

    virtual bool Update (MgcReal fAppTime);

protected:
    static void GetKeyInfo (MgcReal fCtrlTime, unsigned int uiQuantity,
        MgcReal* afTime, unsigned int& ruiLastIndex, MgcReal& rfNormTime,
        unsigned int& ruiI0, unsigned int& ruiI1);

    MgcVector3 GetTranslation (MgcReal fNormTime, unsigned int uiI0,
        unsigned int uiI1);

    MgcMatrix3 GetRotation (MgcReal fNormTime, unsigned int uiI0,
        unsigned int uiI1);

    MgcReal GetScale (MgcReal fNormTime, unsigned int uiI0,
        unsigned int uiI1);

    unsigned int m_uiTQuantity;
    MgcReal* m_afTTime;
    MgcVector3* m_akTData;
    unsigned int m_uiTLastIndex;

    unsigned int m_uiRQuantity;
    MgcReal* m_afRTime;
    MgcQuaternion* m_akRData;
    unsigned int m_uiRLastIndex;

    unsigned int m_uiSQuantity;
    MgcReal* m_afSTime;
    MgcReal* m_afSData;
    unsigned int m_uiSLastIndex;

    unsigned int m_uiSharedQuantity;
    MgcReal* m_afSharedTime;
    unsigned int m_uiSharedLastIndex;
};

MgcSmartPointer(MgcKeyframeController);
MgcRegisterStream(MgcKeyframeController);
#include "MgcKeyframeController.inl"

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?