|
1 /* |
|
2 * Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: SkinnedMesh interface |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __M3G_SKINNEDMESH_H__ |
|
19 #define __M3G_SKINNEDMESH_H__ |
|
20 |
|
21 /*! |
|
22 * \internal |
|
23 * \file |
|
24 * \brief SkinnedMesh interface |
|
25 */ |
|
26 |
|
27 #include "m3g_mesh.h" |
|
28 #include "m3g_array.h" |
|
29 |
|
30 typedef struct BoneRecord Bone; |
|
31 |
|
32 struct M3GSkinnedMeshImpl |
|
33 { |
|
34 Mesh mesh; |
|
35 |
|
36 Group *skeleton; |
|
37 PointerArray bones; |
|
38 |
|
39 M3Gint weightedVertexCount, bonesPerVertex; |
|
40 |
|
41 M3Gubyte *boneIndices[M3G_MAX_VERTEX_TRANSFORMS]; |
|
42 M3Gubyte *boneWeights[M3G_MAX_VERTEX_TRANSFORMS]; |
|
43 M3Gubyte *weightShifts; |
|
44 M3Gubyte *normalizedWeights[M3G_MAX_VERTEX_TRANSFORMS]; |
|
45 |
|
46 /* Scale and bias transformation for morphing */ |
|
47 M3Gshort scaleMatrix[9], biasVector[3]; |
|
48 M3Gshort scaleExp, biasExp, scaleBiasExp; |
|
49 |
|
50 M3Gshort maxExp; /* total maximum exponent */ |
|
51 |
|
52 /*! \internal \brief internal morphed vertex buffer */ |
|
53 VertexBuffer *morphedVB; |
|
54 |
|
55 M3Gint vbTimestamp; |
|
56 M3Gshort posShift, normalShift; |
|
57 |
|
58 AABB bbox; |
|
59 |
|
60 M3Gbool weightsDirty; |
|
61 }; |
|
62 |
|
63 /*---------------------------------------------------------------------- |
|
64 * Internal functions |
|
65 *--------------------------------------------------------------------*/ |
|
66 |
|
67 #endif /*__M3G_SKINNEDMESH_H__*/ |