summaryrefslogtreecommitdiff
path: root/public/mdlobjects/dmeboneflexdriver.h
blob: 2f0d1c82c7cb2d1215ab9f68161104a0e12da419 (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
//===== Copyright (c) 1996-2009, Valve Corporation, All rights reserved. ====
//
// Dme version of QC $boneflexdriver
//
//===========================================================================


#ifndef BONEFLEXDRIVER_H
#define BONEFLEXDRIVER_H


#ifdef _WIN32
#pragma once
#endif


// Valve includes
#include "mdlobjects/dmemdllist.h"


//-----------------------------------------------------------------------------
// The control for a DmeBoneFlexDriver
//-----------------------------------------------------------------------------
class CDmeBoneFlexDriverControl : public CDmElement
{
	DEFINE_ELEMENT( CDmeBoneFlexDriverControl, CDmElement );

public:
	// Sets the bone component to be in the range [STUDIO_BONE_FLEX_TX, STUDIO_BONE_FLEX_RZ]
	int SetBoneComponent( int nBoneComponent );

	CDmaString m_sFlexControllerName;	// Name of flex controller to drive
	CDmaVar< int > m_nBoneComponent;	// Component of bone to drive flex controller, StudioBoneFlexComponent_t
	CDmaVar< float > m_flMin;			// Min value of bone component mapped to 0 on flex controller
	CDmaVar< float > m_flMax;			// Max value of bone component mapped to 1 on flex controller (inches if T, degress if R)

};


//-----------------------------------------------------------------------------
// $QC boneflexdriver
//-----------------------------------------------------------------------------
class CDmeBoneFlexDriver : public CDmeMdlList
{
	DEFINE_ELEMENT( CDmeBoneFlexDriver, CDmeMdlList );

public:
	virtual CDmAttribute *GetListAttr() { return m_eControlList.GetAttribute(); }

	CDmeBoneFlexDriverControl *FindOrCreateControl( const char *pszControlName );

	CDmaString m_sBoneName;	// Name of bone to drive flex controller
	CDmaElementArray< CDmeBoneFlexDriverControl > m_eControlList;	// List of flex controllers to drive

};


//-----------------------------------------------------------------------------
// A list of DmeBoneFlexDriver elements
//-----------------------------------------------------------------------------
class CDmeBoneFlexDriverList : public CDmeMdlList
{
	DEFINE_ELEMENT( CDmeBoneFlexDriverList, CDmeMdlList );

public:
	virtual CDmAttribute *GetListAttr() { return m_eBoneFlexDriverList.GetAttribute(); }

	CDmeBoneFlexDriver *FindOrCreateBoneFlexDriver( const char *pszBoneName );

	CDmaElementArray< CDmeBoneFlexDriver > m_eBoneFlexDriverList;
};


#endif // BONEFLEXDRIVER_H