summaryrefslogtreecommitdiffstats
path: root/game/code/worldsim/redbrick/rootmatrixdriver.h
blob: bbebab8f93faea18c1e9e09472b745ff91330cbd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*===========================================================================
   rootmatrixdriver.h

   created Jan 24, 2002
   by Greg Mayer

   Copyright (c) 2002 Radical Entertainment, Inc.
   All rights reserved.


===========================================================================*/

#ifndef _ROOTMATRIXDRIVER_H
#define _ROOTMATRIXDRIVER_H


#include <poser/pose.hpp>
#include <poser/poseengine.hpp>
#include <poser/posedriver.hpp>

/*
class PoseDriver: public tEntity
{
public:

   PoseDriver();

   virtual int GetMinimumJointIndex() const
      { return 0; }
   virtual int GetPriority() const
      { return PRIORITY_DEFAULT; }

   bool IsEnabled() const
      { return m_IsEnabled; }
   void SetIsEnabled(bool isEnabled)
      { m_IsEnabled = isEnabled; }

   virtual void Advance(float dt) = 0;
   virtual void Update(Pose* pose) = 0;

protected:

   virtual ~PoseDriver();

private:

   bool m_IsEnabled;
};
*/


class RootMatrixDriver : public poser::PoseDriver
{
public:
    RootMatrixDriver(rmt::Matrix* inRootMatrix) : mRootMatrix(inRootMatrix) {}
    virtual int GetMinimumJointIndex() const { return 0; }
    virtual int GetPriority() const { return 0; }
    virtual void Advance(float dt) {}
    virtual void Update(poser::Pose* pose);

    // move definition to cpp file
    /*
    {
        poser::Joint* j = pose->GetJoint(0);
        rmt::Matrix m = j->GetObjectMatrix();
        m.Mult(*mRootMatrix);
        j->SetWorldMatrix(m);
    }
    */

private:
    rmt::Matrix* mRootMatrix;
};

#endif // #ifndef _ROOTMATRIXDRIVER_H