2
Copyright (c) 2008-2009 NetAllied Systems GmbH
4
This file is part of COLLADAMaya.
6
Portions of the code are:
7
Copyright (c) 2005-2007 Feeling Software Inc.
8
Copyright (c) 2005-2007 Sony Computer Entertainment America
9
Copyright (c) 2004-2005 Alias Systems Corp.
11
Licensed under the MIT Open Source License,
12
for details please see LICENSE file or the website
13
http://www.opensource.org/licenses/mit-license.php
15
#ifndef __COLLADA_MAYA_TANGENT_POINT_H__
16
#define __COLLADA_MAYA_TANGENT_POINT_H__
18
#include "COLLADAMayaPrerequisites.h"
19
#include "COLLADASWLibraryAnimations.h"
20
#include "COLLADASWLibraryAnimationClips.h"
21
#include <maya/MFnAnimCurve.h>
27
* The x and y coordinate of a point of a tangent.
47
/** Default constructor */
48
TangentPoint() : x(0), y(0) {}
50
/** Creates the std::vector with the coordinates given.
51
@param _u The first coordinate.
52
@param _v The second coordinate. */
53
TangentPoint ( float _u, float _v ) : x(0), y(0)
59
/** Get this std::vector as an array of \c floats.
60
@return The \c float array. */
61
inline operator float*()
66
/** Adds two std::vector.
67
Adds to this std::vector's coordinates the individual components of the
68
given std::vector and returns this std::vector.
69
@param a The std::vector to add with this one.
70
@return This std::vector. */
71
inline TangentPoint operator + ( TangentPoint& a )
73
TangentPoint copy = *this;
78
/** Adds two std::vector.
79
Adds to this std::vector's coordinates the individual components of the
80
given std::vector and returns this std::vector.
81
@param a The std::vector to add with this one.
82
@return This std::vector. */
83
inline TangentPoint& operator += ( const TangentPoint& a )
90
inline TangentPoint operator - ( TangentPoint& a )
92
TangentPoint copy = *this;
97
inline TangentPoint& operator -= ( const TangentPoint& a )
104
/** Multiplies this std::vector by a scaler.
105
Multiplies each of this std::vector's coordinates with the scaler and
106
returns this std::vector.
107
@param a The scalar to multiply with.
108
@return This std::vector. */
109
inline TangentPoint& operator *= ( float a )
116
/** Assign this std::vector to the given float array.
117
Assigns each coordinate of this std::vector to the elements in the \c
118
float array. The first element to the first coordinate and the second to
119
the second. It returns this std::vector.
120
@param f The \c float array to assign with.
121
@return This std::vector. */
122
inline TangentPoint& operator = ( const float* f )
130
/** Vector addition with two vectors.
131
@param a The first std::vector.
132
@param b The second std::vector.
133
@return The FMVector2 representation of the resulting std::vector. */
134
inline TangentPoint operator + ( const TangentPoint& a, const TangentPoint& b )
136
return TangentPoint ( a.u + b.u, a.v + b.v );
139
/** Vector subtraction with two vectors.
140
@param a The first std::vector.
141
@param b The second std::vector.
142
@return The FMVector2 representation of the resulting std::vector. */
143
inline TangentPoint operator - ( const TangentPoint& a, const TangentPoint& b )
145
return TangentPoint ( a.u - b.u, a.v - b.v );
148
/** Dot product of two vectors.
149
@param a The first std::vector.
150
@param b The second std::vector.
151
@return The result of the dot product.
153
inline float operator * ( const TangentPoint& a, const TangentPoint& b )
155
return a.u * b.u + a.v * b.v;
158
/** Scalar multiplication with a std::vector.
159
@param a The std::vector.
161
@return The FMVector2 representing the resulting the std::vector. */
162
inline TangentPoint operator * ( const TangentPoint& a, float b )
164
return TangentPoint ( a.u * b, a.v * b );
167
/** Scalar multiplication with a std::vector.
169
@param b The std::vector.
170
@return The std::vector representing the resulting the std::vector. */
171
inline TangentPoint operator * ( float a, const TangentPoint& b )
173
return TangentPoint ( a * b.u, a * b.v );
176
/** Scalar division with a std::vector.
177
@param a The std::vector.
179
@return The std::vector representing the resulting the std::vector. */
180
inline TangentPoint operator / ( const TangentPoint& a, float b )
182
return TangentPoint ( a.x / b, a.y / b );
187
#endif // __COLLADA_MAYA_TANGENT_POINT_H__