1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #include "game_share/people.h"
34 class IProgressCallback
;
37 /** This is a description of a skeleton gabarit
38 * \author Nicolas Vizerie
39 * \author Nevrax France
42 struct CSkeletonGabarit
44 enum { NumBones
= 56 }; // 61
45 enum EBoneCategory
{ Arm
= 0, Torso
, Legs
, Breast
, Other
, NumBoneCategory
= Other
};
46 // the scale for each bone
47 NLMISC::CVector BoneScale
[NumBones
];
48 // the Skin Scale for each bone
49 NLMISC::CVector BoneSkinScale
[NumBones
];
54 // build values from a skeleton
55 void buildFromSkeleton(NL3D::USkeleton src
, const std::string
&skelName
, bool bMale
);
56 // convert a bone ID to its name
57 static const char *boneIndexToName(uint id
);
58 // convert a bone ID to its category
59 static EBoneCategory
boneIndexToCategory(uint id
);
63 /** This can load gabarit and blend them on a skeleton
64 * \author Nicolas Vizerie
65 * \author Nevrax France
71 enum { NumGender
= 2, NumRace
= 4, NumHeights
= 3, NumWidths
= 3 };
73 // load all ryzom gabarits
74 void loadGabarits (NLMISC::IProgressCallback
&progress
);
75 /** Blend gabarits, and apply the result to the given skeleton
76 * \param height from -1 (smallest) to 1 (tallest)
77 * \param torsoWidth from -1 to 1
78 * \param legsWidth from -1 to 1
79 * \param finalHeightScale if not NULL, will be filled with height scale of the skeleton (factor)
81 void applyGabarit(NL3D::USkeleton dest
, uint gender
, EGSPD::CPeople::TPeople race
,
87 float *finalHeightScale
89 // get the reference (mean) size for a race
90 float getRefHeightScale(uint gender
, EGSPD::CPeople::TPeople race
);
92 CSkeletonGabarit _Gabarit
[NumGender
][NumRace
][NumHeights
][NumWidths
];
94 sint
peopleToIndex(EGSPD::CPeople::TPeople people
);
98 // The gabarit set in ryzom
99 extern CGabaritSet GabaritSet
;