2
Copyright (c) 2008-2009 NetAllied Systems GmbH
4
This file is part of COLLADAStreamWriter.
6
Licensed under the MIT Open Source License,
7
for details please see LICENSE file or the website
8
http://www.opensource.org/licenses/mit-license.php
11
#ifndef __COLLADASTREAMWRITER_LIBRARY_CONTROLLERS_H__
12
#define __COLLADASTREAMWRITER_LIBRARY_CONTROLLERS_H__
14
#include "COLLADASWPrerequisites.h"
15
#include "COLLADASWLibrary.h"
16
#include "COLLADASWInputList.h"
21
/** Class to simply the creation of @a \<library_controllers\> and @a \<controller\>'s*/
22
class LibraryControllers : public Library
27
static const String ARRAY_ID_SUFFIX;
28
static const String BIND_POSES_SOURCE_ID_SUFFIX;
29
static const String MORPH_CONTROLLER_ID_SUFFIX;
30
static const String MORPH_WEIGHTS_SOURCE_ID_SUFFIX;
31
static const String JOINTS_SOURCE_ID_SUFFIX;
32
static const String SKIN_CONTROLLER_ID_SUFFIX;
33
static const String TARGETS_SOURCE_ID_SUFFIX;
34
static const String WEIGHTS_SOURCE_ID_SUFFIX;
36
static const String ATTRIBUTE_METHOD_NORMALIZED;
37
static const String ATTRIBUTE_METHOD_RELATIVE;
41
/** Used to close the current controller element */
42
TagCloser mControllerCloser;
44
/** Used to close the current skin element */
45
TagCloser mSkinCloser;
47
/** Used to close the current morph element */
48
TagCloser mMorphCloser;
54
* @param streamWriter The stream.
56
LibraryControllers ( StreamWriter * streamWriter );
58
virtual ~LibraryControllers() {}
61
* Writes the opening \<controller\> and \<skin\> tags
62
* and, if necessary the opening @a \<library_controllers\> tag.
63
* closeSkin() must be use to close the opened tags.
64
* @param controllerId The id of the controller
65
* @param controllerName The Name of the geometry
66
* @param skinSource The target of the skin (the id of the geometry)
69
const String& controllerId,
70
const String& controllerName,
71
const URI& skinTarget );
74
* Writes the opening \<controller\> and \<skin\> tags
75
* and, if necessary the opening @a \<library_controllers\> tag.
76
* closeSkin() must be use to close the opened tags.
77
* @param controllerId The id of the controller
78
* @param skinSource The target of the skin (the id of the geometry)
81
const String& controllerId,
82
const URI& skinSource )
84
openSkin( controllerId, EMPTY_STRING, skinSource );
87
/** Closes the tag opened by openSkin(). */
91
* Writes the opening \<controller\> and \<morph\> tags
92
* and, if necessary the opening @a \<library_controllers\> tag.
93
* closeMorph() must be use to close the opened tags.
94
* @param controllerId The id of the controller
95
* @param controllerName The Name of the geometry
96
* @param morphTarget The target of the morph (the id of the geometry)
99
const String& controllerId,
100
const String& controllerName,
101
const URI& morphSource,
102
const String& morphMethod = ATTRIBUTE_METHOD_NORMALIZED );
104
/** Closes the tag opened by openMorph(). */
108
* Writes the opening \<controller\> tag
109
* and, if necessary the opening \<library_controllers\> tag.
110
* closeController() must be use to close the opened tags.
111
* @param controllerId The id of the controller.
112
* @param controllerName The name of the controller.
114
void openController ( const String& controllerId, const String& controllerName = EMPTY_STRING );
116
/** Closes the tag open by openController()*/
117
void closeController();
120
* Adds the given matrix to the bind_shape_matrix element.
121
* @param matrix[][4] The bind_shape_matrix.
123
void addBindShapeTransform ( const double matrix[][4] ) const;
127
} //namespace COLLADASW
129
#endif //__COLLADASTREAMWRITER_LIBRARY_CONTROLLERS_H__