My Project
ParaXModelCommon.h
1 #pragma once
2 #include "animated.h"
3 
4 namespace ParaEngine
5 {
6  class CParaXModel;
7 
8  struct ModelColor {
9  Animated<Vector3> color;
10  AnimatedShort opacity;
11  };
12 
14  AnimatedShort trans;
15  };
16 
17  enum BlendModes {
18  BM_OPAQUE,
19  BM_TRANSPARENT,
20  BM_ALPHA_BLEND,
21  BM_ADDITIVE,
22  BM_ADDITIVE_ALPHA,
23  BM_MODULATE,
24  BM_TEMP_FORCEALPHABLEND = 0X8000,
25  };
26 
27  struct ModelCamera {
28  bool m_bIsValid;
29 
30  Vector3 pos, target;
31  float nearclip, farclip, fov;
32  Animated<Vector3> tPos, tTarget;
33  Animated<float> rot;
34 
35  void setup(int time = 0);
36 
37  ModelCamera() :m_bIsValid(false) {}
38  };
39 
40  struct ModelLight {
41  int type, parent;
42  Vector3 pos, tpos, dir, tdir;
43  Animated<Vector3> diffColor, ambColor;
44  Animated<float> diffIntensity, ambIntensity;
45 
46  void setup(int time, uint32 l);
47  };
48 
49 
50  struct ModelAttachment {
51  int id;
52  Vector3 pos;
53  int bone;
54 
55  void setup(CParaXModel *model);
56  };
58  uint32 nGlobalSequences;
59  uint32 nAnimations;
60  uint32 nBones;
61  uint32 nVertices;
62  uint32 nViews;
63  uint32 nColors;
64  uint32 nTextures;
65  uint32 nTransparency; // H
66  uint32 nTexAnims; // J
67  uint32 nTexReplace;
68  uint32 nTexFlags;
69  uint32 nTexLookup;
70  uint32 nTexUnitLookup; // L
71  uint32 nTransparencyLookup; // M
72  uint32 nTexAnimLookup;
73  uint32 nAttachments; // O
74  uint32 nAttachLookup; // P
75  uint32 nLights; // R
76  uint32 nCameras; // S
77  uint32 nRibbonEmitters; // U
78  uint32 nParticleEmitters; // V
79  uint32 nIndices;
80  };
81 
86  static const int num = 3;
87  static const int ReplaceableSkinBase = 11;
88  // base index in ParaX model's replaceable texture array
89  int base;
90  // the number of textures. it is no larger than num.
91  int count;
92  std::string tex[num];
94  :base(ReplaceableSkinBase), count(0)
95  {
96  for (int i = 0; i<num; i++) {
97  tex[i] = "";
98  }
99  }
100  // default copy constructor
102  {
103  for (int i = 0; i<num; i++) {
104  tex[i] = grp.tex[i];
105  }
106  base = grp.base;
107  count = grp.count;
108  }
109  const bool operator<(const ReplaceableTextureGroup &grp) const
110  {
111  for (int i = 0; i<num; i++) {
112  if (tex[i]<grp.tex[i]) return true;
113  }
114  return false;
115  }
116  };
117 }
replaceable skins for non-customizable characters.
Definition: ParaXModelCommon.h:85
different physics engine has different winding order.
Definition: EventBinding.h:32
Standard 3-dimensional vector.
Definition: ParaVector3.h:16
Definition: ParaXModelCommon.h:13
Definition: ParaXModelCommon.h:57
Definition: animated.h:23
Definition: ParaXModelCommon.h:8
Definition: ParaXModelCommon.h:27
Definition: ParaXModelCommon.h:40
Definition: ParaXModelCommon.h:50
ParaX model is the model file for character animation, etc in the game world.
Definition: ParaXModel.h:30