- 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 int morphId_;
26 float weight_;
27};
28class CAL3D_API CalSubmesh
29{
30public:
32 {
33 CalVector position;
34 CalVector positionOld;
35 CalVector force;
36 };
37
39 {
40 CalVector tangent;
41 float crossFactor;
42 };
43
44 struct Face
45 {
46 CalIndex vertexId[3];
47 };
48
49public:
50 CalSubmesh(CalCoreSubmesh *coreSubmesh);
51 ~CalSubmesh() { }
52
53 CalCoreSubmesh *getCoreSubmesh();
54 const CalCoreSubmesh *getCoreSubmesh() const;
55 int getCoreMaterialId() const;
56 int getFaceCount() const;
57 int getFaces(CalIndex *pFaceBuffer) const;
58 std::vector<CalVector>& getVectorNormal();
59 const std::vector<CalVector>& getVectorNormal() const;
60 std::vector<std::vector<TangentSpace> >& getVectorVectorTangentSpace();
61 const std::vector<std::vector<TangentSpace> >& getVectorVectorTangentSpace() const;
62 std::vector<PhysicalProperty>& getVectorPhysicalProperty();
63 const std::vector<PhysicalProperty>& getVectorPhysicalProperty() const;
64 std::vector<CalVector>& getVectorVertex();
65 const std::vector<CalVector>& getVectorVertex() const;
66 int getVertexCount() const;
67 bool hasInternalData() const;
68 void disableInternalData();
69 void setCoreMaterialId(int coreMaterialId);
70 void setLodLevel(float lodLevel);
71 bool isTangentsEnabled(int mapId) const;
72 bool enableTangents(int mapId, bool enabled);
73 void setMorphTargetWeight(int blendId, float weight);
74 float getMorphTargetWeight(int blendId) const;
75 void setMorphTargetWeight(std::string const & morphName,float weight);
76 int getMorphTargetWeightCount() const;
77 bool getMorphTargetWeight(std::string const & morphName, float * weightOut);
78 void getMorphIdAndWeightArray( MorphIdAndWeight * arrayResult,
79 unsigned int * numMiawsResult,
80 unsigned int maxMiaws );
81 float getBaseWeight() const;
82 std::vector<float>& getVectorMorphTargetWeight();
83 const std::vector<float>& getVectorMorphTargetWeight() const;
84 void clearMorphTargetScales();
85 void clearMorphTargetState( std::string const & morphName );
86 void blendMorphTargetScale( std::string const & morphName,
87 float scale,
88 float unrampedWeight,
89 float rampValue,
90 bool replace );
91 void setSubMorphTargetGroupAttenuatorArray( unsigned int len, int const * morphTargetIdArray );
92 void setSubMorphTargetGroupAttenuationArray( unsigned int len, float const * attenuationArray );
93private:
94 CalCoreSubmesh *m_pCoreSubmesh;
95 std::vector<float> m_vectorMorphTargetWeight;
96 std::vector<float> m_vectorAccumulatedWeight;
97 std::vector<float> m_vectorReplacementAttenuation;
98 std::vector<CalVector> m_vectorVertex;
99 std::vector<CalVector> m_vectorNormal;
100 std::vector<std::vector<TangentSpace> > m_vectorvectorTangentSpace;
101 std::vector<Face> m_vectorFace;
102 std::vector<PhysicalProperty> m_vectorPhysicalProperty;
103 std::vector<int> m_vectorSubMorphTargetGroupAttenuator;
104 std::vector<float> m_vectorSubMorphTargetGroupAttenuation;
105 int m_vertexCount;
106 int m_faceCount;
107 int m_coreMaterialId;
108 bool m_bInternalData;
109};
110
111#endif
Definition coresubmesh.h:32
Definition submesh.h:29
The vector class.
Definition vector.h:37
Definition submesh.h:45
Definition submesh.h:32
Definition submesh.h:39
Definition submesh.h:24

Generated by The Cal3D Team with Doxygen 1.12.0