- Cal3D 0.11 API Reference -

submesh.h
1//****************************************************************************//
2// submesh.h //
3// Copyright (C) 2001, 2002 Bruno 'Beosil' Heidelberger //
4//****************************************************************************//
5// This library is free software; you can redistribute it and/or modify it //
6// under the terms of the GNU Lesser General Public License as published by //
7// the Free Software Foundation; either version 2.1 of the License, or (at //
8// your option) any later version. //
9//****************************************************************************//
10
11#ifndef CAL_SUBMESH_H
12#define CAL_SUBMESH_H
13
14
15#include "cal3d/global.h"
16#include "cal3d/vector.h"
17#include "cal3d/coresubmesh.h"
18
19
20class CalCoreSubmesh;
21
22
23// Structure used to return an array of the morphs that have non-zero weights.
25{
26 int morphId_;
27 float weight_;
28};
29class CAL3D_API CalSubmesh
30{
31public:
33 {
34 CalVector position;
35 CalVector positionOld;
36 CalVector force;
37 };
38
40 {
41 CalVector tangent;
42 float crossFactor;
43 };
44
45 struct Face
46 {
47 CalIndex vertexId[3];
48 };
49
50public:
51 CalSubmesh(CalCoreSubmesh *coreSubmesh);
52 ~CalSubmesh() { }
53
54 CalCoreSubmesh *getCoreSubmesh();
55 const CalCoreSubmesh *getCoreSubmesh() const;
56 int getCoreMaterialId() const;
57 int getFaceCount() const;
58 int getFaces(CalIndex *pFaceBuffer) const;
59 std::vector<CalVector>& getVectorNormal();
60 const std::vector<CalVector>& getVectorNormal() const;
61 std::vector<std::vector<TangentSpace> >& getVectorVectorTangentSpace();
62 const std::vector<std::vector<TangentSpace> >& getVectorVectorTangentSpace() const;
63 std::vector<PhysicalProperty>& getVectorPhysicalProperty();
64 const std::vector<PhysicalProperty>& getVectorPhysicalProperty() const;
65 std::vector<CalVector>& getVectorVertex();
66 const std::vector<CalVector>& getVectorVertex() const;
67 int getVertexCount() const;
68 bool hasInternalData() const;
69 void disableInternalData();
70 void setCoreMaterialId(int coreMaterialId);
71 void setLodLevel(float lodLevel);
72 bool isTangentsEnabled(int mapId) const;
73 bool enableTangents(int mapId, bool enabled);
74 void setMorphTargetWeight(int blendId, float weight);
75 float getMorphTargetWeight(int blendId) const;
76 void setMorphTargetWeight(const unsigned int& morphName,float weight);
77 int getMorphTargetWeightCount() const;
78 bool getMorphTargetWeight(const unsigned int& morphName, float * weightOut);
79 void getMorphIdAndWeightArray( MorphIdAndWeight * arrayResult,
80 unsigned int * numMiawsResult,
81 unsigned int maxMiaws );
82 float getBaseWeight() const;
83 std::vector<float>& getVectorMorphTargetWeight();
84 const std::vector<float>& getVectorMorphTargetWeight() const;
85 void clearMorphTargetScales();
86 void clearMorphTargetState( const unsigned int& morphName );
87 void blendMorphTargetScale( const unsigned int& morphName,
88 float scale,
89 float unrampedWeight,
90 float rampValue,
91 bool replace );
92 void setSubMorphTargetGroupAttenuatorArray( unsigned int len, int const * morphTargetIdArray );
93 void setSubMorphTargetGroupAttenuationArray( unsigned int len, float const * attenuationArray );
94private:
95 CalCoreSubmesh *m_pCoreSubmesh;
96 std::vector<float> m_vectorMorphTargetWeight;
97 std::vector<float> m_vectorAccumulatedWeight;
98 std::vector<float> m_vectorReplacementAttenuation;
99 std::vector<CalVector> m_vectorVertex;
100 std::vector<CalVector> m_vectorNormal;
101 std::vector<std::vector<TangentSpace> > m_vectorvectorTangentSpace;
102 std::vector<Face> m_vectorFace;
103 std::vector<PhysicalProperty> m_vectorPhysicalProperty;
104 std::vector<int> m_vectorSubMorphTargetGroupAttenuator;
105 std::vector<float> m_vectorSubMorphTargetGroupAttenuation;
106 int m_vertexCount;
107 int m_faceCount;
108 int m_coreMaterialId;
109 bool m_bInternalData;
110};
111
112#endif
Definition coresubmesh.h:32
Definition submesh.h:30
The vector class.
Definition vector.h:37
Definition submesh.h:46
Definition submesh.h:33
Definition submesh.h:40
Definition submesh.h:25

Generated by The Cal3D Team with Doxygen 1.10.0