summaryrefslogtreecommitdiff
path: root/public/movieobjects/dmeshape.h
blob: fc13b2f2484ef48aa6d3ffa1c57c499d381ceddd (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// A class representing an abstract shape (ie drawable object)
//
//=============================================================================

#ifndef DMESHAPE_H
#define DMESHAPE_H
#ifdef _WIN32
#pragma once
#endif

#include "mathlib/mathlib.h"
#include "datamodel/dmelement.h"
#include "datamodel/dmattribute.h"
#include "datamodel/dmattributevar.h"


//-----------------------------------------------------------------------------
// Forward declarations
//-----------------------------------------------------------------------------
class CDmeTransform;
class CDmeDrawSettings;
class CDmeDag;


//-----------------------------------------------------------------------------
// A class representing a camera
//-----------------------------------------------------------------------------
class CDmeShape : public CDmElement
{
	DEFINE_ELEMENT( CDmeShape, CDmElement );

public:
	virtual void Draw( const matrix3x4_t &shapeToWorld, CDmeDrawSettings *pDmeDrawSettings = NULL );

	virtual void GetBoundingSphere( Vector &c, float &r ) const;

	// Find out how many DmeDag's have this DmeShape as their shape, could be 0
	int GetParentCount() const;

	// Get the nth DmeDag that has this DmeShape as its shape.  The order is defined by g_pDataModel->FirstAttributeReferencingElement/NextAttr...
	CDmeDag *GetParent( int nParentIndex = 0 ) const;

	// Get the Nth World Matrix for the shape (the world matrix of the Nth DmeDag parent)
	void GetShapeToWorldTransform( matrix3x4_t &mat, int nParentIndex = 0 ) const;

protected:
	CDmaVar< bool > m_visible;
};


#endif // DMESHAPE_H