PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: Weight.h * 00003 * 00004 * Copyright (C) 2002-2011 The PixelLight Team (http://www.pixellight.org/) 00005 * 00006 * This file is part of PixelLight. 00007 * 00008 * PixelLight is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * PixelLight is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with PixelLight. If not, see <http://www.gnu.org/licenses/>. 00020 \*********************************************************/ 00021 00022 00023 #ifndef __PLMESH_WEIGHT_H__ 00024 #define __PLMESH_WEIGHT_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLMesh/PLMesh.h" 00032 00033 00034 //[-------------------------------------------------------] 00035 //[ Namespace ] 00036 //[-------------------------------------------------------] 00037 namespace PLMesh { 00038 00039 00040 //[-------------------------------------------------------] 00041 //[ Classes ] 00042 //[-------------------------------------------------------] 00043 /** 00044 * @brief 00045 * Weight class 00046 */ 00047 class Weight { 00048 00049 00050 //[-------------------------------------------------------] 00051 //[ Public functions ] 00052 //[-------------------------------------------------------] 00053 public: 00054 /** 00055 * @brief 00056 * Constructor 00057 */ 00058 PLMESH_API Weight(); 00059 00060 /** 00061 * @brief 00062 * Destructor 00063 */ 00064 PLMESH_API ~Weight(); 00065 00066 /** 00067 * @brief 00068 * Get the weight joint number 00069 * 00070 * @return 00071 * Weight joint number, < 0 on error 00072 */ 00073 PLMESH_API int GetJoint() const; 00074 00075 /** 00076 * @brief 00077 * Sets the weight joint number 00078 * 00079 * @param[in] nJoint 00080 * Weight joint number 00081 */ 00082 PLMESH_API void SetJoint(int nJoint = -1); 00083 00084 /** 00085 * @brief 00086 * Get the weight bias 00087 * 00088 * @return 00089 * Weight bias 00090 * 00091 * @remarks 00092 * Scale factor for the influence. Usually the weights for all influences for a single 00093 * vertex add up to one. 00094 */ 00095 PLMESH_API float GetBias() const; 00096 00097 /** 00098 * @brief 00099 * Sets the weight bias 00100 * 00101 * @param[in] fBias 00102 * Weight bias 00103 * 00104 * @see 00105 * - GetBias() 00106 */ 00107 PLMESH_API void SetBias(float fBias = 0.0f); 00108 00109 /** 00110 * @brief 00111 * Copy operator 00112 * 00113 * @param[in] cSource 00114 * Source to copy from 00115 * 00116 * @return 00117 * This weight 00118 */ 00119 PLMESH_API Weight &operator =(const Weight &cSource); 00120 00121 /** 00122 * @brief 00123 * Compares two weights 00124 * 00125 * @param[in] cWeight 00126 * Weight to compare with 00127 * 00128 * @return 00129 * 'true' if both weights are equal, else 'false' 00130 */ 00131 PLMESH_API bool operator ==(const Weight &cWeight) const; 00132 00133 00134 //[-------------------------------------------------------] 00135 //[ Private data ] 00136 //[-------------------------------------------------------] 00137 private: 00138 int m_nJoint; /**< Joint this weight is for */ 00139 float m_fBias; /**< Bias factor */ 00140 00141 00142 }; 00143 00144 00145 //[-------------------------------------------------------] 00146 //[ Namespace ] 00147 //[-------------------------------------------------------] 00148 } // PLMesh 00149 00150 00151 #endif // __PLMESH_WEIGHT_H__
|