Effekseer
 全て クラス 関数 変数
Effekseer.h
1 
2 #ifndef __EFFEKSEER_BASE_PRE_H__
3 #define __EFFEKSEER_BASE_PRE_H__
4 
5 //----------------------------------------------------------------------------------
6 // Include
7 //----------------------------------------------------------------------------------
8 #include <stdio.h>
9 #include <string.h>
10 #include <atomic>
11 #include <stdint.h>
12 
13 //----------------------------------------------------------------------------------
14 //
15 //----------------------------------------------------------------------------------
16 #ifdef _WIN32
17 #define EFK_STDCALL __stdcall
18 #else
19 #define EFK_STDCALL
20 #endif
21 
22 //----------------------------------------------------------------------------------
23 //
24 //----------------------------------------------------------------------------------
25 
26 #ifdef _WIN32
27 #include <windows.h>
28 #elif defined(_PSVITA)
29 #include "Effekseer.PSVita.h"
30 #elif defined(_PS4)
31 #include "Effekseer.PS4.h"
32 #elif defined(_SWITCH)
33 #include "Effekseer.Switch.h"
34 #elif defined(_XBOXONE)
35 #include "Effekseer.XBoxOne.h"
36 #else
37 #include <unistd.h>
38 #include <pthread.h>
39 #include <sys/time.h>
40 #endif
41 
42 //----------------------------------------------------------------------------------
43 //
44 //----------------------------------------------------------------------------------
45 typedef uint16_t EFK_CHAR;
46 
47 //----------------------------------------------------------------------------------
48 //
49 //----------------------------------------------------------------------------------
50 namespace Effekseer
51 {
52 //----------------------------------------------------------------------------------
53 //
54 //----------------------------------------------------------------------------------
55 struct Vector2D;
56 struct Vector3D;
57 struct Matrix43;
58 struct Matrix44;
59 struct RectF;
60 
61 class Manager;
62 class Effect;
63 class EffectNode;
64 
65 class ParticleRenderer;
66 class SpriteRenderer;
67 class RibbonRenderer;
68 class RingRenderer;
69 class ModelRenderer;
70 class TrackRenderer;
71 
72 class Setting;
73 class EffectLoader;
74 class TextureLoader;
75 
76 class SoundPlayer;
77 class SoundLoader;
78 
79 class ModelLoader;
80 
81 class Model;
82 
83 typedef int Handle;
84 
88 typedef void* ( EFK_STDCALL *MallocFunc ) ( unsigned int size );
89 
93 typedef void ( EFK_STDCALL *FreeFunc ) ( void* p, unsigned int size );
94 
98 typedef int ( EFK_STDCALL *RandFunc ) (void);
99 
106 typedef void ( EFK_STDCALL *EffectInstanceRemovingCallback ) ( Manager* manager, Handle handle, bool isRemovingManager );
107 
108 #define ES_SAFE_ADDREF(val) if ( (val) != NULL ) { (val)->AddRef(); }
109 #define ES_SAFE_RELEASE(val) if ( (val) != NULL ) { (val)->Release(); (val) = NULL; }
110 #define ES_SAFE_DELETE(val) if ( (val) != NULL ) { delete (val); (val) = NULL; }
111 #define ES_SAFE_DELETE_ARRAY(val) if ( (val) != NULL ) { delete [] (val); (val) = NULL; }
112 
113 //----------------------------------------------------------------------------------
114 //
115 //----------------------------------------------------------------------------------
119 enum class AlphaBlendType : int32_t
120 {
124  Opacity = 0,
128  Blend = 1,
132  Add = 2,
136  Sub = 3,
140  Mul = 4,
141 };
142 
143 enum class TextureFilterType : int32_t
144 {
145  Nearest = 0,
146  Linear = 1,
147 };
148 
149 enum class TextureWrapType : int32_t
150 {
151  Repeat = 0,
152  Clamp = 1,
153 };
154 
155 enum class CullingType : int32_t
156 {
157  Front = 0,
158  Back = 1,
159  Double = 2,
160 };
161 
162 //----------------------------------------------------------------------------------
163 //
164 //----------------------------------------------------------------------------------
165 enum class BillboardType : int32_t
166 {
167  Billboard = 0,
168  YAxisFixed = 1,
169  Fixed = 2,
170  RotatedBillboard = 3,
171 };
172 
173 enum class CoordinateSystem : int32_t
174 {
175  LH,
176  RH,
177 };
178 
179 enum class CullingShape : int32_t
180 {
181  NoneShape = 0,
182  Sphere = 1,
183 };
184 
185 enum class TextureType : int32_t
186 {
187  Color,
188  Normal,
189  Distortion,
190 };
191 
192 enum class TextureFormatType : int32_t
193 {
194  ABGR8,
195  BC1,
196  BC2,
197  BC3,
198 };
199 
200 //----------------------------------------------------------------------------------
201 //
202 //----------------------------------------------------------------------------------
206 template <typename T,typename U>
207 T Max( T t, U u )
208 {
209  if( t > (T)u )
210  {
211  return t;
212  }
213  return u;
214 }
215 
219 template <typename T,typename U>
220 T Min( T t, U u )
221 {
222  if( t < (T)u )
223  {
224  return t;
225  }
226  return u;
227 }
228 
232 template <typename T,typename U,typename V>
233 T Clamp( T t, U max_, V min_ )
234 {
235  if( t > (T)max_ )
236  {
237  t = (T)max_;
238  }
239 
240  if( t < (T)min_ )
241  {
242  t = (T)min_;
243  }
244 
245  return t;
246 }
247 
248 //----------------------------------------------------------------------------------
249 //
250 //----------------------------------------------------------------------------------
251 inline float NormalizeAngle(float angle)
252 {
253  int32_t ofs = (*(int32_t*)&angle & 0x80000000) | 0x3F000000;
254  return (angle - ((int)(angle * 0.159154943f + *(float*)&ofs) * 6.283185307f));
255 }
256 
257 //----------------------------------------------------------------------------------
258 //
259 //----------------------------------------------------------------------------------
260 inline void SinCos(float x, float& s, float& c)
261 {
262  x = NormalizeAngle(x);
263  float x2 = x * x;
264  float x4 = x * x * x * x;
265  float x6 = x * x * x * x * x * x;
266  float x8 = x * x * x * x * x * x * x * x;
267  float x10 = x * x * x * x * x * x * x * x * x * x;
268  s = x * (1.0f - x2 / 6.0f + x4 / 120.0f - x6 / 5040.0f + x8 / 362880.0f - x10 / 39916800.0f);
269  c = 1.0f - x2 / 2.0f + x4 / 24.0f - x6 / 720.0f + x8 / 40320.0f - x10 / 3628800.0f;
270 }
271 
272 //----------------------------------------------------------------------------------
273 //
274 //----------------------------------------------------------------------------------
282 inline int32_t ConvertUtf16ToUtf8( int8_t* dst, int32_t dst_size, const int16_t* src )
283 {
284  int32_t cnt = 0;
285  const int16_t* wp = src;
286  int8_t* cp = dst;
287 
288  if (dst_size == 0) return 0;
289 
290  dst_size -= 3;
291 
292  for (cnt = 0; cnt < dst_size; )
293  {
294  int16_t wc = *wp++;
295  if (wc == 0)
296  {
297  break;
298  }
299  if ((wc & ~0x7f) == 0)
300  {
301  *cp++ = wc & 0x7f;
302  cnt += 1;
303  } else if ((wc & ~0x7ff) == 0)
304  {
305  *cp++ = ((wc >> 6) & 0x1f) | 0xc0;
306  *cp++ = ((wc) & 0x3f) | 0x80;
307  cnt += 2;
308  } else {
309  *cp++ = ((wc >> 12) & 0xf) | 0xe0;
310  *cp++ = ((wc >> 6) & 0x3f) | 0x80;
311  *cp++ = ((wc) & 0x3f) | 0x80;
312  cnt += 3;
313  }
314  }
315  *cp = '\0';
316  return cnt;
317 }
318 
326 inline int32_t ConvertUtf8ToUtf16( int16_t* dst, int32_t dst_size, const int8_t* src )
327 {
328  int32_t i, code;
329  int8_t c0, c1, c2;
330 
331  if (dst_size == 0) return 0;
332 
333  dst_size -= 1;
334 
335  for (i = 0; i < dst_size; i++)
336  {
337  int16_t wc;
338 
339  c0 = *src++;
340  if (c0 == '\0')
341  {
342  break;
343  }
344  // UTF8からUTF16に変換
345  code = (uint8_t)c0 >> 4;
346  if (code <= 7)
347  {
348  // 8bit文字
349  wc = c0;
350  }
351  else if (code >= 12 && code <= 13)
352  {
353  // 16bit文字
354  c1 = *src++;
355  wc = ((c0 & 0x1F) << 6) | (c1 & 0x3F);
356  }
357  else if (code == 14)
358  {
359  // 24bit文字
360  c1 = *src++;
361  c2 = *src++;
362  wc = ((c0 & 0x0F) << 12) | ((c1 & 0x3F) << 6) | (c2 & 0x3F);
363  }
364  else
365  {
366  continue;
367  }
368  dst[i] = wc;
369  }
370  dst[i] = 0;
371  return i;
372 }
373 
374 
375 //----------------------------------------------------------------------------------
376 //
377 //----------------------------------------------------------------------------------
382 {
383 public:
388  virtual int AddRef() = 0;
389 
394  virtual int GetRef() = 0;
395 
400  virtual int Release() = 0;
401 };
402 
403 //----------------------------------------------------------------------------------
404 //
405 //----------------------------------------------------------------------------------
410  : public IReference
411 {
412 private:
413  mutable std::atomic<int32_t> m_reference;
414 
415 public:
417  : m_reference(1)
418  {
419  }
420 
421  virtual ~ReferenceObject()
422  {}
423 
424  virtual int AddRef()
425  {
426  std::atomic_fetch_add_explicit(&m_reference, 1, std::memory_order_consume);
427 
428  return m_reference;
429  }
430 
431  virtual int GetRef()
432  {
433  return m_reference;
434  }
435 
436  virtual int Release()
437  {
438  bool destroy = std::atomic_fetch_sub_explicit(&m_reference, 1, std::memory_order_consume) == 1;
439  if (destroy)
440  {
441  delete this;
442  return 0;
443  }
444 
445  return m_reference;
446  }
447 };
448 //----------------------------------------------------------------------------------
449 //
450 //----------------------------------------------------------------------------------
456 {
457  int32_t Width;
458  int32_t Height;
459  TextureFormatType TextureFormat;
460  void* UserPtr;
461  int64_t UserID;
462 };
463 
464 //----------------------------------------------------------------------------------
465 //
466 //----------------------------------------------------------------------------------
467 }
468 //----------------------------------------------------------------------------------
469 //
470 //----------------------------------------------------------------------------------
471 #endif // __EFFEKSEER_BASE_PRE_H__
472 #ifndef __EFFEKSEER_VECTOR2D_H__
473 #define __EFFEKSEER_VECTOR2D_H__
474 
475 //----------------------------------------------------------------------------------
476 // Include
477 //----------------------------------------------------------------------------------
478 
479 //----------------------------------------------------------------------------------
480 //
481 //----------------------------------------------------------------------------------
482 namespace Effekseer {
483 //----------------------------------------------------------------------------------
484 //
485 //----------------------------------------------------------------------------------
489 struct Vector2D
490 {
491 public:
495  float X;
496 
500  float Y;
501 
505  Vector2D();
506 
510  Vector2D( float x, float y );
511 
512  Vector2D& operator+=( const Vector2D& value );
513 };
514 
515 //----------------------------------------------------------------------------------
516 //
517 //----------------------------------------------------------------------------------
518  }
519 //----------------------------------------------------------------------------------
520 //
521 //----------------------------------------------------------------------------------
522 #endif // __EFFEKSEER_VECTOR3D_H__
523 
524 #ifndef __EFFEKSEER_VECTOR3D_H__
525 #define __EFFEKSEER_VECTOR3D_H__
526 
527 //----------------------------------------------------------------------------------
528 // Include
529 //----------------------------------------------------------------------------------
530 
531 //----------------------------------------------------------------------------------
532 //
533 //----------------------------------------------------------------------------------
534 namespace Effekseer {
535 //----------------------------------------------------------------------------------
536 //
537 //----------------------------------------------------------------------------------
541 struct Vector3D
542 {
543 public:
547  float X;
548 
552  float Y;
553 
557  float Z;
558 
562  Vector3D();
563 
567  Vector3D( float x, float y, float z );
568 
569  Vector3D operator + ( const Vector3D& o ) const;
570 
571  Vector3D operator - ( const Vector3D& o ) const;
572 
573  Vector3D operator * ( const float& o ) const;
574 
575  Vector3D operator / ( const float& o ) const;
576 
577  Vector3D& operator += ( const Vector3D& o );
578 
579  Vector3D& operator -= ( const Vector3D& o );
580 
581  Vector3D& operator *= ( const float& o );
582 
583  Vector3D& operator /= ( const float& o );
584 
588  static void Add( Vector3D* pOut, const Vector3D* pIn1, const Vector3D* pIn2 );
589 
593  static Vector3D& Sub( Vector3D& o, const Vector3D& in1, const Vector3D& in2 );
594 
598  static float Length( const Vector3D& in );
599 
603  static float LengthSq( const Vector3D& in );
604 
608  static float Dot( const Vector3D& in1, const Vector3D& in2 );
609 
613  static void Normal( Vector3D& o, const Vector3D& in );
614 
621  static Vector3D& Cross( Vector3D& o, const Vector3D& in1, const Vector3D& in2 );
622 
623  static Vector3D& Transform( Vector3D& o, const Vector3D& in, const Matrix43& mat );
624 
625  static Vector3D& Transform( Vector3D& o, const Vector3D& in, const Matrix44& mat );
626 };
627 
628 //----------------------------------------------------------------------------------
629 //
630 //----------------------------------------------------------------------------------
631  }
632 //----------------------------------------------------------------------------------
633 //
634 //----------------------------------------------------------------------------------
635 #endif // __EFFEKSEER_VECTOR3D_H__
636 
637 #ifndef __EFFEKSEER_COLOR_H__
638 #define __EFFEKSEER_COLOR_H__
639 
640 //----------------------------------------------------------------------------------
641 // Include
642 //----------------------------------------------------------------------------------
643 
644 //----------------------------------------------------------------------------------
645 //
646 //----------------------------------------------------------------------------------
647 namespace Effekseer
648 {
649 //----------------------------------------------------------------------------------
650 //
651 //----------------------------------------------------------------------------------
652 enum ColorMode
653 {
654  COLOR_MODE_RGBA,
655  COLOR_MODE_HSVA,
656  COLOR_MODE_DWORD = 0x7FFFFFFF
657 };
658 
662 #pragma pack(push,1)
663 struct Color
664 {
668  uint8_t R;
669 
673  uint8_t G;
674 
678  uint8_t B;
679 
683  uint8_t A;
684 
688  Color();
689 
693  Color( uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255 );
694 
698  static void Mul( Color& o, const Color& in1, const Color& in2 );
699 };
700 #pragma pack(pop)
701 //----------------------------------------------------------------------------------
702 //
703 //----------------------------------------------------------------------------------
704 }
705 //----------------------------------------------------------------------------------
706 //
707 //----------------------------------------------------------------------------------
708 #endif // __EFFEKSEER_COLOR_H__
709 
710 #ifndef __EFFEKSEER_RECTF_H__
711 #define __EFFEKSEER_RECTF_H__
712 
713 //----------------------------------------------------------------------------------
714 // Include
715 //----------------------------------------------------------------------------------
716 
717 //----------------------------------------------------------------------------------
718 //
719 //----------------------------------------------------------------------------------
720 namespace Effekseer {
721 //----------------------------------------------------------------------------------
722 //
723 //----------------------------------------------------------------------------------
727 struct RectF
728 {
729 private:
730 
731 public:
732  float X;
733 
734  float Y;
735 
736  float Width;
737 
738  float Height;
739 
740  RectF();
741 
742  RectF( float x, float y, float width, float height );
743 
744  Vector2D Position() const;
745 
746  Vector2D Size() const;
747 };
748 
749 //----------------------------------------------------------------------------------
750 //
751 //----------------------------------------------------------------------------------
752  }
753 //----------------------------------------------------------------------------------
754 //
755 //----------------------------------------------------------------------------------
756 #endif // __EFFEKSEER_RECTF_H__
757 
758 #ifndef __EFFEKSEER_MATRIX43_H__
759 #define __EFFEKSEER_MATRIX43_H__
760 
761 //----------------------------------------------------------------------------------
762 // Include
763 //----------------------------------------------------------------------------------
764 
765 //----------------------------------------------------------------------------------
766 //
767 //----------------------------------------------------------------------------------
768 namespace Effekseer {
769 //----------------------------------------------------------------------------------
770 //
771 //----------------------------------------------------------------------------------
772 
783 #pragma pack(push,1)
784 struct Matrix43
785 {
786 private:
787 
788 public:
792  float Value[4][3];
793 
797  void Indentity();
798 
805  void Scaling( float x, float y, float z );
806 
811  void RotationX( float angle );
812 
817  void RotationY( float angle );
818 
823  void RotationZ( float angle );
824 
831  void RotationXYZ( float rx, float ry, float rz );
832 
839  void RotationZXY( float rz, float rx, float ry );
840 
846  void RotationAxis( const Vector3D& axis, float angle );
847 
854  void RotationAxis( const Vector3D& axis, float s, float c );
855 
862  void Translation( float x, float y, float z );
863 
870  void GetSRT( Vector3D& s, Matrix43& r, Vector3D& t ) const;
871 
876  void GetScale( Vector3D& s ) const;
877 
882  void GetRotation( Matrix43& r ) const;
883 
888  void GetTranslation( Vector3D& t ) const;
889 
896  void SetSRT( const Vector3D& s, const Matrix43& r, const Vector3D& t );
897 
904  static void Multiple( Matrix43& out, const Matrix43& in1, const Matrix43& in2 );
905 };
906 
907 #pragma pack(pop)
908 //----------------------------------------------------------------------------------
909 //
910 //----------------------------------------------------------------------------------
911  }
912 //----------------------------------------------------------------------------------
913 //
914 //----------------------------------------------------------------------------------
915 #endif // __EFFEKSEER_MATRIX43_H__
916 
917 #ifndef __EFFEKSEER_MATRIX44_H__
918 #define __EFFEKSEER_MATRIX44_H__
919 
920 //----------------------------------------------------------------------------------
921 // Include
922 //----------------------------------------------------------------------------------
923 
924 //----------------------------------------------------------------------------------
925 //
926 //----------------------------------------------------------------------------------
927 namespace Effekseer {
928 //----------------------------------------------------------------------------------
929 //
930 //----------------------------------------------------------------------------------
931 
943 #pragma pack(push,1)
944 struct Matrix44
945 {
946 private:
947 
948 public:
949 
953  Matrix44();
954 
958  float Values[4][4];
959 
963  Matrix44& Indentity();
964 
968  Matrix44& Transpose();
969 
973  Matrix44& LookAtRH( const Vector3D& eye, const Vector3D& at, const Vector3D& up );
974 
978  Matrix44& LookAtLH( const Vector3D& eye, const Vector3D& at, const Vector3D& up );
979 
983  Matrix44& PerspectiveFovRH( float ovY, float aspect, float zn, float zf );
984 
988  Matrix44& PerspectiveFovRH_OpenGL( float ovY, float aspect, float zn, float zf );
989 
993  Matrix44& PerspectiveFovLH( float ovY, float aspect, float zn, float zf );
994 
998  Matrix44& PerspectiveFovLH_OpenGL( float ovY, float aspect, float zn, float zf );
999 
1003  Matrix44& OrthographicRH( float width, float height, float zn, float zf );
1004 
1008  Matrix44& OrthographicLH( float width, float height, float zn, float zf );
1009 
1013  void Scaling( float x, float y, float z );
1014 
1018  void RotationX( float angle );
1019 
1023  void RotationY( float angle );
1024 
1028  void RotationZ( float angle );
1029 
1033  void Translation( float x, float y, float z );
1034 
1038  void RotationAxis( const Vector3D& axis, float angle );
1039 
1043  void Quaternion( float x, float y, float z, float w );
1044 
1048  static Matrix44& Mul( Matrix44& o, const Matrix44& in1, const Matrix44& in2 );
1049 
1053  static Matrix44& Inverse( Matrix44& o, const Matrix44& in );
1054 };
1055 
1056 #pragma pack(pop)
1057 //----------------------------------------------------------------------------------
1058 //
1059 //----------------------------------------------------------------------------------
1060  }
1061 //----------------------------------------------------------------------------------
1062 //
1063 //----------------------------------------------------------------------------------
1064 #endif // __EFFEKSEER_MATRIX44_H__
1065 
1066 #ifndef __EFFEKSEER_FILE_H__
1067 #define __EFFEKSEER_FILE_H__
1068 
1069 //----------------------------------------------------------------------------------
1070 // Include
1071 //----------------------------------------------------------------------------------
1072 
1073 //----------------------------------------------------------------------------------
1074 //
1075 //----------------------------------------------------------------------------------
1076 namespace Effekseer {
1077 //----------------------------------------------------------------------------------
1078 //
1079 //----------------------------------------------------------------------------------
1084 {
1085 private:
1086 
1087 public:
1088  FileReader() {}
1089 
1090  virtual ~FileReader() {}
1091 
1092  virtual size_t Read( void* buffer, size_t size ) = 0;
1093 
1094  virtual void Seek(int position) = 0;
1095 
1096  virtual int GetPosition() = 0;
1097 
1098  virtual size_t GetLength() = 0;
1099 };
1100 
1105 {
1106 private:
1107 
1108 public:
1109  FileWriter() {}
1110 
1111  virtual ~FileWriter() {}
1112 
1113  virtual size_t Write( const void* buffer, size_t size ) = 0;
1114 
1115  virtual void Flush() = 0;
1116 
1117  virtual void Seek(int position) = 0;
1118 
1119  virtual int GetPosition() = 0;
1120 
1121  virtual size_t GetLength() = 0;
1122 };
1123 
1128 {
1129 private:
1130 
1131 public:
1132  virtual FileReader* OpenRead( const EFK_CHAR* path ) = 0;
1133 
1134  virtual FileWriter* OpenWrite( const EFK_CHAR* path ) = 0;
1135 };
1136 
1137 //----------------------------------------------------------------------------------
1138 //
1139 //----------------------------------------------------------------------------------
1140  }
1141 //----------------------------------------------------------------------------------
1142 //
1143 //----------------------------------------------------------------------------------
1144 #endif // __EFFEKSEER_FILE_H__
1145 
1146 #ifndef __EFFEKSEER_DEFAULT_FILE_H__
1147 #define __EFFEKSEER_DEFAULT_FILE_H__
1148 
1149 //----------------------------------------------------------------------------------
1150 // Include
1151 //----------------------------------------------------------------------------------
1152 
1153 //----------------------------------------------------------------------------------
1154 //
1155 //----------------------------------------------------------------------------------
1156 namespace Effekseer {
1157 //----------------------------------------------------------------------------------
1158 //
1159 //----------------------------------------------------------------------------------
1165 {
1166 private:
1167  FILE* m_filePtr;
1168 
1169 public:
1170  DefaultFileReader( FILE* filePtr );
1171 
1172  ~DefaultFileReader();
1173 
1174  size_t Read( void* buffer, size_t size );
1175 
1176  void Seek( int position );
1177 
1178  int GetPosition();
1179 
1180  size_t GetLength();
1181 };
1182 
1184 {
1185 private:
1186  FILE* m_filePtr;
1187 
1188 public:
1189  DefaultFileWriter( FILE* filePtr );
1190 
1191  ~DefaultFileWriter();
1192 
1193  size_t Write( const void* buffer, size_t size );
1194 
1195  void Flush();
1196 
1197  void Seek( int position );
1198 
1199  int GetPosition();
1200 
1201  size_t GetLength();
1202 };
1203 
1205 {
1206 private:
1207 
1208 public:
1209  FileReader* OpenRead( const EFK_CHAR* path );
1210 
1211  FileWriter* OpenWrite( const EFK_CHAR* path );
1212 };
1213 
1214 
1215 //----------------------------------------------------------------------------------
1216 //
1217 //----------------------------------------------------------------------------------
1218  }
1219 //----------------------------------------------------------------------------------
1220 //
1221 //----------------------------------------------------------------------------------
1222 #endif // __EFFEKSEER_DEFAULT_FILE_H__
1223 
1224 #ifndef __EFFEKSEER_EFFECT_H__
1225 #define __EFFEKSEER_EFFECT_H__
1226 
1227 //----------------------------------------------------------------------------------
1228 // Include
1229 //----------------------------------------------------------------------------------
1230 
1231 //----------------------------------------------------------------------------------
1232 //
1233 //----------------------------------------------------------------------------------
1234 namespace Effekseer
1235 {
1236 //----------------------------------------------------------------------------------
1237 //
1238 //----------------------------------------------------------------------------------
1239 
1245 class Effect
1246  : public IReference
1247 {
1248 protected:
1249  Effect() {}
1250  ~Effect() {}
1251 
1252 public:
1253 
1263  static Effect* Create( Manager* manager, void* data, int32_t size, float magnification = 1.0f, const EFK_CHAR* materialPath = NULL );
1264 
1273  static Effect* Create( Manager* manager, const EFK_CHAR* path, float magnification = 1.0f, const EFK_CHAR* materialPath = NULL );
1274 
1284  static Effect* Create( Setting* setting, void* data, int32_t size, float magnification = 1.0f, const EFK_CHAR* materialPath = NULL );
1285 
1294  static Effect* Create( Setting* setting, const EFK_CHAR* path, float magnification = 1.0f, const EFK_CHAR* materialPath = NULL );
1295 
1299  static ::Effekseer::EffectLoader* CreateEffectLoader(::Effekseer::FileInterface* fileInterface = NULL);
1300 
1305  virtual Setting* GetSetting() const = 0;
1306 
1307  /* 拡大率を取得する。 */
1308  virtual float GetMaginification() const = 0;
1309 
1313  virtual int GetVersion() const = 0;
1314 
1320  virtual TextureData* GetColorImage( int n ) const = 0;
1321 
1325  virtual int32_t GetColorImageCount() const = 0;
1326 
1332  virtual TextureData* GetNormalImage(int n) const = 0;
1333 
1337  virtual int32_t GetNormalImageCount() const = 0;
1338 
1344  virtual TextureData* GetDistortionImage(int n) const = 0;
1345 
1349  virtual int32_t GetDistortionImageCount() const = 0;
1350 
1354  virtual void* GetWave( int n ) const = 0;
1355 
1359  virtual int32_t GetWaveCount() const = 0;
1360 
1364  virtual void* GetModel( int n ) const = 0;
1365 
1369  virtual int32_t GetModelCount() const = 0;
1370 
1374  virtual bool Reload( void* data, int32_t size, const EFK_CHAR* materialPath = NULL ) = 0;
1375 
1379  virtual bool Reload( const EFK_CHAR* path, const EFK_CHAR* materialPath = NULL ) = 0;
1380 
1392  virtual bool Reload( Manager* managers, int32_t managersCount, void* data, int32_t size, const EFK_CHAR* materialPath = NULL ) = 0;
1393 
1404  virtual bool Reload( Manager* managers, int32_t managersCount,const EFK_CHAR* path, const EFK_CHAR* materialPath = NULL ) = 0;
1405 
1409  virtual void ReloadResources( const EFK_CHAR* materialPath = NULL ) = 0;
1410 
1414  virtual void UnloadResources() = 0;
1415 
1419  virtual EffectNode* GetRoot() const = 0;
1420 };
1421 
1428 {
1429  int32_t ColorTextureIndex;
1430  AlphaBlendType AlphaBlend;
1431  TextureFilterType FilterType;
1432  TextureWrapType WrapType;
1433  bool ZWrite;
1434  bool ZTest;
1435  bool Distortion;
1436  float DistortionIntensity;
1437 };
1438 
1445 {
1446 public:
1447  EffectNode() {}
1448  virtual ~EffectNode(){}
1449 
1453  virtual Effect* GetEffect() const = 0;
1454 
1458  virtual int GetChildrenCount() const = 0;
1459 
1463  virtual EffectNode* GetChild(int index) const = 0;
1464 
1469 
1473  virtual void SetBasicRenderParameter(EffectBasicRenderParameter param) = 0;
1474 
1475 };
1476 
1477 //----------------------------------------------------------------------------------
1478 //
1479 //----------------------------------------------------------------------------------
1480 }
1481 //----------------------------------------------------------------------------------
1482 //
1483 //----------------------------------------------------------------------------------
1484 #endif // __EFFEKSEER_EFFECT_H__
1485 
1486 #ifndef __EFFEKSEER_MANAGER_H__
1487 #define __EFFEKSEER_MANAGER_H__
1488 
1489 //----------------------------------------------------------------------------------
1490 // Include
1491 //----------------------------------------------------------------------------------
1492 
1493 //----------------------------------------------------------------------------------
1494 //
1495 //----------------------------------------------------------------------------------
1496 namespace Effekseer
1497 {
1498 //----------------------------------------------------------------------------------
1499 //
1500 //----------------------------------------------------------------------------------
1501 
1505 class Manager
1506  : public IReference
1507 {
1508 protected:
1509  Manager() {}
1510  ~Manager() {}
1511 
1512 public:
1519  static Manager* Create( int instance_max, bool autoFlip = true );
1520 
1526  virtual void Destroy() = 0;
1527 
1531  virtual MallocFunc GetMallocFunc() const = 0;
1532 
1536  virtual void SetMallocFunc( MallocFunc func ) = 0;
1537 
1541  virtual FreeFunc GetFreeFunc() const = 0;
1542 
1546  virtual void SetFreeFunc( FreeFunc func ) = 0;
1547 
1551  virtual RandFunc GetRandFunc() const = 0;
1552 
1556  virtual void SetRandFunc( RandFunc func ) = 0;
1557 
1561  virtual int GetRandMax() const = 0;
1562 
1566  virtual void SetRandMax( int max_ ) = 0;
1567 
1572  virtual CoordinateSystem GetCoordinateSystem() const = 0;
1573 
1581  virtual void SetCoordinateSystem( CoordinateSystem coordinateSystem ) = 0;
1582 
1586  virtual SpriteRenderer* GetSpriteRenderer() = 0;
1587 
1591  virtual void SetSpriteRenderer( SpriteRenderer* renderer ) = 0;
1592 
1596  virtual RibbonRenderer* GetRibbonRenderer() = 0;
1597 
1601  virtual void SetRibbonRenderer( RibbonRenderer* renderer ) = 0;
1602 
1606  virtual RingRenderer* GetRingRenderer() = 0;
1607 
1611  virtual void SetRingRenderer( RingRenderer* renderer ) = 0;
1612 
1616  virtual ModelRenderer* GetModelRenderer() = 0;
1617 
1621  virtual void SetModelRenderer( ModelRenderer* renderer ) = 0;
1622 
1626  virtual TrackRenderer* GetTrackRenderer() = 0;
1627 
1631  virtual void SetTrackRenderer( TrackRenderer* renderer ) = 0;
1632 
1636  virtual Setting* GetSetting() = 0;
1637 
1642  virtual void SetSetting(Setting* setting) = 0;
1643 
1647  virtual EffectLoader* GetEffectLoader() = 0;
1648 
1652  virtual void SetEffectLoader( EffectLoader* effectLoader ) = 0;
1653 
1657  virtual TextureLoader* GetTextureLoader() = 0;
1658 
1662  virtual void SetTextureLoader( TextureLoader* textureLoader ) = 0;
1663 
1667  virtual SoundPlayer* GetSoundPlayer() = 0;
1668 
1672  virtual void SetSoundPlayer( SoundPlayer* soundPlayer ) = 0;
1673 
1677  virtual SoundLoader* GetSoundLoader() = 0;
1678 
1682  virtual void SetSoundLoader( SoundLoader* soundLoader ) = 0;
1683 
1687  virtual ModelLoader* GetModelLoader() = 0;
1688 
1692  virtual void SetModelLoader( ModelLoader* modelLoader ) = 0;
1693 
1698  virtual void StopEffect( Handle handle ) = 0;
1699 
1703  virtual void StopAllEffects() = 0;
1704 
1709  virtual void StopRoot( Handle handle ) = 0;
1710 
1715  virtual void StopRoot( Effect* effect ) = 0;
1716 
1722  virtual bool Exists( Handle handle ) = 0;
1723 
1733  virtual int32_t GetInstanceCount( Handle handle ) = 0;
1734 
1740  virtual Matrix43 GetMatrix( Handle handle ) = 0;
1741 
1747  virtual void SetMatrix( Handle handle, const Matrix43& mat ) = 0;
1748 
1754  virtual Vector3D GetLocation( Handle handle ) = 0;
1755 
1762  virtual void SetLocation( Handle handle, float x, float y, float z ) = 0;
1763 
1768  virtual void SetLocation( Handle handle, const Vector3D& location ) = 0;
1769 
1774  virtual void AddLocation( Handle handle, const Vector3D& location ) = 0;
1775 
1779  virtual void SetRotation( Handle handle, float x, float y, float z ) = 0;
1780 
1787  virtual void SetRotation( Handle handle, const Vector3D& axis, float angle ) = 0;
1788 
1796  virtual void SetScale( Handle handle, float x, float y, float z ) = 0;
1797 
1804  virtual void SetTargetLocation( Handle handle, float x, float y, float z ) = 0;
1805 
1810  virtual void SetTargetLocation( Handle handle, const Vector3D& location ) = 0;
1811 
1817  virtual Matrix43 GetBaseMatrix( Handle handle ) = 0;
1818 
1826  virtual void SetBaseMatrix( Handle handle, const Matrix43& mat ) = 0;
1827 
1833  virtual void SetRemovingCallback( Handle handle, EffectInstanceRemovingCallback callback ) = 0;
1834 
1840  virtual void SetShown( Handle handle, bool shown ) = 0;
1841 
1847  virtual void SetPaused( Handle handle, bool paused ) = 0;
1848 
1854  virtual void SetSpeed( Handle handle, float speed ) = 0;
1855 
1861  virtual void SetAutoDrawing( Handle handle, bool autoDraw ) = 0;
1862 
1866  virtual void Flip() = 0;
1867 
1872  virtual void Update( float deltaFrame = 1.0f ) = 0;
1873 
1879  virtual void BeginUpdate() = 0;
1880 
1886  virtual void EndUpdate() = 0;
1887 
1895  virtual void UpdateHandle( Handle handle, float deltaFrame = 1.0f ) = 0;
1896 
1900  virtual void Draw() = 0;
1901 
1905  virtual void DrawHandle( Handle handle ) = 0;
1906 
1915  virtual Handle Play( Effect* effect, float x, float y, float z ) = 0;
1916 
1920  virtual int GetUpdateTime() const = 0;
1921 
1925  virtual int GetDrawTime() const = 0;
1926 
1930  virtual int32_t GetRestInstancesCount() const = 0;
1931 
1939  virtual void CreateCullingWorld( float xsize, float ysize, float zsize, int32_t layerCount) = 0;
1940 
1946  virtual void CalcCulling(const Matrix44& cameraProjMat, bool isOpenGL) = 0;
1947 
1951  virtual void RessignCulling() = 0;
1952 };
1953 //----------------------------------------------------------------------------------
1954 //
1955 //----------------------------------------------------------------------------------
1956 }
1957 //----------------------------------------------------------------------------------
1958 //
1959 //----------------------------------------------------------------------------------
1960 #endif // __EFFEKSEER_MANAGER_H__
1961 
1962 #ifndef __EFFEKSEER_SPRITE_RENDERER_H__
1963 #define __EFFEKSEER_SPRITE_RENDERER_H__
1964 
1965 //----------------------------------------------------------------------------------
1966 // Include
1967 //----------------------------------------------------------------------------------
1968 
1969 //----------------------------------------------------------------------------------
1970 //
1971 //----------------------------------------------------------------------------------
1972 namespace Effekseer
1973 {
1974 //----------------------------------------------------------------------------------
1975 //
1976 //----------------------------------------------------------------------------------
1977 
1979 {
1980 public:
1981 
1983  {
1984  Effect* EffectPointer;
1985  int32_t ColorTextureIndex;
1986  AlphaBlendType AlphaBlend;
1987  TextureFilterType TextureFilter;
1988  TextureWrapType TextureWrap;
1989  bool ZTest;
1990  bool ZWrite;
1991  BillboardType Billboard;
1992 
1993  bool Distortion;
1994  float DistortionIntensity;
1995  };
1996 
1998  {
1999  Matrix43 SRTMatrix43;
2000  Color AllColor;
2001 
2002  // 左下、右下、左上、右上
2003  Color Colors[4];
2004 
2005  Vector2D Positions[4];
2006 
2007  RectF UV;
2008  };
2009 
2010 public:
2011  SpriteRenderer() {}
2012 
2013  virtual ~SpriteRenderer() {}
2014 
2015  virtual void BeginRendering( const NodeParameter& parameter, int32_t count, void* userData ) {}
2016 
2017  virtual void Rendering( const NodeParameter& parameter, const InstanceParameter& instanceParameter, void* userData ) {}
2018 
2019  virtual void EndRendering( const NodeParameter& parameter, void* userData ) {}
2020 };
2021 
2022 //----------------------------------------------------------------------------------
2023 //
2024 //----------------------------------------------------------------------------------
2025 }
2026 //----------------------------------------------------------------------------------
2027 //
2028 //----------------------------------------------------------------------------------
2029 #endif // __EFFEKSEER_SPRITE_RENDERER_H__
2030 
2031 #ifndef __EFFEKSEER_RIBBON_RENDERER_H__
2032 #define __EFFEKSEER_RIBBON_RENDERER_H__
2033 
2034 //----------------------------------------------------------------------------------
2035 // Include
2036 //----------------------------------------------------------------------------------
2037 
2038 //----------------------------------------------------------------------------------
2039 //
2040 //----------------------------------------------------------------------------------
2041 namespace Effekseer
2042 {
2043 //----------------------------------------------------------------------------------
2044 //
2045 //----------------------------------------------------------------------------------
2046 
2048 {
2049 public:
2050 
2052  {
2053  Effect* EffectPointer;
2054  int32_t ColorTextureIndex;
2055  AlphaBlendType AlphaBlend;
2056  TextureFilterType TextureFilter;
2057  TextureWrapType TextureWrap;
2058  bool ZTest;
2059  bool ZWrite;
2060  bool ViewpointDependent;
2061 
2062  bool Distortion;
2063  float DistortionIntensity;
2064  };
2065 
2067  {
2068  int32_t InstanceCount;
2069  int32_t InstanceIndex;
2070  Matrix43 SRTMatrix43;
2071  Color AllColor;
2072 
2073  // 左、右
2074  Color Colors[2];
2075 
2076  float Positions[2];
2077 
2078  RectF UV;
2079  };
2080 
2081 public:
2082  RibbonRenderer() {}
2083 
2084  virtual ~RibbonRenderer() {}
2085 
2086  virtual void BeginRendering( const NodeParameter& parameter, int32_t count, void* userData ) {}
2087 
2088  virtual void Rendering( const NodeParameter& parameter, const InstanceParameter& instanceParameter, void* userData ) {}
2089 
2090  virtual void EndRendering( const NodeParameter& parameter, void* userData ) {}
2091 };
2092 
2093 //----------------------------------------------------------------------------------
2094 //
2095 //----------------------------------------------------------------------------------
2096 }
2097 //----------------------------------------------------------------------------------
2098 //
2099 //----------------------------------------------------------------------------------
2100 #endif // __EFFEKSEER_RIBBON_RENDERER_H__
2101 
2102 #ifndef __EFFEKSEER_RING_RENDERER_H__
2103 #define __EFFEKSEER_RING_RENDERER_H__
2104 
2105 //----------------------------------------------------------------------------------
2106 // Include
2107 //----------------------------------------------------------------------------------
2108 
2109 //----------------------------------------------------------------------------------
2110 //
2111 //----------------------------------------------------------------------------------
2112 namespace Effekseer
2113 {
2114 //----------------------------------------------------------------------------------
2115 //
2116 //----------------------------------------------------------------------------------
2117 
2119 {
2120 public:
2121 
2123  {
2124  Effect* EffectPointer;
2125  int32_t ColorTextureIndex;
2126  AlphaBlendType AlphaBlend;
2127  TextureFilterType TextureFilter;
2128  TextureWrapType TextureWrap;
2129  bool ZTest;
2130  bool ZWrite;
2131  BillboardType Billboard;
2132  int32_t VertexCount;
2133 
2134  bool Distortion;
2135  float DistortionIntensity;
2136  };
2137 
2139  {
2140  Matrix43 SRTMatrix43;
2141  float ViewingAngle;
2142  Vector2D OuterLocation;
2143  Vector2D InnerLocation;
2144  float CenterRatio;
2145  Color OuterColor;
2146  Color CenterColor;
2147  Color InnerColor;
2148 
2149  RectF UV;
2150  };
2151 
2152 public:
2153  RingRenderer() {}
2154 
2155  virtual ~RingRenderer() {}
2156 
2157  virtual void BeginRendering( const NodeParameter& parameter, int32_t count, void* userData ) {}
2158 
2159  virtual void Rendering( const NodeParameter& parameter, const InstanceParameter& instanceParameter, void* userData ) {}
2160 
2161  virtual void EndRendering( const NodeParameter& parameter, void* userData ) {}
2162 };
2163 
2164 //----------------------------------------------------------------------------------
2165 //
2166 //----------------------------------------------------------------------------------
2167 }
2168 //----------------------------------------------------------------------------------
2169 //
2170 //----------------------------------------------------------------------------------
2171 #endif // __EFFEKSEER_RING_RENDERER_H__
2172 
2173 #ifndef __EFFEKSEER_MODEL_RENDERER_H__
2174 #define __EFFEKSEER_MODEL_RENDERER_H__
2175 
2176 //----------------------------------------------------------------------------------
2177 // Include
2178 //----------------------------------------------------------------------------------
2179 
2180 //----------------------------------------------------------------------------------
2181 //
2182 //----------------------------------------------------------------------------------
2183 namespace Effekseer
2184 {
2185 //----------------------------------------------------------------------------------
2186 //
2187 //----------------------------------------------------------------------------------
2188 
2190 {
2191 public:
2192 
2194  {
2195  Effect* EffectPointer;
2196  AlphaBlendType AlphaBlend;
2197  TextureFilterType TextureFilter;
2198  TextureWrapType TextureWrap;
2199  bool ZTest;
2200  bool ZWrite;
2201  bool Lighting;
2202  CullingType Culling;
2203  int32_t ModelIndex;
2204  int32_t ColorTextureIndex;
2205  int32_t NormalTextureIndex;
2206  float Magnification;
2207  bool IsRightHand;
2208 
2209  bool Distortion;
2210  float DistortionIntensity;
2211  };
2212 
2214  {
2215  Matrix43 SRTMatrix43;
2216  RectF UV;
2217  Color AllColor;
2218  };
2219 
2220 public:
2221  ModelRenderer() {}
2222 
2223  virtual ~ModelRenderer() {}
2224 
2225  virtual void BeginRendering( const NodeParameter& parameter, int32_t count, void* userData ) {}
2226 
2227  virtual void Rendering( const NodeParameter& parameter, const InstanceParameter& instanceParameter, void* userData ) {}
2228 
2229  virtual void EndRendering( const NodeParameter& parameter, void* userData ) {}
2230 };
2231 
2232 //----------------------------------------------------------------------------------
2233 //
2234 //----------------------------------------------------------------------------------
2235 }
2236 //----------------------------------------------------------------------------------
2237 //
2238 //----------------------------------------------------------------------------------
2239 #endif // __EFFEKSEER_MODEL_RENDERER_H__
2240 
2241 #ifndef __EFFEKSEER_TRACK_RENDERER_H__
2242 #define __EFFEKSEER_TRACK_RENDERER_H__
2243 
2244 //----------------------------------------------------------------------------------
2245 // Include
2246 //----------------------------------------------------------------------------------
2247 
2248 //----------------------------------------------------------------------------------
2249 //
2250 //----------------------------------------------------------------------------------
2251 namespace Effekseer
2252 {
2253 //----------------------------------------------------------------------------------
2254 //
2255 //----------------------------------------------------------------------------------
2256 
2258 {
2259 public:
2260 
2262  {
2263  Effect* EffectPointer;
2264  int32_t ColorTextureIndex;
2265  AlphaBlendType AlphaBlend;
2266  TextureFilterType TextureFilter;
2267  TextureWrapType TextureWrap;
2268  bool ZTest;
2269  bool ZWrite;
2270 
2271  bool Distortion;
2272  float DistortionIntensity;
2273  };
2274 
2276  {
2277 
2278  };
2279 
2281  {
2282  int32_t InstanceCount;
2283  int32_t InstanceIndex;
2284  Matrix43 SRTMatrix43;
2285 
2286  Color ColorLeft;
2287  Color ColorCenter;
2288  Color ColorRight;
2289 
2290  Color ColorLeftMiddle;
2291  Color ColorCenterMiddle;
2292  Color ColorRightMiddle;
2293 
2294  float SizeFor;
2295  float SizeMiddle;
2296  float SizeBack;
2297 
2298  RectF UV;
2299  };
2300 
2301 public:
2302  TrackRenderer() {}
2303 
2304  virtual ~TrackRenderer() {}
2305 
2306  virtual void BeginRendering( const NodeParameter& parameter, int32_t count, void* userData ) {}
2307 
2308  virtual void Rendering( const NodeParameter& parameter, const InstanceParameter& instanceParameter, void* userData ) {}
2309 
2310  virtual void EndRendering( const NodeParameter& parameter, void* userData ) {}
2311 };
2312 
2313 //----------------------------------------------------------------------------------
2314 //
2315 //----------------------------------------------------------------------------------
2316 }
2317 //----------------------------------------------------------------------------------
2318 //
2319 //----------------------------------------------------------------------------------
2320 #endif // __EFFEKSEER_TRACK_RENDERER_H__
2321 
2322 #ifndef __EFFEKSEER_EFFECTLOADER_H__
2323 #define __EFFEKSEER_EFFECTLOADER_H__
2324 
2325 //----------------------------------------------------------------------------------
2326 // Include
2327 //----------------------------------------------------------------------------------
2328 
2329 //----------------------------------------------------------------------------------
2330 //
2331 //----------------------------------------------------------------------------------
2332 namespace Effekseer {
2333 //----------------------------------------------------------------------------------
2334 //
2335 //----------------------------------------------------------------------------------
2340 {
2341 public:
2346 
2350  virtual ~EffectLoader() {}
2351 
2362  virtual bool Load( const EFK_CHAR* path, void*& data, int32_t& size ) = 0;
2363 
2372  virtual void Unload( void* data, int32_t size ) = 0;
2373 };
2374 
2375 //----------------------------------------------------------------------------------
2376 //
2377 //----------------------------------------------------------------------------------
2378  }
2379 //----------------------------------------------------------------------------------
2380 //
2381 //----------------------------------------------------------------------------------
2382 #endif // __EFFEKSEER_EFFECTLOADER_H__
2383 
2384 #ifndef __EFFEKSEER_TEXTURELOADER_H__
2385 #define __EFFEKSEER_TEXTURELOADER_H__
2386 
2387 //----------------------------------------------------------------------------------
2388 // Include
2389 //----------------------------------------------------------------------------------
2390 
2391 //----------------------------------------------------------------------------------
2392 //
2393 //----------------------------------------------------------------------------------
2394 namespace Effekseer {
2395 //----------------------------------------------------------------------------------
2396 //
2397 //----------------------------------------------------------------------------------
2402 {
2403 public:
2408 
2412  virtual ~TextureLoader() {}
2413 
2423  virtual TextureData* Load( const EFK_CHAR* path, TextureType textureType ) { return nullptr; }
2424 
2432  virtual void Unload(TextureData* data ) {}
2433 };
2434 
2435 //----------------------------------------------------------------------------------
2436 //
2437 //----------------------------------------------------------------------------------
2438  }
2439 //----------------------------------------------------------------------------------
2440 //
2441 //----------------------------------------------------------------------------------
2442 #endif // __EFFEKSEER_TEXTURELOADER_H__
2443 
2444 #ifndef __EFFEKSEER_MODELLOADER_H__
2445 #define __EFFEKSEER_MODELLOADER_H__
2446 
2447 //----------------------------------------------------------------------------------
2448 // Include
2449 //----------------------------------------------------------------------------------
2450 
2451 //----------------------------------------------------------------------------------
2452 //
2453 //----------------------------------------------------------------------------------
2454 namespace Effekseer {
2455 //----------------------------------------------------------------------------------
2456 //
2457 //----------------------------------------------------------------------------------
2462 {
2463 public:
2468 
2472  virtual ~ModelLoader() {}
2473 
2482  virtual void* Load( const EFK_CHAR* path ) { return NULL; }
2483 
2491  virtual void Unload( void* data ) {}
2492 };
2493 
2494 //----------------------------------------------------------------------------------
2495 //
2496 //----------------------------------------------------------------------------------
2497  }
2498 //----------------------------------------------------------------------------------
2499 //
2500 //----------------------------------------------------------------------------------
2501 #endif // __EFFEKSEER_MODELLOADER_H__
2502 
2503 #ifndef __EFFEKSEER_MODEL_H__
2504 #define __EFFEKSEER_MODEL_H__
2505 
2506 //----------------------------------------------------------------------------------
2507 // Include
2508 //----------------------------------------------------------------------------------
2509 
2510 //----------------------------------------------------------------------------------
2511 //
2512 //----------------------------------------------------------------------------------
2513 namespace Effekseer {
2514 //----------------------------------------------------------------------------------
2515 //
2516 //----------------------------------------------------------------------------------
2520 class Model
2521 {
2522 public:
2523  static const int32_t Version = 1;
2524 
2525  struct Vertex
2526  {
2527  Vector3D Position;
2528  Vector3D Normal;
2529  Vector3D Binormal;
2530  Vector3D Tangent;
2531  Vector2D UV;
2532  Color VColor;
2533  };
2534 
2536  {
2537  Vector3D Position;
2538  Vector3D Normal;
2539  Vector3D Binormal;
2540  Vector3D Tangent;
2541  Vector2D UV;
2542  Color VColor;
2543  uint8_t Index[4];
2544  };
2545 
2546  struct Face
2547  {
2548  int32_t Indexes[3];
2549  };
2550 
2551  struct Emitter
2552  {
2553  Vector3D Position;
2554  Vector3D Normal;
2555  Vector3D Binormal;
2556  Vector3D Tangent;
2557  };
2558 
2559 private:
2560  uint8_t* m_data;
2561  int32_t m_size;
2562 
2563  int32_t m_version;
2564 
2565  int32_t m_vertexCount;
2566  Vertex* m_vertexes;
2567 
2568  int32_t m_faceCount;
2569  Face* m_faces;
2570 
2571  int32_t m_modelCount;
2572 
2573 public:
2577  Model( void* data, int32_t size )
2578  : m_data ( NULL )
2579  , m_size ( size )
2580  , m_version ( 0 )
2581  , m_vertexCount ( 0 )
2582  , m_vertexes ( NULL )
2583  , m_faceCount ( 0 )
2584  , m_faces ( NULL )
2585  {
2586  m_data = new uint8_t[m_size];
2587  memcpy( m_data, data, m_size );
2588 
2589  uint8_t* p = (uint8_t*)m_data;
2590 
2591  memcpy( &m_version, p, sizeof(int32_t) );
2592  p += sizeof(int32_t);
2593 
2594  if (m_version >= 2)
2595  {
2596  // Scale
2597  p += sizeof(int32_t);
2598  }
2599 
2600  memcpy( &m_modelCount, p, sizeof(int32_t) );
2601  p += sizeof(int32_t);
2602 
2603  memcpy( &m_vertexCount, p, sizeof(int32_t) );
2604  p += sizeof(int32_t);
2605 
2606  if (m_version >= 1)
2607  {
2608  m_vertexes = (Vertex*) p;
2609  p += (sizeof(Vertex) * m_vertexCount);
2610  }
2611  else
2612  {
2613  // 新規バッファ確保
2614  m_vertexes = new Vertex[m_vertexCount];
2615 
2616  for (int32_t i = 0; i < m_vertexCount; i++)
2617  {
2618  memcpy(&m_vertexes[i], p, sizeof(Vertex) - sizeof(Color));
2619  m_vertexes[i].VColor = Color(255, 255, 255, 255);
2620 
2621  p += sizeof(Vertex) - sizeof(Color);
2622  }
2623  }
2624 
2625  memcpy( &m_faceCount, p, sizeof(int32_t) );
2626  p += sizeof(int32_t);
2627 
2628  m_faces = (Face*)p;
2629  p += ( sizeof(Face) * m_faceCount );
2630  }
2631 
2632  Vertex* GetVertexes() const { return m_vertexes; }
2633  int32_t GetVertexCount() { return m_vertexCount; }
2634 
2635  Face* GetFaces() const { return m_faces; }
2636  int32_t GetFaceCount() { return m_faceCount; }
2637 
2638  int32_t GetModelCount() { return m_modelCount; }
2639 
2643  virtual ~Model()
2644  {
2645  if (m_version == 0)
2646  {
2647  ES_SAFE_DELETE_ARRAY(m_vertexes);
2648  }
2649 
2650  ES_SAFE_DELETE_ARRAY( m_data );
2651  }
2652 
2653  Emitter GetEmitter( Manager* manager, CoordinateSystem coordinate, float magnification )
2654  {
2655  RandFunc randFunc = manager->GetRandFunc();
2656  int32_t randMax = manager->GetRandMax();
2657 
2658  int32_t faceInd = (int32_t)( (GetFaceCount() - 1) * ( (float)randFunc() / (float)randMax ) );
2659  faceInd = Clamp( faceInd, GetFaceCount() - 1, 0 );
2660  Face& face = GetFaces()[faceInd];
2661  Vertex& v0 = GetVertexes()[face.Indexes[0]];
2662  Vertex& v1 = GetVertexes()[face.Indexes[1]];
2663  Vertex& v2 = GetVertexes()[face.Indexes[2]];
2664 
2665  float p1 = ( (float)randFunc() / (float)randMax );
2666  float p2 = ( (float)randFunc() / (float)randMax );
2667 
2668  /* 面内に収める */
2669  if( p1 + p2 > 1.0f )
2670  {
2671  p1 = 1.0f - p1;
2672  p2 = 1.0f - p2;
2673  }
2674 
2675  float p0 = 1.0f - p1 - p2;
2676 
2677  Emitter emitter;
2678  emitter.Position = (v0.Position * p0 + v1.Position * p1 + v2.Position * p2) * magnification;
2679  emitter.Normal = v0.Normal * p0 + v1.Normal * p1 + v2.Normal * p2;
2680  emitter.Binormal = v0.Binormal * p0 + v1.Binormal * p1 + v2.Binormal * p2;
2681  emitter.Tangent = v0.Tangent * p0 + v1.Tangent * p1 + v2.Tangent * p2;
2682 
2683  if( coordinate == CoordinateSystem::LH )
2684  {
2685  emitter.Position.Z = - emitter.Position.Z;
2686  emitter.Normal.Z = - emitter.Normal.Z;
2687  emitter.Binormal.Z = - emitter.Binormal.Z;
2688  emitter.Tangent.Z = - emitter.Tangent.Z;
2689  }
2690 
2691  return emitter;
2692  }
2693 
2694  Emitter GetEmitterFromVertex( Manager* manager, CoordinateSystem coordinate, float magnification )
2695  {
2696  RandFunc randFunc = manager->GetRandFunc();
2697  int32_t randMax = manager->GetRandMax();
2698 
2699  int32_t vertexInd = (int32_t)( (GetVertexCount() - 1) * ( (float)randFunc() / (float)randMax ) );
2700  vertexInd = Clamp( vertexInd, GetVertexCount() - 1, 0 );
2701  Vertex& v = GetVertexes()[vertexInd];
2702 
2703  Emitter emitter;
2704  emitter.Position = v.Position * magnification;
2705  emitter.Normal = v.Normal;
2706  emitter.Binormal = v.Binormal;
2707  emitter.Tangent = v.Tangent;
2708 
2709  if( coordinate == CoordinateSystem::LH )
2710  {
2711  emitter.Position.Z = - emitter.Position.Z;
2712  emitter.Normal.Z = - emitter.Normal.Z;
2713  emitter.Binormal.Z = - emitter.Binormal.Z;
2714  emitter.Tangent.Z = - emitter.Tangent.Z;
2715  }
2716 
2717  return emitter;
2718  }
2719 
2720  Emitter GetEmitterFromVertex( int32_t index, CoordinateSystem coordinate, float magnification )
2721  {
2722  int32_t vertexInd = index % GetVertexCount();
2723  Vertex& v = GetVertexes()[vertexInd];
2724 
2725  Emitter emitter;
2726  emitter.Position = v.Position * magnification;
2727  emitter.Normal = v.Normal;
2728  emitter.Binormal = v.Binormal;
2729  emitter.Tangent = v.Tangent;
2730 
2731  if( coordinate == CoordinateSystem::LH )
2732  {
2733  emitter.Position.Z = - emitter.Position.Z;
2734  emitter.Normal.Z = - emitter.Normal.Z;
2735  emitter.Binormal.Z = - emitter.Binormal.Z;
2736  emitter.Tangent.Z = - emitter.Tangent.Z;
2737  }
2738 
2739  return emitter;
2740  }
2741 
2742  Emitter GetEmitterFromFace( Manager* manager, CoordinateSystem coordinate, float magnification )
2743  {
2744  RandFunc randFunc = manager->GetRandFunc();
2745  int32_t randMax = manager->GetRandMax();
2746 
2747  int32_t faceInd = (int32_t)( (GetFaceCount() - 1) * ( (float)randFunc() / (float)randMax ) );
2748  faceInd = Clamp( faceInd, GetFaceCount() - 1, 0 );
2749  Face& face = GetFaces()[faceInd];
2750  Vertex& v0 = GetVertexes()[face.Indexes[0]];
2751  Vertex& v1 = GetVertexes()[face.Indexes[1]];
2752  Vertex& v2 = GetVertexes()[face.Indexes[2]];
2753 
2754  float p0 = 1.0f / 3.0f;
2755  float p1 = 1.0f / 3.0f;
2756  float p2 = 1.0f / 3.0f;
2757 
2758  Emitter emitter;
2759  emitter.Position = (v0.Position * p0 + v1.Position * p1 + v2.Position * p2) * magnification;
2760  emitter.Normal = v0.Normal * p0 + v1.Normal * p1 + v2.Normal * p2;
2761  emitter.Binormal = v0.Binormal * p0 + v1.Binormal * p1 + v2.Binormal * p2;
2762  emitter.Tangent = v0.Tangent * p0 + v1.Tangent * p1 + v2.Tangent * p2;
2763 
2764  if( coordinate == CoordinateSystem::LH )
2765  {
2766  emitter.Position.Z = - emitter.Position.Z;
2767  emitter.Normal.Z = - emitter.Normal.Z;
2768  emitter.Binormal.Z = - emitter.Binormal.Z;
2769  emitter.Tangent.Z = - emitter.Tangent.Z;
2770  }
2771 
2772  return emitter;
2773  }
2774 
2775  Emitter GetEmitterFromFace( int32_t index, CoordinateSystem coordinate, float magnification )
2776  {
2777  int32_t faceInd = index % (GetFaceCount() - 1);
2778  Face& face = GetFaces()[faceInd];
2779  Vertex& v0 = GetVertexes()[face.Indexes[0]];
2780  Vertex& v1 = GetVertexes()[face.Indexes[1]];
2781  Vertex& v2 = GetVertexes()[face.Indexes[2]];
2782 
2783  float p0 = 1.0f / 3.0f;
2784  float p1 = 1.0f / 3.0f;
2785  float p2 = 1.0f / 3.0f;
2786 
2787  Emitter emitter;
2788  emitter.Position = (v0.Position * p0 + v1.Position * p1 + v2.Position * p2) * magnification;
2789  emitter.Normal = v0.Normal * p0 + v1.Normal * p1 + v2.Normal * p2;
2790  emitter.Binormal = v0.Binormal * p0 + v1.Binormal * p1 + v2.Binormal * p2;
2791  emitter.Tangent = v0.Tangent * p0 + v1.Tangent * p1 + v2.Tangent * p2;
2792 
2793  if( coordinate == CoordinateSystem::LH )
2794  {
2795  emitter.Position.Z = - emitter.Position.Z;
2796  emitter.Normal.Z = - emitter.Normal.Z;
2797  emitter.Binormal.Z = - emitter.Binormal.Z;
2798  emitter.Tangent.Z = - emitter.Tangent.Z;
2799  }
2800 
2801  return emitter;
2802  }
2803 };
2804 
2805 //----------------------------------------------------------------------------------
2806 //
2807 //----------------------------------------------------------------------------------
2808  }
2809 //----------------------------------------------------------------------------------
2810 //
2811 //----------------------------------------------------------------------------------
2812 #endif // __EFFEKSEER_MODEL_H__
2813 
2814 #ifndef __EFFEKSEER_SOUND_PLAYER_H__
2815 #define __EFFEKSEER_SOUND_PLAYER_H__
2816 
2817 //----------------------------------------------------------------------------------
2818 // Include
2819 //----------------------------------------------------------------------------------
2820 
2821 //----------------------------------------------------------------------------------
2822 //
2823 //----------------------------------------------------------------------------------
2824 namespace Effekseer
2825 {
2826 //----------------------------------------------------------------------------------
2827 //
2828 //----------------------------------------------------------------------------------
2829 
2830 typedef void* SoundHandle;
2831 typedef void* SoundTag;
2832 
2834 {
2835 public:
2837  {
2838  void* Data;
2839  float Volume;
2840  float Pan;
2841  float Pitch;
2842  bool Mode3D;
2843  Vector3D Position;
2844  float Distance;
2845  };
2846 
2847 public:
2848  SoundPlayer() {}
2849 
2850  virtual ~SoundPlayer() {}
2851 
2852  virtual SoundHandle Play( SoundTag tag, const InstanceParameter& parameter ) = 0;
2853 
2854  virtual void Stop( SoundHandle handle, SoundTag tag ) = 0;
2855 
2856  virtual void Pause( SoundHandle handle, SoundTag tag, bool pause ) = 0;
2857 
2858  virtual bool CheckPlaying( SoundHandle handle, SoundTag tag ) = 0;
2859 
2860  virtual void StopTag( SoundTag tag ) = 0;
2861 
2862  virtual void PauseTag( SoundTag tag, bool pause ) = 0;
2863 
2864  virtual bool CheckPlayingTag( SoundTag tag ) = 0;
2865 
2866  virtual void StopAll() = 0;
2867 };
2868 
2869 //----------------------------------------------------------------------------------
2870 //
2871 //----------------------------------------------------------------------------------
2872 }
2873 //----------------------------------------------------------------------------------
2874 //
2875 //----------------------------------------------------------------------------------
2876 #endif // __EFFEKSEER_SOUND_PLAYER_H__
2877 
2878 #ifndef __EFFEKSEER_SOUNDLOADER_H__
2879 #define __EFFEKSEER_SOUNDLOADER_H__
2880 
2881 //----------------------------------------------------------------------------------
2882 // Include
2883 //----------------------------------------------------------------------------------
2884 
2885 //----------------------------------------------------------------------------------
2886 //
2887 //----------------------------------------------------------------------------------
2888 namespace Effekseer {
2889 //----------------------------------------------------------------------------------
2890 //
2891 //----------------------------------------------------------------------------------
2896 {
2897 public:
2902 
2906  virtual ~SoundLoader() {}
2907 
2916  virtual void* Load( const EFK_CHAR* path ) { return NULL; }
2917 
2925  virtual void Unload( void* source ) {}
2926 };
2927 
2928 //----------------------------------------------------------------------------------
2929 //
2930 //----------------------------------------------------------------------------------
2931  }
2932 //----------------------------------------------------------------------------------
2933 //
2934 //----------------------------------------------------------------------------------
2935 #endif // __EFFEKSEER_SOUNDLOADER_H__
2936 
2937 #ifndef __EFFEKSEER_LOADER_H__
2938 #define __EFFEKSEER_LOADER_H__
2939 
2940 //----------------------------------------------------------------------------------
2941 // Include
2942 //----------------------------------------------------------------------------------
2943 
2944 //----------------------------------------------------------------------------------
2945 //
2946 //----------------------------------------------------------------------------------
2947 namespace Effekseer {
2948 //----------------------------------------------------------------------------------
2949 //
2950 //----------------------------------------------------------------------------------
2957  class Setting
2958  : public ReferenceObject
2959  {
2960  private:
2961  /* 座標系 */
2962  CoordinateSystem m_coordinateSystem;
2963 
2964  EffectLoader* m_effectLoader;
2965  TextureLoader* m_textureLoader;
2966  SoundLoader* m_soundLoader;
2967  ModelLoader* m_modelLoader;
2968 
2969  protected:
2973  Setting();
2974 
2978  ~Setting();
2979  public:
2980 
2984  static Setting* Create();
2985 
2990  CoordinateSystem GetCoordinateSystem() const;
2991 
2999  void SetCoordinateSystem(CoordinateSystem coordinateSystem);
3000 
3006 
3011  void SetEffectLoader(EffectLoader* loader);
3012 
3018 
3023  void SetTextureLoader(TextureLoader* loader);
3024 
3030 
3035  void SetModelLoader(ModelLoader* loader);
3036 
3042 
3047  void SetSoundLoader(SoundLoader* loader);
3048  };
3049 
3050 //----------------------------------------------------------------------------------
3051 //
3052 //----------------------------------------------------------------------------------
3053  }
3054 //----------------------------------------------------------------------------------
3055 //
3056 //----------------------------------------------------------------------------------
3057 #endif // __EFFEKSEER_LOADER_H__
3058 
3059 #ifndef __EFFEKSEER_SERVER_H__
3060 #define __EFFEKSEER_SERVER_H__
3061 
3062 #if !( defined(_PSVITA) || defined(_PS4) || defined(_SWITCH) || defined(_XBOXONE) )
3063 
3064 //----------------------------------------------------------------------------------
3065 // Include
3066 //----------------------------------------------------------------------------------
3067 
3068 //----------------------------------------------------------------------------------
3069 //
3070 //----------------------------------------------------------------------------------
3071 namespace Effekseer {
3072 //----------------------------------------------------------------------------------
3073 //
3074 //----------------------------------------------------------------------------------
3075 class Server
3076 {
3077 public:
3078 
3079  Server() {}
3080  virtual ~Server() {}
3081 
3082  static Server* Create();
3083 
3087  virtual bool Start( uint16_t port ) = 0;
3088 
3089  virtual void Stop() = 0;
3090 
3096  virtual void Regist( const EFK_CHAR* key, Effect* effect ) = 0;
3097 
3102  virtual void Unregist( Effect* effect ) = 0;
3103 
3107  virtual void Update() = 0;
3108 
3112  virtual void SetMaterialPath( const EFK_CHAR* materialPath ) = 0;
3113 };
3114 
3115 //----------------------------------------------------------------------------------
3116 //
3117 //----------------------------------------------------------------------------------
3118  }
3119 //----------------------------------------------------------------------------------
3120 //
3121 //----------------------------------------------------------------------------------
3122 
3123 #endif // #if !( defined(_PSVITA) || defined(_PS4) || defined(_SWITCH) || defined(_XBOXONE) )
3124 
3125 #endif // __EFFEKSEER_SERVER_H__
3126 
3127 #ifndef __EFFEKSEER_CLIENT_H__
3128 #define __EFFEKSEER_CLIENT_H__
3129 
3130 #if !( defined(_PSVITA) || defined(_PS4) || defined(_SWITCH) || defined(_XBOXONE) )
3131 
3132 //----------------------------------------------------------------------------------
3133 // Include
3134 //----------------------------------------------------------------------------------
3135 
3136 //----------------------------------------------------------------------------------
3137 //
3138 //----------------------------------------------------------------------------------
3139 namespace Effekseer {
3140 //----------------------------------------------------------------------------------
3141 //
3142 //----------------------------------------------------------------------------------
3143 class Client
3144 {
3145 public:
3146  Client() {}
3147  virtual ~Client() {}
3148 
3149  static Client* Create();
3150 
3151  virtual bool Start( char* host, uint16_t port ) = 0;
3152  virtual void Stop()= 0;
3153 
3154  virtual void Reload( const EFK_CHAR* key, void* data, int32_t size ) = 0;
3155  virtual void Reload( Manager* manager, const EFK_CHAR* path, const EFK_CHAR* key ) = 0;
3156  virtual bool IsConnected() = 0;
3157 };
3158 
3159 //----------------------------------------------------------------------------------
3160 //
3161 //----------------------------------------------------------------------------------
3162  }
3163 //----------------------------------------------------------------------------------
3164 //
3165 //----------------------------------------------------------------------------------
3166 
3167 #endif // #if !( defined(_PSVITA) || defined(_PS4) || defined(_SWITCH) || defined(_XBOXONE) )
3168 
3169 #endif // __EFFEKSEER_CLIENT_H__
3170 
3171 #ifndef __EFFEKSEER_CRITICALSESSION_H__
3172 #define __EFFEKSEER_CRITICALSESSION_H__
3173 
3174 //----------------------------------------------------------------------------------
3175 // Include
3176 //----------------------------------------------------------------------------------
3177 
3178 //----------------------------------------------------------------------------------
3179 //
3180 //----------------------------------------------------------------------------------
3181 namespace Effekseer
3182 {
3183 //----------------------------------------------------------------------------------
3184 //
3185 //----------------------------------------------------------------------------------
3190 {
3191 private:
3192 #ifdef _WIN32
3193  mutable CRITICAL_SECTION m_criticalSection;
3194 #elif defined(_PSVITA) || defined(_PS4) || defined(_SWITCH) || defined(_XBOXONE)
3195  mutable CONSOLE_GAME_MUTEX m_mutex;
3196 #else
3197  mutable pthread_mutex_t m_mutex;
3198 #endif
3199 
3200 public:
3201 
3202  CriticalSection();
3203 
3204  ~CriticalSection();
3205 
3206  void Enter() const;
3207 
3208  void Leave() const;
3209 };
3210 
3211 //----------------------------------------------------------------------------------
3212 //
3213 //----------------------------------------------------------------------------------
3214 }
3215 //----------------------------------------------------------------------------------
3216 //
3217 //----------------------------------------------------------------------------------
3218 #endif // __EFFEKSEER_CRITICALSESSION_H__
3219 
3220 #ifndef __EFFEKSEER_THREAD_H__
3221 #define __EFFEKSEER_THREAD_H__
3222 
3223 //----------------------------------------------------------------------------------
3224 // Include
3225 //----------------------------------------------------------------------------------
3226 
3227 //----------------------------------------------------------------------------------
3228 //
3229 //----------------------------------------------------------------------------------
3230 namespace Effekseer {
3231 //----------------------------------------------------------------------------------
3232 //
3233 //----------------------------------------------------------------------------------
3234 
3235 class Thread
3236 {
3237 private:
3238 #ifdef _WIN32
3239  /* DWORDを置きかえ */
3240  static unsigned long EFK_STDCALL ThreadProc(void* arguments);
3241 #elif defined(_PSVITA) || defined(_PS4) || defined(_SWITCH) || defined(_XBOXONE)
3242 
3243 #else
3244  static void* ThreadProc( void* arguments );
3245 #endif
3246 
3247 private:
3248 #ifdef _WIN32
3249  HANDLE m_thread;
3250 #elif defined(_PSVITA) || defined(_PS4) || defined(_SWITCH) || defined(_XBOXONE)
3251 
3252 #else
3253  pthread_t m_thread;
3254  bool m_running;
3255 #endif
3256 
3257  void* m_data;
3258  void (*m_mainProc)( void* );
3259  CriticalSection m_cs;
3260 
3261 public:
3262 
3263  Thread();
3264  ~Thread();
3265 
3266 
3273  bool Create( void (*threadFunc)( void* ), void* data );
3274 
3278  bool IsExitThread() const;
3279 
3283  bool Wait() const;
3284 };
3285 //----------------------------------------------------------------------------------
3286 //
3287 //----------------------------------------------------------------------------------
3288  }
3289 //----------------------------------------------------------------------------------
3290 //
3291 //----------------------------------------------------------------------------------
3292 #endif // __EFFEKSEER_VECTOR3D_H__
virtual int Release()
参照カウンタを減算する。0になった時、インスタンスを削除する。
Definition: Effekseer.h:436
virtual int AddRef()
参照カウンタを加算する。
Definition: Effekseer.h:424
エフェクトファイル読み込み破棄関数指定クラス
Definition: Effekseer.h:2339
virtual void SetRemovingCallback(Handle handle, EffectInstanceRemovingCallback callback)=0
エフェクトのインスタンスに廃棄時のコールバックを設定する。
標準のファイル読み込みクラス
Definition: Effekseer.h:1164
virtual EffectNode * GetRoot() const =0
Rootを取得する。
virtual int GetChildrenCount() const =0
子のノードの数を取得する。
virtual void * GetModel(int n) const =0
格納されているモデルのポインタを取得する。
virtual void SetFreeFunc(FreeFunc func)=0
メモリ破棄関数を設定する。
TextureLoader * GetTextureLoader()
テクスチャローダーを取得する。
virtual Setting * GetSetting()=0
設定クラスを取得する。
Matrix44 & PerspectiveFovLH_OpenGL(float ovY, float aspect, float zn, float zf)
OpenGL用射影行列化(左手系)
virtual int GetDrawTime() const =0
Draw処理時間を取得。
virtual void CreateCullingWorld(float xsize, float ysize, float zsize, int32_t layerCount)=0
エフェクトをカリングし描画負荷を減らすための空間を生成する。
static float Length(const Vector3D &in)
長さ
Definition: Effekseer.h:2551
void RotationZ(float angle)
反時計周り方向のZ軸回転行列化を行う。
void RotationZ(float angle)
Z軸回転行列(右手)
virtual void SetModelRenderer(ModelRenderer *renderer)=0
モデル描画機能を設定する。
virtual TrackRenderer * GetTrackRenderer()=0
軌跡描画機能を取得する。
Definition: Effekseer.h:2189
クリティカルセクション
Definition: Effekseer.h:3189
static Vector3D & Cross(Vector3D &o, const Vector3D &in1, const Vector3D &in2)
外積
virtual int32_t GetColorImageCount() const =0
格納されている画像のポインタの個数を取得する。
float Z
Z.
Definition: Effekseer.h:557
ModelLoader * GetModelLoader()
モデルローダーを取得する。
virtual int32_t GetDistortionImageCount() const =0
格納されている歪み画像のポインタの個数を取得する。
virtual void SetRotation(Handle handle, float x, float y, float z)=0
エフェクトのインスタンスの回転角度を指定する。(ラジアン)
virtual void SetAutoDrawing(Handle handle, bool autoDraw)=0
エフェクトがDrawで描画されるか設定する。 autoDrawがfalseの場合、DrawHandleで描画する必要がある。
virtual int GetRef()
参照カウンタを取得する。
Definition: Effekseer.h:431
virtual MallocFunc GetMallocFunc() const =0
メモリ確保関数を取得する。
ノードインスタンス生成クラス
Definition: Effekseer.h:1444
void RotationXYZ(float rx, float ry, float rz)
反時計周り方向のXYZ軸回転行列化を行う。
void GetScale(Vector3D &s) const
行列から拡大ベクトルを取得する。
Model(void *data, int32_t size)
コンストラクタ
Definition: Effekseer.h:2577
EffectLoader * GetEffectLoader()
エフェクトローダーを取得する。
virtual void SetTrackRenderer(TrackRenderer *renderer)=0
軌跡描画機能を設定する。
Definition: Effekseer.h:2047
virtual EffectBasicRenderParameter GetBasicRenderParameter()=0
共通描画パラメーターを取得する。
static Effect * Create(Manager *manager, void *data, int32_t size, float magnification=1.0f, const EFK_CHAR *materialPath=NULL)
エフェクトを生成する。
Color()
コンストラクタ
virtual void SetBasicRenderParameter(EffectBasicRenderParameter param)=0
共通描画パラメーターを設定する。
Matrix44 & OrthographicLH(float width, float height, float zn, float zf)
正射影行列化(左手系)
static void Add(Vector3D *pOut, const Vector3D *pIn1, const Vector3D *pIn2)
加算
virtual void RessignCulling()=0
現在存在するエフェクトのハンドルからカリングの空間を配置しなおす。
virtual int32_t GetRestInstancesCount() const =0
残りの確保したインスタンス数を取得する。
virtual void Destroy()=0
マネージャーを破棄する。
ModelLoader()
コンストラクタ
Definition: Effekseer.h:2467
void RotationY(float angle)
Y軸回転行列(右手)
Vector2D()
コンストラクタ
void SetModelLoader(ModelLoader *loader)
モデルローダーを設定する。
float Values[4][4]
行列の値
Definition: Effekseer.h:958
virtual RandFunc GetRandFunc() const =0
ランダム関数を取得する。
Matrix44 & PerspectiveFovRH_OpenGL(float ovY, float aspect, float zn, float zf)
OpenGL用射影行列化(右手系)
virtual void SetMatrix(Handle handle, const Matrix43 &mat)=0
エフェクトのインスタンスに変換行列を設定する。
virtual void SetEffectLoader(EffectLoader *effectLoader)=0
エフェクト読込クラスを設定する。
virtual void SetRandMax(int max_)=0
ランダム関数を設定する。
CoordinateSystem GetCoordinateSystem() const
座標系を取得する。
bool IsExitThread() const
スレッド終了を確認する。
virtual void SetSoundLoader(SoundLoader *soundLoader)=0
サウンド読込クラスを設定する。
サウンド読み込み破棄関数指定クラス
Definition: Effekseer.h:2895
Matrix44 & LookAtRH(const Vector3D &eye, const Vector3D &at, const Vector3D &up)
カメラ行列化(右手系)
void GetRotation(Matrix43 &r) const
行列から回転行列を取得する。
virtual ~TextureLoader()
デストラクタ
Definition: Effekseer.h:2412
virtual ModelLoader * GetModelLoader()=0
モデル読込クラスを取得する。
Definition: Effekseer.h:1978
virtual int GetRandMax() const =0
ランダム最大値を取得する。
virtual Matrix43 GetMatrix(Handle handle)=0
エフェクトのインスタンスに設定されている行列を取得する。
virtual EffectNode * GetChild(int index) const =0
子のノードを取得する。
ファイルアクセス用のファクトリクラス
Definition: Effekseer.h:1127
uint8_t A
透明度
Definition: Effekseer.h:683
Definition: Effekseer.h:2138
エフェクト管理クラス
Definition: Effekseer.h:1505
Definition: Effekseer.h:2193
Definition: Effekseer.h:2525
virtual void SetTargetLocation(Handle handle, float x, float y, float z)=0
エフェクトのインスタンスのターゲット位置を指定する。
Matrix44 & Indentity()
単位行列化
virtual FreeFunc GetFreeFunc() const =0
メモリ破棄関数を取得する。
static Matrix44 & Mul(Matrix44 &o, const Matrix44 &in1, const Matrix44 &in2)
乗算
static Vector3D & Sub(Vector3D &o, const Vector3D &in1, const Vector3D &in2)
減算
テクスチャデータ
Definition: Effekseer.h:455
行列
Definition: Effekseer.h:944
virtual bool Exists(Handle handle)=0
エフェクトのインスタンスが存在しているか取得する。
Matrix44 & LookAtLH(const Vector3D &eye, const Vector3D &at, const Vector3D &up)
カメラ行列化(左手系)
virtual void SetRandFunc(RandFunc func)=0
ランダム関数を設定する。
static float Dot(const Vector3D &in1, const Vector3D &in2)
内積
virtual int GetRef()=0
参照カウンタを取得する。
virtual void SetRingRenderer(RingRenderer *renderer)=0
リング描画機能を設定する。
virtual void SetSpriteRenderer(SpriteRenderer *renderer)=0
スプライト描画機能を設定する。
Definition: Effekseer.h:1183
virtual SpriteRenderer * GetSpriteRenderer()=0
スプライト描画機能を取得する。
void RotationAxis(const Vector3D &axis, float angle)
任意軸に対する反時計周り方向回転行列化を行う。
void RotationX(float angle)
反時計周り方向のX軸回転行列化を行う。
virtual void AddLocation(Handle handle, const Vector3D &location)=0
エフェクトのインスタンスの位置に加算する。
SoundLoader()
コンストラクタ
Definition: Effekseer.h:2901
virtual Handle Play(Effect *effect, float x, float y, float z)=0
再生する。
virtual Matrix43 GetBaseMatrix(Handle handle)=0
エフェクトのベース行列を取得する。
virtual void SetModelLoader(ModelLoader *modelLoader)=0
モデル読込クラスを設定する。
virtual ~EffectLoader()
デストラクタ
Definition: Effekseer.h:2350
Setting()
コンストラクタ
static Manager * Create(int instance_max, bool autoFlip=true)
マネージャーを生成する。
Definition: Effekseer.h:2051
virtual EffectLoader * GetEffectLoader()=0
エフェクト読込クラスを取得する。
virtual void SetShown(Handle handle, bool shown)=0
エフェクトのインスタンスをDraw時に描画するか設定する。
static void Mul(Color &o, const Color &in1, const Color &in2)
乗算
virtual void SetBaseMatrix(Handle handle, const Matrix43 &mat)=0
エフェクトのベース行列を設定する。
virtual int AddRef()=0
参照カウンタを加算する。
void SetEffectLoader(EffectLoader *loader)
エフェクトローダーを設定する。
void SetSoundLoader(SoundLoader *loader)
サウンドローダーを設定する。
virtual void Update(float deltaFrame=1.0f)=0
更新処理を行う。
テクスチャ読み込み破棄関数指定クラス
Definition: Effekseer.h:2401
virtual void SetMaterialPath(const EFK_CHAR *materialPath)=0
素材パスを設定する。
virtual TextureLoader * GetTextureLoader()=0
テクスチャ読込クラスを取得する。
virtual void CalcCulling(const Matrix44 &cameraProjMat, bool isOpenGL)=0
カリングを行い、カリングされたオブジェクトのみを描画するようにする。
モデル読み込み破棄関数指定クラス
Definition: Effekseer.h:2461
virtual int GetUpdateTime() const =0
Update処理時間を取得。
virtual void Unload(TextureData *data)
テクスチャを破棄する。
Definition: Effekseer.h:2432
void GetSRT(Vector3D &s, Matrix43 &r, Vector3D &t) const
行列を、拡大、回転、移動の行列とベクトルに分解する。
float X
X.
Definition: Effekseer.h:495
virtual void SetCoordinateSystem(CoordinateSystem coordinateSystem)=0
座標系を設定する。
四角形
Definition: Effekseer.h:727
virtual void * Load(const EFK_CHAR *path)
サウンドを読み込む。
Definition: Effekseer.h:2916
virtual void SetRibbonRenderer(RibbonRenderer *renderer)=0
ストライプ描画機能を設定する。
float Value[4][3]
行列の値
Definition: Effekseer.h:792
void RotationX(float angle)
X軸回転行列(右手)
エフェクトパラメータークラス
Definition: Effekseer.h:1245
virtual void Draw()=0
描画処理を行う。
virtual void SetSoundPlayer(SoundPlayer *soundPlayer)=0
サウンド再生機能を設定する。
virtual ~Model()
デストラクタ
Definition: Effekseer.h:2643
virtual void EndUpdate()=0
更新処理を終了する。
Matrix44 & PerspectiveFovLH(float ovY, float aspect, float zn, float zf)
射影行列化(左手系)
Definition: Effekseer.h:2118
~Setting()
デストラクタ
4x3行列
Definition: Effekseer.h:784
virtual bool Load(const EFK_CHAR *path, void *&data, int32_t &size)=0
エフェクトファイルを読み込む。
void Quaternion(float x, float y, float z, float w)
クオータニオンから行列に変換
Definition: Effekseer.h:2836
Matrix44 & Transpose()
転置行列化
virtual ~SoundLoader()
デストラクタ
Definition: Effekseer.h:2906
ファイル読み込みクラス
Definition: Effekseer.h:1083
Matrix44()
コンストラクタ
SoundLoader * GetSoundLoader()
サウンドローダーを取得する。
virtual void Unload(void *source)
サウンドを破棄する。
Definition: Effekseer.h:2925
void RotationY(float angle)
反時計周り方向のY軸回転行列化を行う。
Definition: Effekseer.h:1204
3次元ベクトル
Definition: Effekseer.h:541
virtual SoundLoader * GetSoundLoader()=0
サウンド読込クラスを取得する
3次元ベクトル
Definition: Effekseer.h:489
ファイル書き込みクラス
Definition: Effekseer.h:1104
virtual void SetLocation(Handle handle, float x, float y, float z)=0
エフェクトのインスタンスの位置を指定する。
float X
X.
Definition: Effekseer.h:547
void Translation(float x, float y, float z)
移動行列化を行う。
参照カウンタのインターフェース
Definition: Effekseer.h:381
virtual int GetVersion() const =0
エフェクトデータのバージョン取得
virtual void Update()=0
サーバーを更新し、エフェクトのリロードを行う。
共通描画パラメーター
Definition: Effekseer.h:1427
static float LengthSq(const Vector3D &in)
長さの二乗
virtual int32_t GetModelCount() const =0
格納されているモデルのポインタの個数を取得する。
Definition: Effekseer.h:2122
static Matrix44 & Inverse(Matrix44 &o, const Matrix44 &in)
逆行列
void SetTextureLoader(TextureLoader *loader)
テクスチャローダーを設定する。
virtual void * Load(const EFK_CHAR *path)
モデルを読み込む。
Definition: Effekseer.h:2482
static void Normal(Vector3D &o, const Vector3D &in)
単位ベクトル
Definition: Effekseer.h:2535
virtual Vector3D GetLocation(Handle handle)=0
エフェクトのインスタンスの位置を取得する。
Definition: Effekseer.h:2257
virtual int32_t GetWaveCount() const =0
格納されている音波形のポインタの個数を取得する。
Definition: Effekseer.h:3075
virtual void Unload(void *data, int32_t size)=0
エフェクトファイルを破棄する。
virtual void StopRoot(Handle handle)=0
エフェクトのルートだけを停止する。
Definition: Effekseer.h:663
void RotationZXY(float rz, float rx, float ry)
反時計周り方向のZXY軸回転行列化を行う。
virtual TextureData * GetDistortionImage(int n) const =0
格納されている歪み画像のポインタを取得する。
virtual void StopAllEffects()=0
全てのエフェクトを停止する。
virtual void StopEffect(Handle handle)=0
エフェクトを停止する。
float Y
Y.
Definition: Effekseer.h:500
Definition: Effekseer.h:2261
virtual ~ModelLoader()
デストラクタ
Definition: Effekseer.h:2472
Definition: Effekseer.h:2546
static void Multiple(Matrix43 &out, const Matrix43 &in1, const Matrix43 &in2)
行列同士の乗算を行う。
virtual void SetSetting(Setting *setting)=0
設定クラスを設定する。
virtual ModelRenderer * GetModelRenderer()=0
モデル描画機能を取得する。
void SetSRT(const Vector3D &s, const Matrix43 &r, const Vector3D &t)
行列の拡大、回転、移動を設定する。
virtual void BeginUpdate()=0
更新処理を開始する。
virtual SoundPlayer * GetSoundPlayer()=0
サウンド再生機能を取得する。
virtual int32_t GetNormalImageCount() const =0
格納されている法線画像のポインタの個数を取得する。
Vector3D()
コンストラクタ
virtual void Regist(const EFK_CHAR *key, Effect *effect)=0
エフェクトをリロードの対象として登録する。
virtual void UpdateHandle(Handle handle, float deltaFrame=1.0f)=0
ハンドル単位の更新を行う。
void SetCoordinateSystem(CoordinateSystem coordinateSystem)
座標系を設定する。
uint8_t R
Definition: Effekseer.h:668
void Translation(float x, float y, float z)
移動行列
virtual CoordinateSystem GetCoordinateSystem() const =0
座標系を取得する。
virtual void UnloadResources()=0
画像等リソースの破棄を行う。
virtual void SetScale(Handle handle, float x, float y, float z)=0
エフェクトのインスタンスの拡大率を指定する。
virtual int32_t GetInstanceCount(Handle handle)=0
エフェクトに使用されているインスタンス数を取得する。
EffectLoader()
コンストラクタ
Definition: Effekseer.h:2345
virtual TextureData * GetNormalImage(int n) const =0
格納されている法線画像のポインタを取得する。
void Scaling(float x, float y, float z)
拡大行列化を行う。
::Effekseer::EffectLoader * CreateEffectLoader(::Effekseer::FileInterface *fileInterface=NULL)
標準のエフェクト読込インスタンスを生成する。
モデルクラス
Definition: Effekseer.h:2520
Matrix44 & OrthographicRH(float width, float height, float zn, float zf)
正射影行列化(右手系)
Definition: Effekseer.h:1982
Definition: Effekseer.h:3143
bool Wait() const
スレッド終了を待つ。
static Setting * Create()
設定インスタンスを生成する。
virtual void SetSpeed(Handle handle, float speed)=0
エフェクトのインスタンスを再生スピードを設定する。
Definition: Effekseer.h:3235
設定クラス
Definition: Effekseer.h:2957
virtual Setting * GetSetting() const =0
設定を取得する。
virtual RibbonRenderer * GetRibbonRenderer()=0
ストライプ描画機能を取得する。
virtual void DrawHandle(Handle handle)=0
ハンドル単位の描画処理を行う。
bool Create(void(*threadFunc)(void *), void *data)
スレッドを生成する。
void RotationAxis(const Vector3D &axis, float angle)
任意軸反時計回転行列
Definition: Effekseer.h:2833
virtual Effect * GetEffect() const =0
ノードが所属しているエフェクトを取得する。
virtual void SetMallocFunc(MallocFunc func)=0
メモリ確保関数を設定する。
void Indentity()
単位行列化を行う。
TextureLoader()
コンストラクタ
Definition: Effekseer.h:2407
virtual void ReloadResources(const EFK_CHAR *materialPath=NULL)=0
画像等リソースの再読み込みを行う。
virtual TextureData * Load(const EFK_CHAR *path, TextureType textureType)
テクスチャを読み込む。
Definition: Effekseer.h:2423
virtual int Release()=0
参照カウンタを減算する。0になった時、インスタンスを削除する。
virtual void SetPaused(Handle handle, bool paused)=0
エフェクトのインスタンスをUpdate時に更新するか設定する。
virtual void SetTextureLoader(TextureLoader *textureLoader)=0
テクスチャ読込クラスを設定する。
float Y
Y.
Definition: Effekseer.h:552
参照カウンタオブジェクト
Definition: Effekseer.h:409
void Scaling(float x, float y, float z)
拡大行列化
uint8_t B
Definition: Effekseer.h:678
virtual bool Reload(void *data, int32_t size, const EFK_CHAR *materialPath=NULL)=0
エフェクトのリロードを行う。
uint8_t G
Definition: Effekseer.h:673
virtual void * GetWave(int n) const =0
格納されている音波形のポインタを取得する。
virtual RingRenderer * GetRingRenderer()=0
リング描画機能を取得する。
virtual bool Start(uint16_t port)=0
サーバーを開始する。
virtual void Unload(void *data)
モデルを破棄する。
Definition: Effekseer.h:2491
virtual void Unregist(Effect *effect)=0
エフェクトをリロードの対象から外す。
virtual TextureData * GetColorImage(int n) const =0
格納されている色画像のポインタを取得する。
void GetTranslation(Vector3D &t) const
行列から移動ベクトルを取得する。
virtual void Flip()=0
今までのPlay等の処理をUpdate実行時に適用するようにする。
Matrix44 & PerspectiveFovRH(float ovY, float aspect, float zn, float zf)
射影行列化(右手系)