- Cal3D 0.11 API Reference -

coresubmesh.h
1 //****************************************************************************//
2 // coresubmesh.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_CORESUBMESH_H
12 #define CAL_CORESUBMESH_H
13 
14 
15 #include "cal3d/global.h"
16 #include "cal3d/vector.h"
17 
18 
20 
21 
22 class CAL3D_API CalCoreSubmesh
23 {
24 public:
26  {
27  float u, v;
28  };
29 
30  struct TangentSpace
31  {
32  CalVector tangent;
33  float crossFactor; // To get the binormal, use ((N x T) * crossFactor)
34  };
35 
36  struct Influence
37  {
38  int boneId;
39  float weight;
40  };
41 
43  {
44  float weight;
45  };
46 
47  struct Vertex
48  {
49  CalVector position;
50  CalVector normal;
51  std::vector<Influence> vectorInfluence;
52  int collapseId;
53  int faceCollapseCount;
54  };
55 
56  struct Face
57  {
58  CalIndex vertexId[3];
59  };
60 
62  struct Spring
63  {
64  int vertexId[2];
65  float springCoefficient;
66  float idleLength;
67  };
68 
69 public:
71  ~CalCoreSubmesh();
72 
73  int getCoreMaterialThreadId();
74  int getFaceCount();
75  int getLodCount();
76  int getSpringCount();
77  std::vector<Face>& getVectorFace();
78  std::vector<PhysicalProperty>& getVectorPhysicalProperty();
79  std::vector<Spring>& getVectorSpring();
80  std::vector<std::vector<TangentSpace> >& getVectorVectorTangentSpace();
81  std::vector<std::vector<TextureCoordinate> >& getVectorVectorTextureCoordinate();
82  std::vector<Vertex>& getVectorVertex();
83  int getVertexCount();
84  bool isTangentsEnabled(int mapId);
85  bool enableTangents(int mapId, bool enabled);
86  bool reserve(int vertexCount, int textureCoordinateCount, int faceCount, int springCount);
87  void setCoreMaterialThreadId(int coreMaterialThreadId);
88  bool setFace(int faceId, const Face& face);
89  void setLodCount(int lodCount);
90  bool setPhysicalProperty(int vertexId, const PhysicalProperty& physicalProperty);
91  bool setSpring(int springId, const Spring& spring);
92  bool setTangentSpace(int vertexId, int textureCoordinateId, const CalVector& tangent, float crossFactor);
93  bool setTextureCoordinate(int vertexId, int textureCoordinateId, const TextureCoordinate& textureCoordinate);
94  bool setVertex(int vertexId, const Vertex& vertex);
95  int addCoreSubMorphTarget(CalCoreSubMorphTarget *pCoreSubMorphTarget);
96  CalCoreSubMorphTarget *getCoreSubMorphTarget(int id);
97  int getCoreSubMorphTargetCount();
98  std::vector<CalCoreSubMorphTarget *>& getVectorCoreSubMorphTarget();
99  void scale(float factor);
100 
101 private:
102  void UpdateTangentVector(int v0, int v1, int v2, int channel);
103 
104 private:
105  std::vector<Vertex> m_vectorVertex;
106  std::vector<bool> m_vectorTangentsEnabled;
107  std::vector<std::vector<TangentSpace> > m_vectorvectorTangentSpace;
108  std::vector<std::vector<TextureCoordinate> > m_vectorvectorTextureCoordinate;
109  std::vector<PhysicalProperty> m_vectorPhysicalProperty;
110  std::vector<Face> m_vectorFace;
111  std::vector<Spring> m_vectorSpring;
112  std::vector<CalCoreSubMorphTarget *> m_vectorCoreSubMorphTarget;
113  int m_coreMaterialThreadId;
114  int m_lodCount;
115 };
116 
117 #endif
118 
119 //****************************************************************************//
The core submesh Spring.
Definition: coresubmesh.h:62
Definition: coresubmesh.h:25
Definition: coresubmesh.h:42
Definition: coresubmesh.h:56
Definition: coresubmesh.h:47
Definition: coresubmorphtarget.h:19
The vector class.
Definition: vector.h:36
Definition: coresubmesh.h:22
Definition: coresubmesh.h:36
Definition: coresubmesh.h:30

Generated at Thu Sep 4 2014 00:32:52 by The Cal3D Team with Doxygen 1.8.7