arsa  2.7
Effekseer.h
Go to the documentation of this file.
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 #include <climits>
13 #include <vector>
14 #include <cfloat>
15 #include <array>
16 #include <memory>
17 
18 //----------------------------------------------------------------------------------
19 //
20 //----------------------------------------------------------------------------------
21 #ifdef _WIN32
22 #define EFK_STDCALL __stdcall
23 #else
24 #define EFK_STDCALL
25 #endif
26 
27 //----------------------------------------------------------------------------------
28 //
29 //----------------------------------------------------------------------------------
30 
31 #ifdef _WIN32
32 //#include <windows.h>
33 #elif defined(_PSVITA)
34 #include "Effekseer.PSVita.h"
35 #elif defined(_PS4)
36 #include "Effekseer.PS4.h"
37 #elif defined(_SWITCH)
38 #include "Effekseer.Switch.h"
39 #elif defined(_XBOXONE)
40 #include "Effekseer.XBoxOne.h"
41 #else
42 #include <unistd.h>
43 #include <pthread.h>
44 #include <sys/time.h>
45 #endif
46 
47 //----------------------------------------------------------------------------------
48 //
49 //----------------------------------------------------------------------------------
50 typedef char16_t EFK_CHAR;
51 
52 //----------------------------------------------------------------------------------
53 //
54 //----------------------------------------------------------------------------------
55 namespace Effekseer
56 {
57 //----------------------------------------------------------------------------------
58 //
59 //----------------------------------------------------------------------------------
60 struct Vector2D;
61 struct Vector3D;
62 struct Matrix43;
63 struct Matrix44;
64 struct RectF;
65 
66 class Manager;
67 class Effect;
68 class EffectNode;
69 
70 class ParticleRenderer;
71 class SpriteRenderer;
72 class RibbonRenderer;
73 class RingRenderer;
74 class ModelRenderer;
75 class TrackRenderer;
76 
77 class Setting;
78 class EffectLoader;
79 class TextureLoader;
80 class MaterialLoader;
81 
82 class SoundPlayer;
83 class SoundLoader;
84 
85 class ModelLoader;
86 
87 class Model;
88 
89 typedef int Handle;
90 
94 typedef void*(EFK_STDCALL* MallocFunc)(unsigned int size);
95 
99 typedef void(EFK_STDCALL* FreeFunc)(void* p, unsigned int size);
100 
104 typedef void*(EFK_STDCALL* AlignedMallocFunc)(unsigned int size, unsigned int alignment);
105 
109 typedef void(EFK_STDCALL* AlignedFreeFunc)(void* p, unsigned int size);
110 
114 typedef int(EFK_STDCALL* RandFunc)(void);
115 
122 typedef void ( EFK_STDCALL *EffectInstanceRemovingCallback ) ( Manager* manager, Handle handle, bool isRemovingManager );
123 
124 #define ES_SAFE_ADDREF(val) if ( (val) != NULL ) { (val)->AddRef(); }
125 #define ES_SAFE_RELEASE(val) if ( (val) != NULL ) { (val)->Release(); (val) = NULL; }
126 #define ES_SAFE_DELETE(val) if ( (val) != NULL ) { delete (val); (val) = NULL; }
127 #define ES_SAFE_DELETE_ARRAY(val) if ( (val) != NULL ) { delete [] (val); (val) = NULL; }
128 
129 #define EFK_ASSERT(x) assert(x)
130 
133 
136 
138 
139 //----------------------------------------------------------------------------------
140 //
141 //----------------------------------------------------------------------------------
146 {
150  Opacity = 0,
154  Blend = 1,
158  Add = 2,
162  Sub = 3,
166  Mul = 4,
167 };
168 
170 {
171  Nearest = 0,
172  Linear = 1,
173 };
174 
176 {
177  Repeat = 0,
178  Clamp = 1,
179 };
180 
181 enum class CullingType : int32_t
182 {
183  Front = 0,
184  Back = 1,
185  Double = 2,
186 };
187 
188 //----------------------------------------------------------------------------------
189 //
190 //----------------------------------------------------------------------------------
191 enum class BillboardType : int32_t
192 {
193  Billboard = 0,
194  YAxisFixed = 1,
195  Fixed = 2,
196  RotatedBillboard = 3,
197 };
198 
200 {
201  LH,
202  RH,
203 };
204 
205 enum class CullingShape : int32_t
206 {
207  NoneShape = 0,
208  Sphere = 1,
209 };
210 
211 enum class TextureType : int32_t
212 {
213  Color,
214  Normal,
215  Distortion,
216 };
217 
219 {
220  Code,
221  Compiled,
222 };
223 
225 {
226  ABGR8,
227  BC1,
228  BC2,
229  BC3,
230 };
231 
232 enum class ZSortType : int32_t
233 {
234  None,
235  NormalOrder,
236  ReverseOrder,
237 };
238 
239 //-----------------------------------------------------------------------------------
240 //
241 //-----------------------------------------------------------------------------------
242 enum class RenderMode : int32_t
243 {
244  Normal, // 通常描画
245  Wireframe, // ワイヤーフレーム描画
246 };
247 
254 {
255  Main,
256  Render,
257 };
258 
259 //----------------------------------------------------------------------------------
260 //
261 //----------------------------------------------------------------------------------
265 template <typename T,typename U>
266 T Max( T t, U u )
267 {
268  if( t > (T)u )
269  {
270  return t;
271  }
272  return u;
273 }
274 
278 template <typename T,typename U>
279 T Min( T t, U u )
280 {
281  if( t < (T)u )
282  {
283  return t;
284  }
285  return u;
286 }
287 
291 template <typename T,typename U,typename V>
292 T Clamp( T t, U max_, V min_ )
293 {
294  if( t > (T)max_ )
295  {
296  t = (T)max_;
297  }
298 
299  if( t < (T)min_ )
300  {
301  t = (T)min_;
302  }
303 
304  return t;
305 }
306 
307 //----------------------------------------------------------------------------------
308 //
309 //----------------------------------------------------------------------------------
317 inline int32_t ConvertUtf16ToUtf8( int8_t* dst, int32_t dst_size, const int16_t* src )
318 {
319  int32_t cnt = 0;
320  const int16_t* wp = src;
321  int8_t* cp = dst;
322 
323  if (dst_size == 0) return 0;
324 
325  dst_size -= 3;
326 
327  for (cnt = 0; cnt < dst_size; )
328  {
329  int16_t wc = *wp++;
330  if (wc == 0)
331  {
332  break;
333  }
334  if ((wc & ~0x7f) == 0)
335  {
336  *cp++ = wc & 0x7f;
337  cnt += 1;
338  } else if ((wc & ~0x7ff) == 0)
339  {
340  *cp++ = ((wc >> 6) & 0x1f) | 0xc0;
341  *cp++ = ((wc) & 0x3f) | 0x80;
342  cnt += 2;
343  } else {
344  *cp++ = ((wc >> 12) & 0xf) | 0xe0;
345  *cp++ = ((wc >> 6) & 0x3f) | 0x80;
346  *cp++ = ((wc) & 0x3f) | 0x80;
347  cnt += 3;
348  }
349  }
350  *cp = '\0';
351  return cnt;
352 }
353 
361 inline int32_t ConvertUtf8ToUtf16( int16_t* dst, int32_t dst_size, const int8_t* src )
362 {
363  int32_t i, code;
364  int8_t c0, c1, c2;
365 
366  if (dst_size == 0) return 0;
367 
368  dst_size -= 1;
369 
370  for (i = 0; i < dst_size; i++)
371  {
372  int16_t wc;
373 
374  c0 = *src++;
375  if (c0 == '\0')
376  {
377  break;
378  }
379  // UTF8からUTF16に変換
380  code = (uint8_t)c0 >> 4;
381  if (code <= 7)
382  {
383  // 8bit文字
384  wc = c0;
385  }
386  else if (code >= 12 && code <= 13)
387  {
388  // 16bit文字
389  c1 = *src++;
390  wc = ((c0 & 0x1F) << 6) | (c1 & 0x3F);
391  }
392  else if (code == 14)
393  {
394  // 24bit文字
395  c1 = *src++;
396  c2 = *src++;
397  wc = ((c0 & 0x0F) << 12) | ((c1 & 0x3F) << 6) | (c2 & 0x3F);
398  }
399  else
400  {
401  continue;
402  }
403  dst[i] = wc;
404  }
405  dst[i] = 0;
406  return i;
407 }
408 
409 
410 //----------------------------------------------------------------------------------
411 //
412 //----------------------------------------------------------------------------------
417 {
418 public:
423  virtual int AddRef() = 0;
424 
429  virtual int GetRef() = 0;
430 
435  virtual int Release() = 0;
436 };
437 
441 template <typename T>
443 {
444  void operator()(T* ptr) const
445  {
446  if (ptr != nullptr)
447  {
448  ptr->Release();
449  }
450  }
451 };
452 
453 template<typename T>
454 inline std::unique_ptr<T, ReferenceDeleter<T>> CreateUniqueReference(T* ptr, bool addRef = false)
455 {
456  if (ptr == nullptr)
457  return std::unique_ptr<T, ReferenceDeleter<T>>(nullptr);
458 
459  if (addRef)
460  {
461  ptr->AddRef();
462  }
463 
464  return std::unique_ptr<T, ReferenceDeleter<T>>(ptr);
465 }
466 
467 //----------------------------------------------------------------------------------
468 //
469 //----------------------------------------------------------------------------------
474  : public IReference
475 {
476 private:
477  mutable std::atomic<int32_t> m_reference;
478 
479 public:
481  : m_reference(1)
482  {
483  }
484 
486  {}
487 
488  virtual int AddRef()
489  {
490  std::atomic_fetch_add_explicit(&m_reference, 1, std::memory_order_consume);
491 
492  return m_reference;
493  }
494 
495  virtual int GetRef()
496  {
497  return m_reference;
498  }
499 
500  virtual int Release()
501  {
502  bool destroy = std::atomic_fetch_sub_explicit(&m_reference, 1, std::memory_order_consume) == 1;
503  if (destroy)
504  {
505  delete this;
506  return 0;
507  }
508 
509  return m_reference;
510  }
511 };
512 
517 {
518 public:
519  IRandObject() = default;
520  virtual ~IRandObject() = default;
521 
522  virtual float GetRand() = 0;
523 
524  virtual float GetRand(float min_, float max_) = 0;
525 };
526 
527 //----------------------------------------------------------------------------------
528 //
529 //----------------------------------------------------------------------------------
530 
532 {
533  Gamma,
534  Linear,
535 };
536 
542 {
546  void* UserPtr;
548 
550  bool HasMipmap = true;
551 };
552 
554 {
555  Lit,
556  Unlit,
557 };
558 
563 {
564  Default = 0,
565  BackDistortion = 6,
566  Lighting = 7,
567  File = 128,
568 };
569 
575 {
576 public:
578  bool IsSimpleVertex = false;
579  bool IsRefractionRequired = false;
584  std::array<TextureWrapType, UserTextureSlotMax> TextureWrapTypes;
585  void* UserPtr = nullptr;
586  void* ModelUserPtr = nullptr;
587  void* RefractionUserPtr = nullptr;
588  void* RefractionModelUserPtr = nullptr;
589 
590  MaterialData() = default;
591  virtual ~MaterialData() = default;
592 };
593 
599 {
603 };
604 
610 {
613 
615  std::vector<MaterialTextureParameter> MaterialTextures;
616 
618  std::vector<std::array<float, 4>> MaterialUniforms;
619 };
620 
626 {
627  float DepthOffset = 0.0f;
633 };
634 
640 {
644 #ifdef __EFFEKSEER_BUILD_VERSION16__
645  int32_t Texture3Index = -1;
646 #endif
647  float DistortionIntensity = 0.0f;
650 
655 #ifdef __EFFEKSEER_BUILD_VERSION16__
658 
659  bool EnableInterpolation = false;
660  int32_t UVLoopType = 0;
661  int32_t InterpolationType = 0;
662  int32_t FlipbookDivideX = 1;
663  int32_t FlipbookDivideY = 1;
664 #endif
665 };
666 
667 //----------------------------------------------------------------------------------
668 //
669 //----------------------------------------------------------------------------------
670 }
671 //----------------------------------------------------------------------------------
672 //
673 //----------------------------------------------------------------------------------
674 #endif // __EFFEKSEER_BASE_PRE_H__
675 #ifndef __EFFEKSEER_CUSTOM_ALLOCATOR_H__
676 #define __EFFEKSEER_CUSTOM_ALLOCATOR_H__
677 
678 #include <list>
679 #include <map>
680 #include <new>
681 #include <set>
682 #include <vector>
683 
684 namespace Effekseer
685 {
692 
698 
705 
711 
718 
724 
731 
737 
744 
750 
757 
763 
764 template <class T> struct CustomAllocator
765 {
766  using value_type = T;
767 
769 
770  template <class U> CustomAllocator(const CustomAllocator<U>&) {}
771 
772  T* allocate(std::size_t n) { return reinterpret_cast<T*>(GetMallocFunc()(sizeof(T) * n)); }
773  void deallocate(T* p, std::size_t n) { GetFreeFunc()(p, sizeof(T) * n); }
774 };
775 
776 template <class T> struct CustomAlignedAllocator
777 {
778  using value_type = T;
779 
781 
782  template <class U> CustomAlignedAllocator(const CustomAlignedAllocator<U>&) {}
783 
784  T* allocate(std::size_t n) { return reinterpret_cast<T*>(GetAlignedMallocFunc()(sizeof(T) * n, 16)); }
785  void deallocate(T* p, std::size_t n) { GetAlignedFreeFunc()(p, sizeof(T) * n); }
786 };
787 
788 template <class T, class U> bool operator==(const CustomAllocator<T>&, const CustomAllocator<U>&) { return true; }
789 
790 template <class T, class U> bool operator!=(const CustomAllocator<T>&, const CustomAllocator<U>&) { return false; }
791 
792 template <class T> using CustomVector = std::vector<T, CustomAllocator<T>>;
793 template <class T> using CustomAlignedVector = std::vector<T, CustomAlignedAllocator<T>>;
794 template <class T> using CustomList = std::list<T, CustomAllocator<T>>;
795 template <class T> using CustomSet = std::set<T, std::less<T>, CustomAllocator<T>>;
796 template <class T, class U> using CustomMap = std::map<T, U, std::less<T>, CustomAllocator<std::pair<const T, U>>>;
797 
798 } // namespace Effekseer
799 
800 #endif // __EFFEKSEER_BASE_PRE_H__
801 #ifndef __EFFEKSEER_VECTOR2D_H__
802 #define __EFFEKSEER_VECTOR2D_H__
803 
804 //----------------------------------------------------------------------------------
805 // Include
806 //----------------------------------------------------------------------------------
807 
808 //----------------------------------------------------------------------------------
809 //
810 //----------------------------------------------------------------------------------
811 namespace Effekseer {
812 //----------------------------------------------------------------------------------
813 //
814 //----------------------------------------------------------------------------------
818 struct Vector2D
819 {
820 public:
824  float X;
825 
829  float Y;
830 
834  Vector2D();
835 
839  Vector2D( float x, float y );
840 
841  Vector2D& operator+=( const Vector2D& value );
842 };
843 
844 //----------------------------------------------------------------------------------
845 //
846 //----------------------------------------------------------------------------------
847  }
848 //----------------------------------------------------------------------------------
849 //
850 //----------------------------------------------------------------------------------
851 #endif // __EFFEKSEER_VECTOR3D_H__
852 
853 #ifndef __EFFEKSEER_VECTOR3D_H__
854 #define __EFFEKSEER_VECTOR3D_H__
855 
856 //----------------------------------------------------------------------------------
857 // Include
858 //----------------------------------------------------------------------------------
859 
860 //----------------------------------------------------------------------------------
861 //
862 //----------------------------------------------------------------------------------
863 namespace Effekseer {
864 //----------------------------------------------------------------------------------
865 //
866 //----------------------------------------------------------------------------------
870 struct Vector3D
871 {
872 public:
876  float X;
877 
881  float Y;
882 
886  float Z;
887 
891  Vector3D();
892 
896  Vector3D( float x, float y, float z );
897 
899 
900  Vector3D operator + ( const Vector3D& o ) const;
901 
902  Vector3D operator - ( const Vector3D& o ) const;
903 
904  Vector3D operator * ( const float& o ) const;
905 
906  Vector3D operator / ( const float& o ) const;
907 
908  Vector3D operator * (const Vector3D& o) const;
909 
910  Vector3D operator / (const Vector3D& o) const;
911 
912  Vector3D& operator += ( const Vector3D& o );
913 
914  Vector3D& operator -= ( const Vector3D& o );
915 
916  Vector3D& operator *= ( const float& o );
917 
918  Vector3D& operator /= ( const float& o );
919 
920  bool operator == (const Vector3D& o);
921 
925  static void Add( Vector3D* pOut, const Vector3D* pIn1, const Vector3D* pIn2 );
926 
930  static Vector3D& Sub( Vector3D& o, const Vector3D& in1, const Vector3D& in2 );
931 
935  static float Length( const Vector3D& in );
936 
940  static float LengthSq( const Vector3D& in );
941 
945  static float Dot( const Vector3D& in1, const Vector3D& in2 );
946 
950  static void Normal( Vector3D& o, const Vector3D& in );
951 
958  static Vector3D& Cross( Vector3D& o, const Vector3D& in1, const Vector3D& in2 );
959 
960  static Vector3D& Transform( Vector3D& o, const Vector3D& in, const Matrix43& mat );
961 
962  static Vector3D& Transform( Vector3D& o, const Vector3D& in, const Matrix44& mat );
963 
964  static Vector3D& TransformWithW(Vector3D& o, const Vector3D& in, const Matrix44& mat);
965 };
966 
967 //----------------------------------------------------------------------------------
968 //
969 //----------------------------------------------------------------------------------
970  }
971 //----------------------------------------------------------------------------------
972 //
973 //----------------------------------------------------------------------------------
974 #endif // __EFFEKSEER_VECTOR3D_H__
975 
976 #ifndef __EFFEKSEER_COLOR_H__
977 #define __EFFEKSEER_COLOR_H__
978 
979 //----------------------------------------------------------------------------------
980 // Include
981 //----------------------------------------------------------------------------------
982 
983 //----------------------------------------------------------------------------------
984 //
985 //----------------------------------------------------------------------------------
986 namespace Effekseer
987 {
988 //----------------------------------------------------------------------------------
989 //
990 //----------------------------------------------------------------------------------
992 {
995  COLOR_MODE_DWORD = 0x7FFFFFFF
996 };
997 
1001 #pragma pack(push,1)
1002 struct Color
1003 {
1008 
1013 
1018 
1023 
1027  Color() = default;
1028 
1032  Color( uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255 );
1033 
1037  static Color Mul( Color in1, Color in2 );
1038  static Color Mul( Color in1, float in2 );
1039 
1043  static Color Lerp( const Color in1, const Color in2, float t );
1044 };
1045 #pragma pack(pop)
1046 //----------------------------------------------------------------------------------
1047 //
1048 //----------------------------------------------------------------------------------
1049 }
1050 //----------------------------------------------------------------------------------
1051 //
1052 //----------------------------------------------------------------------------------
1053 #endif // __EFFEKSEER_COLOR_H__
1054 
1055 #ifndef __EFFEKSEER_RECTF_H__
1056 #define __EFFEKSEER_RECTF_H__
1057 
1058 //----------------------------------------------------------------------------------
1059 // Include
1060 //----------------------------------------------------------------------------------
1061 
1062 //----------------------------------------------------------------------------------
1063 //
1064 //----------------------------------------------------------------------------------
1065 namespace Effekseer {
1066 //----------------------------------------------------------------------------------
1067 //
1068 //----------------------------------------------------------------------------------
1072 struct RectF
1073 {
1074 private:
1075 
1076 public:
1077  float X;
1078 
1079  float Y;
1080 
1081  float Width;
1082 
1083  float Height;
1084 
1085  RectF();
1086 
1087  RectF( float x, float y, float width, float height );
1088 
1089  Vector2D Position() const;
1090 
1091  Vector2D Size() const;
1092 };
1093 
1094 //----------------------------------------------------------------------------------
1095 //
1096 //----------------------------------------------------------------------------------
1097  }
1098 //----------------------------------------------------------------------------------
1099 //
1100 //----------------------------------------------------------------------------------
1101 #endif // __EFFEKSEER_RECTF_H__
1102 
1103 #ifndef __EFFEKSEER_MATRIX43_H__
1104 #define __EFFEKSEER_MATRIX43_H__
1105 
1106 //----------------------------------------------------------------------------------
1107 // Include
1108 //----------------------------------------------------------------------------------
1109 
1110 //----------------------------------------------------------------------------------
1111 //
1112 //----------------------------------------------------------------------------------
1113 namespace Effekseer {
1114 //----------------------------------------------------------------------------------
1115 //
1116 //----------------------------------------------------------------------------------
1117 
1118 struct Matrix44;
1119 
1130 struct Matrix43
1131 {
1132 private:
1133 
1134 public:
1138  float Value[4][3];
1139 
1143  void Indentity();
1144 
1151  void Scaling( float x, float y, float z );
1152 
1157  void RotationX( float angle );
1158 
1163  void RotationY( float angle );
1164 
1169  void RotationZ( float angle );
1170 
1177  void RotationXYZ( float rx, float ry, float rz );
1178 
1185  void RotationZXY( float rz, float rx, float ry );
1186 
1192  void RotationAxis( const Vector3D& axis, float angle );
1193 
1200  void RotationAxis( const Vector3D& axis, float s, float c );
1201 
1208  void Translation( float x, float y, float z );
1209 
1216  void GetSRT( Vector3D& s, Matrix43& r, Vector3D& t ) const;
1217 
1222  void GetScale( Vector3D& s ) const;
1223 
1228  void GetRotation( Matrix43& r ) const;
1229 
1234  void GetTranslation( Vector3D& t ) const;
1235 
1242  void SetSRT( const Vector3D& s, const Matrix43& r, const Vector3D& t );
1243 
1247  void ToMatrix44(Matrix44& dst);
1248 
1252  bool IsValid() const;
1253 
1260  static void Multiple( Matrix43& out, const Matrix43& in1, const Matrix43& in2 );
1261 };
1262 
1263 //----------------------------------------------------------------------------------
1264 //
1265 //----------------------------------------------------------------------------------
1266  }
1267 //----------------------------------------------------------------------------------
1268 //
1269 //----------------------------------------------------------------------------------
1270 #endif // __EFFEKSEER_MATRIX43_H__
1271 
1272 #ifndef __EFFEKSEER_MATRIX44_H__
1273 #define __EFFEKSEER_MATRIX44_H__
1274 
1275 //----------------------------------------------------------------------------------
1276 // Include
1277 //----------------------------------------------------------------------------------
1278 
1279 //----------------------------------------------------------------------------------
1280 //
1281 //----------------------------------------------------------------------------------
1282 namespace Effekseer {
1283 //----------------------------------------------------------------------------------
1284 //
1285 //----------------------------------------------------------------------------------
1286 
1298 #pragma pack(push,1)
1299 struct Matrix44
1300 {
1301 private:
1302 
1303 public:
1304 
1308  Matrix44();
1309 
1313  float Values[4][4];
1314 
1318  Matrix44& Indentity();
1319 
1323  Matrix44& Transpose();
1324 
1328  Matrix44& LookAtRH( const Vector3D& eye, const Vector3D& at, const Vector3D& up );
1329 
1333  Matrix44& LookAtLH( const Vector3D& eye, const Vector3D& at, const Vector3D& up );
1334 
1338  Matrix44& PerspectiveFovRH( float ovY, float aspect, float zn, float zf );
1339 
1343  Matrix44& PerspectiveFovRH_OpenGL( float ovY, float aspect, float zn, float zf );
1344 
1348  Matrix44& PerspectiveFovLH( float ovY, float aspect, float zn, float zf );
1349 
1353  Matrix44& PerspectiveFovLH_OpenGL( float ovY, float aspect, float zn, float zf );
1354 
1358  Matrix44& OrthographicRH( float width, float height, float zn, float zf );
1359 
1363  Matrix44& OrthographicLH( float width, float height, float zn, float zf );
1364 
1368  void Scaling( float x, float y, float z );
1369 
1373  void RotationX( float angle );
1374 
1378  void RotationY( float angle );
1379 
1383  void RotationZ( float angle );
1384 
1388  void Translation( float x, float y, float z );
1389 
1393  void RotationAxis( const Vector3D& axis, float angle );
1394 
1398  void Quaternion( float x, float y, float z, float w );
1399 
1403  static Matrix44& Mul( Matrix44& o, const Matrix44& in1, const Matrix44& in2 );
1404 
1408  static Matrix44& Inverse( Matrix44& o, const Matrix44& in );
1409 };
1410 
1411 #pragma pack(pop)
1412 //----------------------------------------------------------------------------------
1413 //
1414 //----------------------------------------------------------------------------------
1415  }
1416 //----------------------------------------------------------------------------------
1417 //
1418 //----------------------------------------------------------------------------------
1419 #endif // __EFFEKSEER_MATRIX44_H__
1420 
1421 #ifndef __EFFEKSEER_FILE_H__
1422 #define __EFFEKSEER_FILE_H__
1423 
1424 //----------------------------------------------------------------------------------
1425 // Include
1426 //----------------------------------------------------------------------------------
1427 
1428 //----------------------------------------------------------------------------------
1429 //
1430 //----------------------------------------------------------------------------------
1431 namespace Effekseer {
1432 //----------------------------------------------------------------------------------
1433 //
1434 //----------------------------------------------------------------------------------
1439 {
1440 private:
1441 
1442 public:
1444 
1445  virtual ~FileReader() {}
1446 
1447  virtual size_t Read( void* buffer, size_t size ) = 0;
1448 
1449  virtual void Seek(int position) = 0;
1450 
1451  virtual int GetPosition() = 0;
1452 
1453  virtual size_t GetLength() = 0;
1454 };
1455 
1460 {
1461 private:
1462 
1463 public:
1465 
1466  virtual ~FileWriter() {}
1467 
1468  virtual size_t Write( const void* buffer, size_t size ) = 0;
1469 
1470  virtual void Flush() = 0;
1471 
1472  virtual void Seek(int position) = 0;
1473 
1474  virtual int GetPosition() = 0;
1475 
1476  virtual size_t GetLength() = 0;
1477 };
1478 
1485 {
1486 private:
1487 public:
1488  FileInterface() = default;
1489  virtual ~FileInterface() = default;
1490 
1491  virtual FileReader* OpenRead(const EFK_CHAR* path) = 0;
1492 
1498  virtual FileReader* TryOpenRead(const EFK_CHAR* path) { return OpenRead(path); }
1499 
1500  virtual FileWriter* OpenWrite(const EFK_CHAR* path) = 0;
1501 };
1502 
1503 
1504  }
1505 //----------------------------------------------------------------------------------
1506 //
1507 //----------------------------------------------------------------------------------
1508 #endif // __EFFEKSEER_FILE_H__
1509 
1510 #ifndef __EFFEKSEER_DEFAULT_FILE_H__
1511 #define __EFFEKSEER_DEFAULT_FILE_H__
1512 
1513 //----------------------------------------------------------------------------------
1514 // Include
1515 //----------------------------------------------------------------------------------
1516 
1517 //----------------------------------------------------------------------------------
1518 //
1519 //----------------------------------------------------------------------------------
1520 namespace Effekseer {
1521 //----------------------------------------------------------------------------------
1522 //
1523 //----------------------------------------------------------------------------------
1529 {
1530 private:
1531  FILE* m_filePtr;
1532 
1533 public:
1534  DefaultFileReader( FILE* filePtr );
1535 
1537 
1538  size_t Read( void* buffer, size_t size );
1539 
1540  void Seek( int position );
1541 
1542  int GetPosition();
1543 
1544  size_t GetLength();
1545 };
1546 
1548 {
1549 private:
1550  FILE* m_filePtr;
1551 
1552 public:
1553  DefaultFileWriter( FILE* filePtr );
1554 
1556 
1557  size_t Write( const void* buffer, size_t size );
1558 
1559  void Flush();
1560 
1561  void Seek( int position );
1562 
1563  int GetPosition();
1564 
1565  size_t GetLength();
1566 };
1567 
1569 {
1570 private:
1571 
1572 public:
1573  FileReader* OpenRead( const EFK_CHAR* path );
1574 
1575  FileWriter* OpenWrite( const EFK_CHAR* path );
1576 };
1577 
1578 
1579 //----------------------------------------------------------------------------------
1580 //
1581 //----------------------------------------------------------------------------------
1582  }
1583 //----------------------------------------------------------------------------------
1584 //
1585 //----------------------------------------------------------------------------------
1586 #endif // __EFFEKSEER_DEFAULT_FILE_H__
1587 
1588 #ifndef __EFFEKSEER_EFFECT_H__
1589 #define __EFFEKSEER_EFFECT_H__
1590 
1591 //----------------------------------------------------------------------------------
1592 // Include
1593 //----------------------------------------------------------------------------------
1594 
1595 //----------------------------------------------------------------------------------
1596 //
1597 //----------------------------------------------------------------------------------
1598 namespace Effekseer
1599 {
1600 //----------------------------------------------------------------------------------
1601 //
1602 //----------------------------------------------------------------------------------
1603 
1610 {
1617 
1624 };
1625 
1632 {
1639 
1646 
1653 
1660 
1667 
1674 
1681 
1688 };
1689 
1696 {
1697 public:
1698  EffectFactory();
1699 
1700  virtual ~EffectFactory();
1701 
1707  bool LoadBody(Effect* effect, const void* data, int32_t size, float magnification, const EFK_CHAR* materialPath);
1708 
1715 
1722  void SetSound(Effect* effect, int32_t index, void* data);
1723 
1729  void SetModel(Effect* effect, int32_t index, void* data);
1730 
1736  void SetMaterial(Effect* effect, int32_t index, MaterialData* data);
1737 
1744 
1750  virtual bool OnCheckIsBinarySupported(const void* data, int32_t size);
1751 
1757  virtual bool OnCheckIsReloadSupported();
1758 
1764  virtual bool OnLoading(Effect* effect, const void* data, int32_t size, float magnification, const EFK_CHAR* materialPath);
1765 
1771  virtual void OnLoadingResource(Effect* effect, const void* data, int32_t size, const EFK_CHAR* materialPath);
1772 
1778  virtual void OnUnloadingResource(Effect* effect);
1779 
1784  virtual const char* GetName() const;
1785 
1790  virtual bool GetIsResourcesLoadedAutomatically() const;
1791 };
1792 
1798 class Effect
1799  : public IReference
1800 {
1801 protected:
1802  Effect() {}
1803  virtual ~Effect() {}
1804 
1805 public:
1806 
1816  static Effect* Create( Manager* manager, void* data, int32_t size, float magnification = 1.0f, const EFK_CHAR* materialPath = NULL );
1817 
1826  static Effect* Create( Manager* manager, const EFK_CHAR* path, float magnification = 1.0f, const EFK_CHAR* materialPath = NULL );
1827 
1837  static Effect* Create( Setting* setting, void* data, int32_t size, float magnification = 1.0f, const EFK_CHAR* materialPath = NULL );
1838 
1847  static Effect* Create( Setting* setting, const EFK_CHAR* path, float magnification = 1.0f, const EFK_CHAR* materialPath = NULL );
1848 
1852  static ::Effekseer::EffectLoader* CreateEffectLoader(::Effekseer::FileInterface* fileInterface = NULL);
1853 
1859  virtual const char16_t* GetName() const = 0;
1860 
1865  virtual void SetName(const char16_t* name) = 0;
1866 
1871  virtual Setting* GetSetting() const = 0;
1872 
1877  virtual float GetMaginification() const = 0;
1878 
1882  virtual int GetVersion() const = 0;
1883 
1889  virtual ReferenceObject* GetLoadingParameter() const = 0;
1890 
1896  virtual TextureData* GetColorImage( int n ) const = 0;
1897 
1901  virtual int32_t GetColorImageCount() const = 0;
1902 
1907  virtual const EFK_CHAR* GetColorImagePath(int n) const = 0;
1908 
1914  virtual TextureData* GetNormalImage(int n) const = 0;
1915 
1919  virtual int32_t GetNormalImageCount() const = 0;
1920 
1925  virtual const EFK_CHAR* GetNormalImagePath(int n) const = 0;
1926 
1932  virtual TextureData* GetDistortionImage(int n) const = 0;
1933 
1937  virtual int32_t GetDistortionImageCount() const = 0;
1938 
1943  virtual const EFK_CHAR* GetDistortionImagePath(int n) const = 0;
1944 
1948  virtual void* GetWave( int n ) const = 0;
1949 
1953  virtual int32_t GetWaveCount() const = 0;
1954 
1959  virtual const EFK_CHAR* GetWavePath(int n) const = 0;
1960 
1964  virtual void* GetModel( int n ) const = 0;
1965 
1969  virtual int32_t GetModelCount() const = 0;
1970 
1975  virtual const EFK_CHAR* GetModelPath(int n) const = 0;
1976 
1981  virtual MaterialData* GetMaterial(int n) const = 0;
1982 
1987  virtual int32_t GetMaterialCount() const = 0;
1988 
1993  virtual const EFK_CHAR* GetMaterialPath(int n) const = 0;
1994 
2020  virtual bool Reload( void* data, int32_t size, const EFK_CHAR* materialPath = nullptr, ReloadingThreadType reloadingThreadType = ReloadingThreadType::Main) = 0;
2021 
2044  virtual bool Reload( const EFK_CHAR* path, const EFK_CHAR* materialPath = nullptr, ReloadingThreadType reloadingThreadType = ReloadingThreadType::Main) = 0;
2045 
2079  virtual bool Reload( Manager** managers, int32_t managersCount, void* data, int32_t size, const EFK_CHAR* materialPath = nullptr, ReloadingThreadType reloadingThreadType = ReloadingThreadType::Main) = 0;
2080 
2111  virtual bool Reload( Manager** managers, int32_t managersCount,const EFK_CHAR* path, const EFK_CHAR* materialPath = nullptr, ReloadingThreadType reloadingThreadType = ReloadingThreadType::Main) = 0;
2112 
2116  virtual void ReloadResources( const void* data = nullptr, int32_t size = 0, const EFK_CHAR* materialPath = nullptr ) = 0;
2117 
2121  virtual void UnloadResources() = 0;
2122 
2126  virtual EffectNode* GetRoot() const = 0;
2127 
2133  virtual EffectTerm CalculateTerm() const = 0;
2134 };
2135 
2142 {
2147  bool ZWrite;
2148  bool ZTest;
2151 };
2152 
2163 {
2164  bool Lighting;
2165 };
2166 
2173 {
2174 public:
2176  virtual ~EffectNode(){}
2177 
2181  virtual Effect* GetEffect() const = 0;
2182 
2188  virtual int GetGeneration() const = 0;
2189 
2193  virtual int GetChildrenCount() const = 0;
2194 
2198  virtual EffectNode* GetChild(int index) const = 0;
2199 
2204 
2209 
2216 
2222  virtual EffectInstanceTerm CalculateInstanceTerm(EffectInstanceTerm& parentTerm) const = 0;
2223 };
2224 
2225 //----------------------------------------------------------------------------------
2226 //
2227 //----------------------------------------------------------------------------------
2228 }
2229 //----------------------------------------------------------------------------------
2230 //
2231 //----------------------------------------------------------------------------------
2232 #endif // __EFFEKSEER_EFFECT_H__
2233 
2234 #ifndef __EFFEKSEER_MANAGER_H__
2235 #define __EFFEKSEER_MANAGER_H__
2236 
2237 //----------------------------------------------------------------------------------
2238 // Include
2239 //----------------------------------------------------------------------------------
2240 
2241 //----------------------------------------------------------------------------------
2242 //
2243 //----------------------------------------------------------------------------------
2244 namespace Effekseer
2245 {
2246 //----------------------------------------------------------------------------------
2247 //
2248 //----------------------------------------------------------------------------------
2249 
2253 class Manager
2254  : public IReference
2255 {
2256 public:
2264  {
2267 
2277 
2278  DrawParameter();
2279  };
2280 
2281 protected:
2282  Manager() {}
2283  virtual ~Manager() { }
2284 
2285 public:
2292  static Manager* Create( int instance_max, bool autoFlip = true );
2293 
2299  virtual void Destroy() = 0;
2300 
2306  virtual MallocFunc GetMallocFunc() const = 0;
2307 
2312  virtual void SetMallocFunc(MallocFunc func) = 0;
2313 
2319  virtual FreeFunc GetFreeFunc() const = 0;
2320 
2325  virtual void SetFreeFunc(FreeFunc func) = 0;
2326 
2330  virtual RandFunc GetRandFunc() const = 0;
2331 
2335  virtual void SetRandFunc( RandFunc func ) = 0;
2336 
2340  virtual int GetRandMax() const = 0;
2341 
2345  virtual void SetRandMax( int max_ ) = 0;
2346 
2351  virtual CoordinateSystem GetCoordinateSystem() const = 0;
2352 
2360  virtual void SetCoordinateSystem( CoordinateSystem coordinateSystem ) = 0;
2361 
2365  virtual SpriteRenderer* GetSpriteRenderer() = 0;
2366 
2370  virtual void SetSpriteRenderer( SpriteRenderer* renderer ) = 0;
2371 
2375  virtual RibbonRenderer* GetRibbonRenderer() = 0;
2376 
2380  virtual void SetRibbonRenderer( RibbonRenderer* renderer ) = 0;
2381 
2385  virtual RingRenderer* GetRingRenderer() = 0;
2386 
2390  virtual void SetRingRenderer( RingRenderer* renderer ) = 0;
2391 
2395  virtual ModelRenderer* GetModelRenderer() = 0;
2396 
2400  virtual void SetModelRenderer( ModelRenderer* renderer ) = 0;
2401 
2405  virtual TrackRenderer* GetTrackRenderer() = 0;
2406 
2410  virtual void SetTrackRenderer( TrackRenderer* renderer ) = 0;
2411 
2415  virtual Setting* GetSetting() = 0;
2416 
2421  virtual void SetSetting(Setting* setting) = 0;
2422 
2426  virtual EffectLoader* GetEffectLoader() = 0;
2427 
2431  virtual void SetEffectLoader( EffectLoader* effectLoader ) = 0;
2432 
2436  virtual TextureLoader* GetTextureLoader() = 0;
2437 
2441  virtual void SetTextureLoader( TextureLoader* textureLoader ) = 0;
2442 
2446  virtual SoundPlayer* GetSoundPlayer() = 0;
2447 
2451  virtual void SetSoundPlayer( SoundPlayer* soundPlayer ) = 0;
2452 
2456  virtual SoundLoader* GetSoundLoader() = 0;
2457 
2461  virtual void SetSoundLoader( SoundLoader* soundLoader ) = 0;
2462 
2466  virtual ModelLoader* GetModelLoader() = 0;
2467 
2471  virtual void SetModelLoader( ModelLoader* modelLoader ) = 0;
2472 
2481  virtual MaterialLoader* GetMaterialLoader() = 0;
2482 
2491  virtual void SetMaterialLoader(MaterialLoader* loader) = 0;
2492 
2497  virtual void StopEffect( Handle handle ) = 0;
2498 
2502  virtual void StopAllEffects() = 0;
2503 
2508  virtual void StopRoot( Handle handle ) = 0;
2509 
2514  virtual void StopRoot( Effect* effect ) = 0;
2515 
2521  virtual bool Exists( Handle handle ) = 0;
2522 
2532  virtual int32_t GetInstanceCount( Handle handle ) = 0;
2533 
2549  virtual int32_t GetTotalInstanceCount() const = 0;
2550 
2556  virtual Matrix43 GetMatrix( Handle handle ) = 0;
2557 
2563  virtual void SetMatrix( Handle handle, const Matrix43& mat ) = 0;
2564 
2570  virtual Vector3D GetLocation( Handle handle ) = 0;
2571 
2578  virtual void SetLocation( Handle handle, float x, float y, float z ) = 0;
2579 
2584  virtual void SetLocation( Handle handle, const Vector3D& location ) = 0;
2585 
2590  virtual void AddLocation( Handle handle, const Vector3D& location ) = 0;
2591 
2595  virtual void SetRotation( Handle handle, float x, float y, float z ) = 0;
2596 
2603  virtual void SetRotation( Handle handle, const Vector3D& axis, float angle ) = 0;
2604 
2612  virtual void SetScale( Handle handle, float x, float y, float z ) = 0;
2613 
2619  virtual void SetAllColor(Handle handle, Color color) = 0;
2620 
2627  virtual void SetTargetLocation( Handle handle, float x, float y, float z ) = 0;
2628 
2633  virtual void SetTargetLocation( Handle handle, const Vector3D& location ) = 0;
2634 
2640  virtual float GetDynamicInput(Handle handle, int32_t index) = 0;
2641 
2647  virtual void SetDynamicInput(Handle handle, int32_t index, float value) = 0;
2648 
2654  virtual Matrix43 GetBaseMatrix( Handle handle ) = 0;
2655 
2663  virtual void SetBaseMatrix( Handle handle, const Matrix43& mat ) = 0;
2664 
2670  virtual void SetRemovingCallback( Handle handle, EffectInstanceRemovingCallback callback ) = 0;
2671 
2679  virtual bool GetShown(Handle handle) = 0;
2680 
2686  virtual void SetShown( Handle handle, bool shown ) = 0;
2687 
2695  virtual bool GetPaused(Handle handle) = 0;
2696 
2704  virtual void SetPaused( Handle handle, bool paused ) = 0;
2705 
2712  virtual void SetPausedToAllEffects(bool paused) = 0;
2713 
2722  virtual int GetLayer(Handle handle) = 0;
2723 
2729  virtual void SetLayer(Handle handle, int32_t layer) = 0;
2730 
2742  virtual float GetSpeed(Handle handle) const = 0;
2743 
2749  virtual void SetSpeed( Handle handle, float speed ) = 0;
2750 
2756  virtual void SetAutoDrawing( Handle handle, bool autoDraw ) = 0;
2757 
2761  virtual void Flip() = 0;
2762 
2771  virtual void Update( float deltaFrame = 1.0f ) = 0;
2772 
2781  virtual void BeginUpdate() = 0;
2782 
2791  virtual void EndUpdate() = 0;
2792 
2809  virtual void UpdateHandle( Handle handle, float deltaFrame = 1.0f ) = 0;
2810 
2816  virtual void Draw(const Manager::DrawParameter& drawParameter = Manager::DrawParameter()) = 0;
2817 
2823  virtual void DrawBack(const Manager::DrawParameter& drawParameter = Manager::DrawParameter()) = 0;
2824 
2830  virtual void DrawFront(const Manager::DrawParameter& drawParameter = Manager::DrawParameter()) = 0;
2831 
2837  virtual void DrawHandle(Handle handle, const Manager::DrawParameter& drawParameter = Manager::DrawParameter()) = 0;
2838 
2844  virtual void DrawHandleBack(Handle handle, const Manager::DrawParameter& drawParameter = Manager::DrawParameter()) = 0;
2845 
2851  virtual void DrawHandleFront(Handle handle, const Manager::DrawParameter& drawParameter = Manager::DrawParameter()) = 0;
2852 
2861  virtual Handle Play( Effect* effect, float x, float y, float z ) = 0;
2862 
2877  virtual Handle Play(Effect* effect, const Vector3D& position, int32_t startFrame = 0) = 0;
2878 
2884  virtual int GetCameraCullingMaskToShowAllEffects() = 0;
2885 
2889  virtual int GetUpdateTime() const = 0;
2890 
2894  virtual int GetDrawTime() const = 0;
2895 
2901  virtual int32_t GetRestInstancesCount() const = 0;
2902 
2910  virtual void CreateCullingWorld( float xsize, float ysize, float zsize, int32_t layerCount) = 0;
2911 
2917  virtual void CalcCulling(const Matrix44& cameraProjMat, bool isOpenGL) = 0;
2918 
2922  virtual void RessignCulling() = 0;
2923 };
2924 //----------------------------------------------------------------------------------
2925 //
2926 //----------------------------------------------------------------------------------
2927 }
2928 //----------------------------------------------------------------------------------
2929 //
2930 //----------------------------------------------------------------------------------
2931 #endif // __EFFEKSEER_MANAGER_H__
2932 
2933 #ifndef __EFFEKSEER_EFFECTLOADER_H__
2934 #define __EFFEKSEER_EFFECTLOADER_H__
2935 
2936 //----------------------------------------------------------------------------------
2937 // Include
2938 //----------------------------------------------------------------------------------
2939 
2940 //----------------------------------------------------------------------------------
2941 //
2942 //----------------------------------------------------------------------------------
2943 namespace Effekseer {
2944 //----------------------------------------------------------------------------------
2945 //
2946 //----------------------------------------------------------------------------------
2951 {
2952 public:
2957 
2961  virtual ~EffectLoader() {}
2962 
2973  virtual bool Load( const EFK_CHAR* path, void*& data, int32_t& size ) = 0;
2974 
2983  virtual void Unload( void* data, int32_t size ) = 0;
2984 };
2985 
2986 //----------------------------------------------------------------------------------
2987 //
2988 //----------------------------------------------------------------------------------
2989  }
2990 //----------------------------------------------------------------------------------
2991 //
2992 //----------------------------------------------------------------------------------
2993 #endif // __EFFEKSEER_EFFECTLOADER_H__
2994 
2995 #ifndef __EFFEKSEER_TEXTURELOADER_H__
2996 #define __EFFEKSEER_TEXTURELOADER_H__
2997 
2998 //----------------------------------------------------------------------------------
2999 // Include
3000 //----------------------------------------------------------------------------------
3001 
3002 //----------------------------------------------------------------------------------
3003 //
3004 //----------------------------------------------------------------------------------
3005 namespace Effekseer {
3006 //----------------------------------------------------------------------------------
3007 //
3008 //----------------------------------------------------------------------------------
3013 {
3014 public:
3019 
3023  virtual ~TextureLoader() {}
3024 
3034  virtual TextureData* Load( const EFK_CHAR* path, TextureType textureType ) { return nullptr; }
3035 
3053  virtual TextureData* Load(const void* data, int32_t size, TextureType textureType) { return nullptr; }
3054 
3062  virtual void Unload(TextureData* data ) {}
3063 };
3064 
3065 //----------------------------------------------------------------------------------
3066 //
3067 //----------------------------------------------------------------------------------
3068  }
3069 //----------------------------------------------------------------------------------
3070 //
3071 //----------------------------------------------------------------------------------
3072 #endif // __EFFEKSEER_TEXTURELOADER_H__
3073 
3074 #ifndef __EFFEKSEER_MODELLOADER_H__
3075 #define __EFFEKSEER_MODELLOADER_H__
3076 
3077 //----------------------------------------------------------------------------------
3078 // Include
3079 //----------------------------------------------------------------------------------
3080 
3081 //----------------------------------------------------------------------------------
3082 //
3083 //----------------------------------------------------------------------------------
3084 namespace Effekseer {
3085 //----------------------------------------------------------------------------------
3086 //
3087 //----------------------------------------------------------------------------------
3092 {
3093 public:
3098 
3102  virtual ~ModelLoader() {}
3103 
3112  virtual void* Load( const EFK_CHAR* path ) { return NULL; }
3113 
3128  virtual void* Load(const void* data, int32_t size) { return nullptr; }
3129 
3137  virtual void Unload( void* data ) {}
3138 };
3139 
3140 //----------------------------------------------------------------------------------
3141 //
3142 //----------------------------------------------------------------------------------
3143  }
3144 //----------------------------------------------------------------------------------
3145 //
3146 //----------------------------------------------------------------------------------
3147 #endif // __EFFEKSEER_MODELLOADER_H__
3148 
3149 #ifndef __EFFEKSEER_MATERIALLOADER_H__
3150 #define __EFFEKSEER_MATERIALLOADER_H__
3151 
3152 
3153 namespace Effekseer
3154 {
3155 
3162 {
3163 public:
3169  MaterialLoader() = default;
3170 
3176  virtual ~MaterialLoader() = default;
3177 
3189  virtual MaterialData* Load(const EFK_CHAR* path) { return nullptr; }
3190 
3208  virtual MaterialData* Load(const void* data, int32_t size, MaterialFileType fileType) { return nullptr; }
3209 
3218  virtual void Unload(MaterialData* data) {}
3219 };
3220 
3221 } // namespace Effekseer
3222 
3223 #endif // __EFFEKSEER_TEXTURELOADER_H__
3224 
3225 #ifndef __EFFEKSEER_MODEL_H__
3226 #define __EFFEKSEER_MODEL_H__
3227 
3228 //----------------------------------------------------------------------------------
3229 // Include
3230 //----------------------------------------------------------------------------------
3231 
3232 //----------------------------------------------------------------------------------
3233 //
3234 //----------------------------------------------------------------------------------
3235 namespace Effekseer {
3236 //----------------------------------------------------------------------------------
3237 //
3238 //----------------------------------------------------------------------------------
3244 class Model
3245 {
3246 public:
3247  static const int32_t Version = 1;
3248 
3249  struct Vertex
3250  {
3257  };
3258 
3260  {
3268  };
3269 
3270  struct Face
3271  {
3273  };
3274 
3275  struct Emitter
3276  {
3281  };
3282 
3283 private:
3284  uint8_t* m_data;
3285  int32_t m_size;
3286 
3287  int32_t m_version;
3288 
3289  struct InternalModel
3290  {
3291  int32_t m_vertexCount;
3292  Vertex* m_vertexes;
3293 
3294  int32_t m_faceCount;
3295  Face* m_faces;
3296  };
3297 
3298  InternalModel* models;
3299 
3300  int32_t m_modelCount;
3301  int32_t m_frameCount;
3302 
3303 protected:
3305 public:
3306 
3313  : m_data(NULL)
3314  , m_size(size)
3315  , m_version(0)
3316  , models(nullptr)
3317  {
3318  m_data = new uint8_t[m_size];
3319  memcpy(m_data, data, m_size);
3320 
3321  uint8_t* p = (uint8_t*) m_data;
3322 
3323  memcpy(&m_version, p, sizeof(int32_t));
3324  p += sizeof(int32_t);
3325 
3326  // load scale except version 3(for compatibility)
3327  if (m_version == 2 || m_version >= 5)
3328  {
3329  // Scale
3330  p += sizeof(int32_t);
3331  }
3332 
3333  memcpy(&m_modelCount, p, sizeof(int32_t));
3334  p += sizeof(int32_t);
3335 
3336  if (m_version >= 5)
3337  {
3338  memcpy(&m_frameCount, p, sizeof(int32_t));
3339  p += sizeof(int32_t);
3340  }
3341  else
3342  {
3343  m_frameCount = 1;
3344  }
3345 
3346  models = new InternalModel[m_frameCount];
3347 
3348  for (int32_t f = 0; f < m_frameCount; f++)
3349  {
3350  memcpy(&models[f].m_vertexCount, p, sizeof(int32_t));
3351  p += sizeof(int32_t);
3352 
3353  if (m_version >= 1)
3354  {
3355  models[f].m_vertexes = (Vertex*) p;
3356  p += (sizeof(Vertex) * models[f].m_vertexCount);
3357  }
3358  else
3359  {
3360  // allocate new buffer
3361  models[f].m_vertexes = new Vertex[models[f].m_vertexCount];
3362 
3363  for (int32_t i = 0; i < models[f].m_vertexCount; i++)
3364  {
3365  memcpy((void*)&models[f].m_vertexes[i], p, sizeof(Vertex) - sizeof(Color));
3366  models[f].m_vertexes[i].VColor = Color(255, 255, 255, 255);
3367 
3368  p += sizeof(Vertex) - sizeof(Color);
3369  }
3370  }
3371 
3372  memcpy(&models[f].m_faceCount, p, sizeof(int32_t));
3373  p += sizeof(int32_t);
3374 
3375  models[f].m_faces = (Face*) p;
3376  p += (sizeof(Face) * models[f].m_faceCount);
3377  }
3378  }
3379 
3380  Vertex* GetVertexes(int32_t index = 0) const { return models[index].m_vertexes; }
3381  int32_t GetVertexCount(int32_t index = 0) { return models[index].m_vertexCount; }
3382 
3383  Face* GetFaces(int32_t index = 0) const { return models[index].m_faces; }
3384  int32_t GetFaceCount(int32_t index = 0) { return models[index].m_faceCount; }
3385 
3386  int32_t GetFrameCount() const { return m_frameCount; }
3387 
3388  int32_t GetModelCount() { return m_modelCount; }
3389 
3390  int32_t GetVertexSize() const { return m_vertexSize; }
3391 
3397  virtual ~Model()
3398  {
3399  if (m_version == 0)
3400  {
3401  ES_SAFE_DELETE_ARRAY(models[0].m_vertexes);
3402  }
3403 
3404  ES_SAFE_DELETE_ARRAY(models);
3405  ES_SAFE_DELETE_ARRAY(m_data);
3406  }
3407 
3408  Emitter GetEmitter(IRandObject* g, int32_t time, CoordinateSystem coordinate, float magnification )
3409  {
3410  time = time % GetFrameCount();
3411 
3412  int32_t faceInd = (int32_t) ((GetFaceCount(time) - 1) * (g->GetRand()));
3413  faceInd = Clamp(faceInd, GetFaceCount(time) - 1, 0);
3414  Face& face = GetFaces(time)[faceInd];
3415  Vertex& v0 = GetVertexes(time)[face.Indexes[0]];
3416  Vertex& v1 = GetVertexes(time)[face.Indexes[1]];
3417  Vertex& v2 = GetVertexes(time)[face.Indexes[2]];
3418 
3419  float p1 = g->GetRand();
3420  float p2 = g->GetRand();
3421 
3422  // Fit within plane
3423  if( p1 + p2 > 1.0f )
3424  {
3425  p1 = 1.0f - p1;
3426  p2 = 1.0f - p2;
3427  }
3428 
3429  float p0 = 1.0f - p1 - p2;
3430 
3431  Emitter emitter;
3432  emitter.Position = (v0.Position * p0 + v1.Position * p1 + v2.Position * p2) * magnification;
3433  emitter.Normal = v0.Normal * p0 + v1.Normal * p1 + v2.Normal * p2;
3434  emitter.Binormal = v0.Binormal * p0 + v1.Binormal * p1 + v2.Binormal * p2;
3435  emitter.Tangent = v0.Tangent * p0 + v1.Tangent * p1 + v2.Tangent * p2;
3436 
3437  if( coordinate == CoordinateSystem::LH )
3438  {
3439  emitter.Position.Z = - emitter.Position.Z;
3440  emitter.Normal.Z = - emitter.Normal.Z;
3441  emitter.Binormal.Z = - emitter.Binormal.Z;
3442  emitter.Tangent.Z = - emitter.Tangent.Z;
3443  }
3444 
3445  return emitter;
3446  }
3447 
3448  Emitter GetEmitterFromVertex(IRandObject* g, int32_t time, CoordinateSystem coordinate, float magnification)
3449  {
3450  time = time % GetFrameCount();
3451 
3452  int32_t vertexInd = (int32_t) ((GetVertexCount(time) - 1) * (g->GetRand()));
3453  vertexInd = Clamp(vertexInd, GetVertexCount(time) - 1, 0);
3454  Vertex& v = GetVertexes(time)[vertexInd];
3455 
3456  Emitter emitter;
3457  emitter.Position = v.Position * magnification;
3458  emitter.Normal = v.Normal;
3459  emitter.Binormal = v.Binormal;
3460  emitter.Tangent = v.Tangent;
3461 
3462  if( coordinate == CoordinateSystem::LH )
3463  {
3464  emitter.Position.Z = - emitter.Position.Z;
3465  emitter.Normal.Z = - emitter.Normal.Z;
3466  emitter.Binormal.Z = - emitter.Binormal.Z;
3467  emitter.Tangent.Z = - emitter.Tangent.Z;
3468  }
3469 
3470  return emitter;
3471  }
3472 
3473  Emitter GetEmitterFromVertex(int32_t index, int32_t time, CoordinateSystem coordinate, float magnification)
3474  {
3475  time = time % GetFrameCount();
3476 
3477  int32_t vertexInd = index % GetVertexCount(time);
3478  Vertex& v = GetVertexes(time)[vertexInd];
3479 
3480  Emitter emitter;
3481  emitter.Position = v.Position * magnification;
3482  emitter.Normal = v.Normal;
3483  emitter.Binormal = v.Binormal;
3484  emitter.Tangent = v.Tangent;
3485 
3486  if( coordinate == CoordinateSystem::LH )
3487  {
3488  emitter.Position.Z = - emitter.Position.Z;
3489  emitter.Normal.Z = - emitter.Normal.Z;
3490  emitter.Binormal.Z = - emitter.Binormal.Z;
3491  emitter.Tangent.Z = - emitter.Tangent.Z;
3492  }
3493 
3494  return emitter;
3495  }
3496 
3497  Emitter GetEmitterFromFace(IRandObject* g, int32_t time, CoordinateSystem coordinate, float magnification)
3498  {
3499  time = time % GetFrameCount();
3500 
3501  int32_t faceInd = (int32_t) ((GetFaceCount(time) - 1) * (g->GetRand()));
3502  faceInd = Clamp(faceInd, GetFaceCount(time) - 1, 0);
3503  Face& face = GetFaces(time)[faceInd];
3504  Vertex& v0 = GetVertexes(time)[face.Indexes[0]];
3505  Vertex& v1 = GetVertexes(time)[face.Indexes[1]];
3506  Vertex& v2 = GetVertexes(time)[face.Indexes[2]];
3507 
3508  float p0 = 1.0f / 3.0f;
3509  float p1 = 1.0f / 3.0f;
3510  float p2 = 1.0f / 3.0f;
3511 
3512  Emitter emitter;
3513  emitter.Position = (v0.Position * p0 + v1.Position * p1 + v2.Position * p2) * magnification;
3514  emitter.Normal = v0.Normal * p0 + v1.Normal * p1 + v2.Normal * p2;
3515  emitter.Binormal = v0.Binormal * p0 + v1.Binormal * p1 + v2.Binormal * p2;
3516  emitter.Tangent = v0.Tangent * p0 + v1.Tangent * p1 + v2.Tangent * p2;
3517 
3518  if( coordinate == CoordinateSystem::LH )
3519  {
3520  emitter.Position.Z = - emitter.Position.Z;
3521  emitter.Normal.Z = - emitter.Normal.Z;
3522  emitter.Binormal.Z = - emitter.Binormal.Z;
3523  emitter.Tangent.Z = - emitter.Tangent.Z;
3524  }
3525 
3526  return emitter;
3527  }
3528 
3529  Emitter GetEmitterFromFace(int32_t index, int32_t time, CoordinateSystem coordinate, float magnification)
3530  {
3531  time = time % GetFrameCount();
3532 
3533  int32_t faceInd = index % (GetFaceCount(time) - 1);
3534  Face& face = GetFaces(time)[faceInd];
3535  Vertex& v0 = GetVertexes(time)[face.Indexes[0]];
3536  Vertex& v1 = GetVertexes(time)[face.Indexes[1]];
3537  Vertex& v2 = GetVertexes(time)[face.Indexes[2]];
3538 
3539  float p0 = 1.0f / 3.0f;
3540  float p1 = 1.0f / 3.0f;
3541  float p2 = 1.0f / 3.0f;
3542 
3543  Emitter emitter;
3544  emitter.Position = (v0.Position * p0 + v1.Position * p1 + v2.Position * p2) * magnification;
3545  emitter.Normal = v0.Normal * p0 + v1.Normal * p1 + v2.Normal * p2;
3546  emitter.Binormal = v0.Binormal * p0 + v1.Binormal * p1 + v2.Binormal * p2;
3547  emitter.Tangent = v0.Tangent * p0 + v1.Tangent * p1 + v2.Tangent * p2;
3548 
3549  if( coordinate == CoordinateSystem::LH )
3550  {
3551  emitter.Position.Z = - emitter.Position.Z;
3552  emitter.Normal.Z = - emitter.Normal.Z;
3553  emitter.Binormal.Z = - emitter.Binormal.Z;
3554  emitter.Tangent.Z = - emitter.Tangent.Z;
3555  }
3556 
3557  return emitter;
3558  }
3559 };
3560 
3561 //----------------------------------------------------------------------------------
3562 //
3563 //----------------------------------------------------------------------------------
3564  }
3565 //----------------------------------------------------------------------------------
3566 //
3567 //----------------------------------------------------------------------------------
3568 #endif // __EFFEKSEER_MODEL_H__
3569 
3570 #ifndef __EFFEKSEER_SOUND_PLAYER_H__
3571 #define __EFFEKSEER_SOUND_PLAYER_H__
3572 
3573 //----------------------------------------------------------------------------------
3574 // Include
3575 //----------------------------------------------------------------------------------
3576 
3577 //----------------------------------------------------------------------------------
3578 //
3579 //----------------------------------------------------------------------------------
3580 namespace Effekseer
3581 {
3582 //----------------------------------------------------------------------------------
3583 //
3584 //----------------------------------------------------------------------------------
3585 
3586 typedef void* SoundHandle;
3587 typedef void* SoundTag;
3588 
3590 {
3591 public:
3593  {
3594  void* Data;
3595  float Volume;
3596  float Pan;
3597  float Pitch;
3598  bool Mode3D;
3600  float Distance;
3601  };
3602 
3603 public:
3605 
3606  virtual ~SoundPlayer() {}
3607 
3608  virtual SoundHandle Play( SoundTag tag, const InstanceParameter& parameter ) = 0;
3609 
3610  virtual void Stop( SoundHandle handle, SoundTag tag ) = 0;
3611 
3612  virtual void Pause( SoundHandle handle, SoundTag tag, bool pause ) = 0;
3613 
3614  virtual bool CheckPlaying( SoundHandle handle, SoundTag tag ) = 0;
3615 
3616  virtual void StopTag( SoundTag tag ) = 0;
3617 
3618  virtual void PauseTag( SoundTag tag, bool pause ) = 0;
3619 
3620  virtual bool CheckPlayingTag( SoundTag tag ) = 0;
3621 
3622  virtual void StopAll() = 0;
3623 };
3624 
3625 //----------------------------------------------------------------------------------
3626 //
3627 //----------------------------------------------------------------------------------
3628 }
3629 //----------------------------------------------------------------------------------
3630 //
3631 //----------------------------------------------------------------------------------
3632 #endif // __EFFEKSEER_SOUND_PLAYER_H__
3633 
3634 #ifndef __EFFEKSEER_SOUNDLOADER_H__
3635 #define __EFFEKSEER_SOUNDLOADER_H__
3636 
3637 //----------------------------------------------------------------------------------
3638 // Include
3639 //----------------------------------------------------------------------------------
3640 
3641 //----------------------------------------------------------------------------------
3642 //
3643 //----------------------------------------------------------------------------------
3644 namespace Effekseer {
3645 //----------------------------------------------------------------------------------
3646 //
3647 //----------------------------------------------------------------------------------
3652 {
3653 public:
3658 
3662  virtual ~SoundLoader() {}
3663 
3672  virtual void* Load( const EFK_CHAR* path ) { return NULL; }
3673 
3688  virtual void* Load(const void* data, int32_t size) { return nullptr; }
3689 
3697  virtual void Unload( void* source ) {}
3698 };
3699 
3700 //----------------------------------------------------------------------------------
3701 //
3702 //----------------------------------------------------------------------------------
3703  }
3704 //----------------------------------------------------------------------------------
3705 //
3706 //----------------------------------------------------------------------------------
3707 #endif // __EFFEKSEER_SOUNDLOADER_H__
3708 
3709 #ifndef __EFFEKSEER_LOADER_H__
3710 #define __EFFEKSEER_LOADER_H__
3711 
3712 //----------------------------------------------------------------------------------
3713 // Include
3714 //----------------------------------------------------------------------------------
3715 
3716 //----------------------------------------------------------------------------------
3717 //
3718 //----------------------------------------------------------------------------------
3719 namespace Effekseer {
3720 //----------------------------------------------------------------------------------
3721 //
3722 //----------------------------------------------------------------------------------
3723 
3724 class EffectFactory;
3725 
3732  class Setting
3733  : public ReferenceObject
3734  {
3735  private:
3737  CoordinateSystem m_coordinateSystem;
3738 
3739  EffectLoader* m_effectLoader;
3740  TextureLoader* m_textureLoader;
3741  SoundLoader* m_soundLoader;
3742  ModelLoader* m_modelLoader;
3743  MaterialLoader* m_materialLoader = nullptr;
3744 
3745  std::vector<EffectFactory*> effectFactories;
3746 
3747  protected:
3751  Setting();
3752 
3756  ~Setting();
3757  public:
3758 
3762  static Setting* Create();
3763 
3769 
3777  void SetCoordinateSystem(CoordinateSystem coordinateSystem);
3778 
3784 
3789  void SetEffectLoader(EffectLoader* loader);
3790 
3796 
3801  void SetTextureLoader(TextureLoader* loader);
3802 
3808 
3813  void SetModelLoader(ModelLoader* loader);
3814 
3820 
3825  void SetSoundLoader(SoundLoader* loader);
3826 
3836 
3845  void SetMaterialLoader(MaterialLoader* loader);
3846 
3852  void AddEffectFactory(EffectFactory* effectFactory);
3853 
3860 
3866  void ClearEffectFactory();
3867 
3874  };
3875 
3876 //----------------------------------------------------------------------------------
3877 //
3878 //----------------------------------------------------------------------------------
3879  }
3880 //----------------------------------------------------------------------------------
3881 //
3882 //----------------------------------------------------------------------------------
3883 #endif // __EFFEKSEER_LOADER_H__
3884 
3885 #ifndef __EFFEKSEER_SERVER_H__
3886 #define __EFFEKSEER_SERVER_H__
3887 
3888 #if !( defined(_PSVITA) || defined(_XBOXONE) )
3889 
3890 //----------------------------------------------------------------------------------
3891 // Include
3892 //----------------------------------------------------------------------------------
3893 
3894 //----------------------------------------------------------------------------------
3895 //
3896 //----------------------------------------------------------------------------------
3897 namespace Effekseer {
3898 //----------------------------------------------------------------------------------
3899 //
3900 //----------------------------------------------------------------------------------
3906 class Server
3907 {
3908 public:
3909 
3910  Server() {}
3911  virtual ~Server() {}
3912 
3918  static Server* Create();
3919 
3925  virtual bool Start( uint16_t port ) = 0;
3926 
3932  virtual void Stop() = 0;
3933 
3945  virtual void Register(const EFK_CHAR* key, Effect* effect) = 0;
3946 
3955  virtual void Unregister(Effect* effect) = 0;
3956 
3969  virtual void Update(Manager** managers = nullptr, int32_t managerCount = 0, ReloadingThreadType reloadingThreadType = ReloadingThreadType::Main) = 0;
3970 
3976  virtual void SetMaterialPath( const EFK_CHAR* materialPath ) = 0;
3977 
3983  virtual void Regist(const EFK_CHAR* key, Effect* effect) = 0;
3984 
3990  virtual void Unregist(Effect* effect) = 0;
3991 };
3992 
3993 //----------------------------------------------------------------------------------
3994 //
3995 //----------------------------------------------------------------------------------
3996  }
3997 //----------------------------------------------------------------------------------
3998 //
3999 //----------------------------------------------------------------------------------
4000 
4001 #endif // #if !( defined(_PSVITA) || defined(_XBOXONE) )
4002 
4003 #endif // __EFFEKSEER_SERVER_H__
4004 
4005 #ifndef __EFFEKSEER_CLIENT_H__
4006 #define __EFFEKSEER_CLIENT_H__
4007 
4008 #if !( defined(_PSVITA) || defined(_PS4) || defined(_SWITCH) || defined(_XBOXONE) )
4009 
4010 //----------------------------------------------------------------------------------
4011 // Include
4012 //----------------------------------------------------------------------------------
4013 
4014 //----------------------------------------------------------------------------------
4015 //
4016 //----------------------------------------------------------------------------------
4017 namespace Effekseer {
4018 //----------------------------------------------------------------------------------
4019 //
4020 //----------------------------------------------------------------------------------
4021 class Client
4022 {
4023 public:
4024  Client() {}
4025  virtual ~Client() {}
4026 
4027  static Client* Create();
4028 
4029  virtual bool Start( char* host, uint16_t port ) = 0;
4030  virtual void Stop()= 0;
4031 
4032  virtual void Reload( const EFK_CHAR* key, void* data, int32_t size ) = 0;
4033  virtual void Reload( Manager* manager, const EFK_CHAR* path, const EFK_CHAR* key ) = 0;
4034  virtual bool IsConnected() = 0;
4035 };
4036 
4037 //----------------------------------------------------------------------------------
4038 //
4039 //----------------------------------------------------------------------------------
4040  }
4041 //----------------------------------------------------------------------------------
4042 //
4043 //----------------------------------------------------------------------------------
4044 
4045 #endif // #if !( defined(_PSVITA) || defined(_PS4) || defined(_SWITCH) || defined(_XBOXONE) )
4046 
4047 #endif // __EFFEKSEER_CLIENT_H__
virtual int Release()
参照カウンタを減算する。0になった時、インスタンスを削除する。
Definition: Effekseer.h:500
TextureFormatType TextureFormat
Definition: Effekseer.h:545
A class to edit an instance of EffectParameter for supporting original format when a binary is loaded...
Definition: Effekseer.h:1695
virtual int AddRef()
参照カウンタを加算する。
Definition: Effekseer.h:488
エフェクトファイル読み込み破棄関数指定クラス
Definition: Effekseer.h:2950
virtual void SetRemovingCallback(Handle handle, EffectInstanceRemovingCallback callback)=0
エフェクトのインスタンスに廃棄時のコールバックを設定する。
T Min(T t, U u)
最小値取得
Definition: Effekseer.h:279
virtual bool GetPaused(Handle handle)=0
Get status that a particle of effect specified is paused. Particle's handle.
標準のファイル読み込みクラス
Definition: Effekseer.h:1528
virtual EffectNode * GetRoot() const =0
Rootを取得する。
MaterialFileType
Definition: Effekseer.h:218
virtual int GetChildrenCount() const =0
子のノードの数を取得する。
GLenum GLenum dst
Vector2D Size() const
virtual const EFK_CHAR * GetWavePath(int n) const =0
Get a wave's path.
GLenum GLuint GLint GLenum face
virtual void OnLoadingResource(Effect *effect, const void *data, int32_t size, const EFK_CHAR *materialPath)
this method is called when load resources
char16_t EFK_CHAR
Definition: Effekseer.h:50
void Seek(int position)
int32_t m_vertexSize
Definition: Effekseer.h:3304
virtual void Flush()=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処理時間を取得。
DefaultFileReader(FILE *filePtr)
int32_t LastInstanceEndMin
Minimum end time that the last instance may exist.
Definition: Effekseer.h:1680
virtual void CreateCullingWorld(float xsize, float ysize, float zsize, int32_t layerCount)=0
エフェクトをカリングし描画負荷を減らすための空間を生成する。
Vector2D Position() const
static float Length(const Vector3D &in)
長さ
RendererMaterialType MaterialType
Definition: Effekseer.h:641
Color()=default
コンストラクタ
virtual ReferenceObject * GetLoadingParameter() const =0
Get loading parameter supecfied by EffectFactory. This parameter is not used unless EffectFactory is ...
Textures used by material.
Definition: Effekseer.h:598
Vector3D operator *(const float &o) const
void RotationZ(float angle)
反時計周り方向のZ軸回転行列化を行う。
T Max(T t, U u)
最大値取得
Definition: Effekseer.h:266
void SetMallocFunc(MallocFunc func)
GLdouble GLdouble t
Definition: SDL_opengl.h:2071
virtual void ReloadResources(const void *data=nullptr, int32_t size=0, const EFK_CHAR *materialPath=nullptr)=0
画像等リソースの再読み込みを行う。
virtual const EFK_CHAR * GetMaterialPath(int n) const =0
Get a material's path.
virtual void * Load(const void *data, int32_t size)
a function called when sound is loaded data pointer the size of data a pointer of loaded texture
Definition: Effekseer.h:3688
CoordinateSystem GetCoordinateSystem() const
座標系を取得する。
GLdouble n
void RotationZ(float angle)
Z軸回転行列(右手)
virtual void SetModelRenderer(ModelRenderer *renderer)=0
モデル描画機能を設定する。
virtual TrackRenderer * GetTrackRenderer()=0
軌跡描画機能を取得する。
#define ES_SAFE_DELETE_ARRAY(val)
Definition: Effekseer.h:127
virtual EffectInstanceTerm CalculateInstanceTerm(EffectInstanceTerm &parentTerm) const =0
Calculate a term of instances where instances exists.
Model parameter It may change greatly.
Definition: Effekseer.h:2162
Terms where an effect exists.
Definition: Effekseer.h:1609
int32_t Type
0 - color, 1 - value
Definition: Effekseer.h:601
static Vector3D & Cross(Vector3D &o, const Vector3D &in1, const Vector3D &in2)
外積
virtual int32_t GetColorImageCount() const =0
格納されている画像のポインタの個数を取得する。
int32_t ConvertUtf8ToUtf16(int16_t *dst, int32_t dst_size, const int8_t *src)
文字コードを変換する。(UTF8 -> UTF16)
Definition: Effekseer.h:361
Parameters for Manager::Draw and Manager::DrawHandle.
Definition: Effekseer.h:2263
ModelLoader * GetModelLoader()
モデルローダーを取得する。
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
TextureFormatType
Definition: Effekseer.h:224
signed int int32_t
virtual int32_t GetDistortionImageCount() const =0
格納されている歪み画像のポインタの個数を取得する。
virtual void SetRotation(Handle handle, float x, float y, float z)=0
エフェクトのインスタンスの回転角度を指定する。(ラジアン)
int32_t GetFaceCount(int32_t index=0)
Definition: Effekseer.h:3384
void SetLoadingParameter(Effect *effect, ReferenceObject *obj)
set loading data
void SetFreeFunc(FreeFunc func)
void deallocate(T *p, std::size_t n)
Definition: Effekseer.h:785
GLint GLint GLsizei width
Definition: SDL_opengl.h:1572
unsigned short uint16_t
virtual void SetAutoDrawing(Handle handle, bool autoDraw)=0
エフェクトがDrawで描画されるか設定する。 autoDrawがfalseの場合、DrawHandleで描画する必要がある。
virtual int GetRef()
参照カウンタを取得する。
Definition: Effekseer.h:495
virtual MallocFunc GetMallocFunc() const =0
get an allocator
ノードインスタンス生成クラス
Definition: Effekseer.h:2172
void RotationXYZ(float rx, float ry, float rz)
反時計周り方向のXYZ軸回転行列化を行う。
Model(void *data, int32_t size)
Constructor.
Definition: Effekseer.h:3312
EffectLoader * GetEffectLoader()
エフェクトローダーを取得する。
virtual void SetTrackRenderer(TrackRenderer *renderer)=0
軌跡描画機能を設定する。
virtual EffectBasicRenderParameter GetBasicRenderParameter()=0
共通描画パラメーターを取得する。
T Clamp(T t, U max_, V min_)
範囲内値取得
Definition: Effekseer.h:292
virtual int GetGeneration() const =0
Get a generation in the node tree. The generation increases by 1 as it moves a child node.
static Effect * Create(Manager *manager, void *data, int32_t size, float magnification=1.0f, const EFK_CHAR *materialPath=NULL)
エフェクトを生成する。
virtual void SetBasicRenderParameter(EffectBasicRenderParameter param)=0
共通描画パラメーターを設定する。
Matrix44 & OrthographicLH(float width, float height, float zn, float zf)
正射影行列化(左手系)
virtual bool OnCheckIsBinarySupported(const void *data, int32_t size)
this method is called to check whether loaded binary are supported.
GLfloat GLfloat p
virtual size_t Read(void *buffer, size_t size)=0
virtual EffectModelParameter GetEffectModelParameter()=0
Get a model parameter.
static void Add(Vector3D *pOut, const Vector3D *pIn1, const Vector3D *pIn2)
加算
virtual void RessignCulling()=0
現在存在するエフェクトのハンドルからカリングの空間を配置しなおす。
virtual int32_t GetRestInstancesCount() const =0
Gets the number of remaining allocated instances.
virtual void Destroy()=0
マネージャーを破棄する。
This object generates random values.
Definition: Effekseer.h:516
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
Vector3D operator -(const Vector3D &o) const
virtual bool Reload(void *data, int32_t size, const EFK_CHAR *materialPath=nullptr, ReloadingThreadType reloadingThreadType=ReloadingThreadType::Main)=0
Reload this effect An effect's data An effect's size A path where reaources are loaded A thread where...
ModelLoader()
コンストラクタ
Definition: Effekseer.h:3097
void RotationY(float angle)
Y軸回転行列(右手)
size_t Read(void *buffer, size_t size)
Vector2D()
コンストラクタ
void SetModelLoader(ModelLoader *loader)
モデルローダーを設定する。
float Values[4][4]
行列の値
Definition: Effekseer.h:1313
virtual RandFunc GetRandFunc() const =0
ランダム関数を取得する。
void GetRotation(Matrix43 &r) const
行列から回転行列を取得する。
virtual float GetSpeed(Handle handle) const =0
Get a playing speed of particle of effect. Particle's handle Speed.
Matrix44 & PerspectiveFovRH_OpenGL(float ovY, float aspect, float zn, float zf)
OpenGL用射影行列化(右手系)
virtual void Stop(SoundHandle handle, SoundTag tag)=0
virtual void SetMatrix(Handle handle, const Matrix43 &mat)=0
エフェクトのインスタンスに変換行列を設定する。
virtual void SetEffectLoader(EffectLoader *effectLoader)=0
エフェクト読込クラスを設定する。
virtual int GetLayer(Handle handle)=0
Get a layer index For example, if effect's layer is 1 and CameraCullingMask's first bit is 1,...
virtual bool IsConnected()=0
virtual void SetRandMax(int max_)=0
ランダム関数を設定する。
virtual bool CheckPlaying(SoundHandle handle, SoundTag tag)=0
ShadingModelType ShadingModel
Definition: Effekseer.h:577
static Vector3D & TransformWithW(Vector3D &o, const Vector3D &in, const Matrix44 &mat)
virtual const char * GetName() const
virtual bool GetShown(Handle handle)=0
Get status that a particle of effect specified is shown. Particle's handle.
virtual void SetSoundLoader(SoundLoader *soundLoader)=0
サウンド読込クラスを設定する。
サウンド読み込み破棄関数指定クラス
Definition: Effekseer.h:3651
Matrix44 & LookAtRH(const Vector3D &eye, const Vector3D &at, const Vector3D &up)
カメラ行列化(右手系)
int32_t FirstInstanceEndMax
Maximum end time that the first instance may exist.
Definition: Effekseer.h:1659
Handle bool isRemovingManager
Definition: Effekseer.h:122
static Client * Create()
virtual ~TextureLoader()
デストラクタ
Definition: Effekseer.h:3023
virtual ModelLoader * GetModelLoader()=0
モデル読込クラスを取得する。
GLuint const GLchar * name
virtual void Stop()=0
stop a server
void ToMatrix44(Matrix44 &dst)
convert into matrix44
int32_t MaterialIndex
material index in MaterialType::File
Definition: Effekseer.h:612
Vector3D & operator/=(const float &o)
static Server * Create()
create a server instance
virtual int GetRandMax() const =0
ランダム最大値を取得する。
signed short int16_t
virtual MaterialData * GetMaterial(int n) const =0
Get a material's pointer.
Vector3D & operator -=(const Vector3D &o)
T * allocate(std::size_t n)
Definition: Effekseer.h:784
virtual MaterialLoader * GetMaterialLoader()=0
get a material loader loader
virtual Matrix43 GetMatrix(Handle handle)=0
エフェクトのインスタンスに設定されている行列を取得する。
virtual EffectNode * GetChild(int index) const =0
子のノードを取得する。
Vector3D & operator+=(const Vector3D &o)
GLfloat GLfloat GLfloat v2
factory class for io
Definition: Effekseer.h:1484
uint8_t A
透明度
Definition: Effekseer.h:1022
エフェクト管理クラス
Definition: Effekseer.h:2253
GLsizeiptr size
const int32_t TextureSlotMax
the maximum number of texture slot including textures system specified
Definition: Effekseer.h:135
GLfloat param
static Vector3D & Transform(Vector3D &o, const Vector3D &in, const Matrix43 &mat)
MaterialLoader * GetMaterialLoader()
get a material loader loader
virtual void SetTargetLocation(Handle handle, float x, float y, float z)=0
エフェクトのインスタンスのターゲット位置を指定する。
virtual size_t GetLength()=0
Matrix44 & Indentity()
単位行列化
Emitter GetEmitterFromVertex(IRandObject *g, int32_t time, CoordinateSystem coordinate, float magnification)
Definition: Effekseer.h:3448
virtual FreeFunc GetFreeFunc() const =0
get a deallocator
static Matrix44 & Mul(Matrix44 &o, const Matrix44 &in1, const Matrix44 &in2)
乗算
static Vector3D & Sub(Vector3D &o, const Vector3D &in1, const Vector3D &in2)
減算
void Seek(int position)
Texture data.
Definition: Effekseer.h:541
virtual bool Exists(Handle handle)=0
エフェクトのインスタンスが存在しているか取得する。
Matrix44 & LookAtLH(const Vector3D &eye, const Vector3D &at, const Vector3D &up)
カメラ行列化(左手系)
virtual void PauseTag(SoundTag tag, bool pause)=0
bool operator!=(const CustomAllocator< T > &, const CustomAllocator< U > &)
Definition: Effekseer.h:790
virtual TextureData * Load(const void *data, int32_t size, TextureType textureType)
a function called when texture is loaded data pointer the size of data a kind of texture a pointer of...
Definition: Effekseer.h:3053
virtual void SetRandFunc(RandFunc func)=0
ランダム関数を設定する。
static float Dot(const Vector3D &in1, const Vector3D &in2)
内積
bool operator==(const Vector3D &o)
Vector3D operator-()
virtual int GetRef()=0
参照カウンタを取得する。
virtual void SetRingRenderer(RingRenderer *renderer)=0
リング描画機能を設定する。
int Handle
Definition: Effekseer.h:87
virtual void SetSpriteRenderer(SpriteRenderer *renderer)=0
スプライト描画機能を設定する。
const GLdouble * v
Definition: SDL_opengl.h:2064
Emitter GetEmitterFromFace(IRandObject *g, int32_t time, CoordinateSystem coordinate, float magnification)
Definition: Effekseer.h:3497
virtual void Seek(int position)=0
virtual SpriteRenderer * GetSpriteRenderer()=0
スプライト描画機能を取得する。
Vertex * GetVertexes(int32_t index=0) const
Definition: Effekseer.h:3380
int(EFK_STDCALL * RandFunc)(void)
Random Function.
Definition: Effekseer.h:114
void RotationAxis(const Vector3D &axis, float angle)
任意軸に対する反時計周り方向回転行列化を行う。
virtual const EFK_CHAR * GetColorImagePath(int n) const =0
Get a color image's path.
CoordinateSystem
Definition: Effekseer.h:199
std::vector< T, CustomAlignedAllocator< T > > CustomAlignedVector
Definition: Effekseer.h:793
void RotationX(float angle)
反時計周り方向のX軸回転行列化を行う。
virtual void AddLocation(Handle handle, const Vector3D &location)=0
エフェクトのインスタンスの位置に加算する。
SoundLoader()
コンストラクタ
Definition: Effekseer.h:3657
virtual Handle Play(Effect *effect, float x, float y, float z)=0
再生する。
virtual EffectTerm CalculateTerm() const =0
void operator()(T *ptr) const
Definition: Effekseer.h:444
virtual Matrix43 GetBaseMatrix(Handle handle)=0
エフェクトのベース行列を取得する。
void SetAlignedFreeFunc(AlignedFreeFunc func)
virtual FileReader * OpenRead(const EFK_CHAR *path)=0
virtual size_t GetLength()=0
virtual void SetModelLoader(ModelLoader *modelLoader)=0
モデル読込クラスを設定する。
virtual ~EffectLoader()
デストラクタ
Definition: Effekseer.h:2961
Setting()
コンストラクタ
virtual ~Server()
Definition: Effekseer.h:3911
virtual void SetMaterialLoader(MaterialLoader *loader)=0
specfiy a material loader loader
virtual const char16_t * GetName() const =0
Get this effect's name. If this effect is loaded from file, default name is file name without extenti...
static Manager * Create(int instance_max, bool autoFlip=true)
マネージャーを生成する。
virtual EffectLoader * GetEffectLoader()=0
エフェクト読込クラスを取得する。
Terms where instances exists.
Definition: Effekseer.h:1631
virtual SoundHandle Play(SoundTag tag, const InstanceParameter &parameter)=0
virtual int GetPosition()=0
static Color Mul(Color in1, Color in2)
乗算
virtual void SetShown(Handle handle, bool shown)=0
エフェクトのインスタンスをDraw時に描画するか設定する。
size_t Write(const void *buffer, size_t size)
virtual void SetBaseMatrix(Handle handle, const Matrix43 &mat)=0
エフェクトのベース行列を設定する。
virtual int AddRef()=0
参照カウンタを加算する。
void SetEffectLoader(EffectLoader *loader)
エフェクトローダーを設定する。
virtual void Pause(SoundHandle handle, SoundTag tag, bool pause)=0
void SetSoundLoader(SoundLoader *loader)
サウンドローダーを設定する。
virtual bool OnLoading(Effect *effect, const void *data, int32_t size, float magnification, const EFK_CHAR *materialPath)
this method is called when load a effect from binary
int32_t TermMax
Maximum end time that the effect may exist.
Definition: Effekseer.h:1623
typedef void(EFK_STDCALL *EffectInstanceRemovingCallback)(Manager *manager
エフェクトのインスタンス破棄時のコールバックイベント
bool IsValid() const
check whether all values are not valid number(not nan, not inf)
void * SoundTag
Definition: Effekseer.h:3587
virtual void Update(float deltaFrame=1.0f)=0
Update all effects. passed time (1 is 1/60 seconds)
Vector3D & operator *=(const float &o)
テクスチャ読み込み破棄関数指定クラス
Definition: Effekseer.h:3012
GLsizei const GLfloat * value
virtual void SetMaterialPath(const EFK_CHAR *materialPath)=0
Specify root path to load materials.
virtual TextureLoader * GetTextureLoader()=0
テクスチャ読込クラスを取得する。
TextureFilterType
Definition: Effekseer.h:169
virtual void CalcCulling(const Matrix44 &cameraProjMat, bool isOpenGL)=0
カリングを行い、カリングされたオブジェクトのみを描画するようにする。
void(EFK_STDCALL * FreeFunc)(void *p, unsigned int size)
Memory Free function.
Definition: Effekseer.h:99
GLenum GLuint GLint GLint layer
モデル読み込み破棄関数指定クラス
Definition: Effekseer.h:3091
bool operator==(const CustomAllocator< T > &, const CustomAllocator< U > &)
Definition: Effekseer.h:788
virtual int GetUpdateTime() const =0
Update処理時間を取得。
virtual ~Manager()
Definition: Effekseer.h:2283
virtual void Unload(TextureData *data)
テクスチャを破棄する。
Definition: Effekseer.h:3062
virtual float GetDynamicInput(Handle handle, int32_t index)=0
get a dynamic parameter, which changes effect parameters dynamically while playing
std::vector< std::array< float, 4 > > MaterialUniforms
used uniforms in MaterialType::File
Definition: Effekseer.h:618
GLint location
Material data.
Definition: Effekseer.h:574
GLfloat f
virtual void DrawHandleBack(Handle handle, const Manager::DrawParameter &drawParameter=Manager::DrawParameter())=0
Draw particles in the back of priority 0.
CustomAlignedAllocator(const CustomAlignedAllocator< U > &)
Definition: Effekseer.h:782
Material loader.
Definition: Effekseer.h:3161
virtual void SetCoordinateSystem(CoordinateSystem coordinateSystem)=0
座標系を設定する。
virtual bool OnCheckIsReloadSupported()
this method is called to check whether reloading are supported.
virtual void * Load(const EFK_CHAR *path)
サウンドを読み込む。
Definition: Effekseer.h:3672
virtual const EFK_CHAR * GetDistortionImagePath(int n) const =0
Get a distortion image's path.
std::unique_ptr< T, ReferenceDeleter< T > > CreateUniqueReference(T *ptr, bool addRef=false)
Definition: Effekseer.h:454
virtual void * Load(const void *data, int32_t size)
a function called when model is loaded data pointer the size of data a pointer of loaded texture
Definition: Effekseer.h:3128
virtual void SetRibbonRenderer(RibbonRenderer *renderer)=0
ストライプ描画機能を設定する。
int32_t FirstInstanceStartMin
Minimum start time that the first instance may exist.
Definition: Effekseer.h:1638
float Value[4][3]
行列の値
Definition: Effekseer.h:1138
void RotationX(float angle)
X軸回転行列(右手)
virtual void Unregister(Effect *effect)=0
unregister an effect an effect registered
bool HasMipmap
for OpenGL, it is ignored in other apis
Definition: Effekseer.h:550
Effect parameters.
Definition: Effekseer.h:1798
void * SoundHandle
Definition: Effekseer.h:3586
MaterialLoader()=default
Constructor.
#define FLT_MAX
Definition: irrMath.h:31
virtual void SetSoundPlayer(SoundPlayer *soundPlayer)=0
サウンド再生機能を設定する。
virtual ~Model()
Destructor.
Definition: Effekseer.h:3397
Material parameter for shaders.
Definition: Effekseer.h:609
virtual void EndUpdate()=0
Stop to update effects. It is not required if Update is called.
GLsizei GLsizei GLchar * source
Matrix44 & PerspectiveFovLH(float ovY, float aspect, float zn, float zf)
射影行列化(左手系)
~Setting()
デストラクタ
virtual bool Load(const EFK_CHAR *path, void *&data, int32_t &size)=0
エフェクトファイルを読み込む。
a deleter for IReference
Definition: Effekseer.h:442
virtual void DrawHandle(Handle handle, const Manager::DrawParameter &drawParameter=Manager::DrawParameter())=0
Draw particles with a handle.
void Quaternion(float x, float y, float z, float w)
クオータニオンから行列に変換
Matrix44 & Transpose()
転置行列化
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
const T & min_(const T &a, const T &b)
returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)
Definition: irrMath.h:124
virtual ~SoundLoader()
デストラクタ
Definition: Effekseer.h:3662
ファイル読み込みクラス
Definition: Effekseer.h:1438
std::vector< T, CustomAllocator< T > > CustomVector
Definition: Effekseer.h:792
virtual void SetPausedToAllEffects(bool paused)=0
Pause or resume all particle of effects. Pause or resume.
Matrix44()
コンストラクタ
AlignedFreeFunc GetAlignedFreeFunc()
get a deallocator
SoundLoader * GetSoundLoader()
サウンドローダーを取得する。
void SetMaterial(Effect *effect, int32_t index, MaterialData *data)
set material data into specified index
virtual void Unload(void *source)
サウンドを破棄する。
Definition: Effekseer.h:3697
int32_t GetEffectFactoryCount() const
Get the number of effect factory.
void RotationY(float angle)
反時計周り方向のY軸回転行列化を行う。
3次元ベクトル
Definition: Effekseer.h:870
FreeFunc GetFreeFunc()
get a deallocator
virtual SoundLoader * GetSoundLoader()=0
サウンド読込クラスを取得する
3次元ベクトル
Definition: Effekseer.h:818
ファイル書き込みクラス
Definition: Effekseer.h:1459
virtual void SetLocation(Handle handle, float x, float y, float z)=0
エフェクトのインスタンスの位置を指定する。
void Translation(float x, float y, float z)
移動行列化を行う。
virtual void SetDynamicInput(Handle handle, int32_t index, float value)=0
specfiy a dynamic parameter, which changes effect parameters dynamically while playing
参照カウンタのインターフェース
Definition: Effekseer.h:416
virtual int32_t GetMaterialCount() const =0
Get the number of stored material pointer.
virtual ~IRandObject()=default
const T & max_(const T &a, const T &b)
returns maximum of two values. Own implementation to get rid of the STL (VS6 problems)
Definition: irrMath.h:138
void SetSound(Effect *effect, int32_t index, void *data)
set sound data into specified index
void SetTexture(Effect *effect, int32_t index, TextureType type, TextureData *data)
set texture data into specified index
virtual int GetVersion() const =0
エフェクトデータのバージョン取得
virtual void SetLayer(Handle handle, int32_t layer)=0
Set a layer index.
共通描画パラメーター
Definition: Effekseer.h:2141
AlphaBlendType
アルファブレンド
Definition: Effekseer.h:145
virtual ~FileInterface()=default
T * allocate(std::size_t n)
Definition: Effekseer.h:772
static float LengthSq(const Vector3D &in)
長さの二乗
virtual int32_t GetModelCount() const =0
格納されているモデルのポインタの個数を取得する。
GLuint index
virtual MaterialData * Load(const void *data, int32_t size, MaterialFileType fileType)
a function called when a material is loaded data pointer the size of data file type a pointer of load...
Definition: Effekseer.h:3208
virtual void Register(const EFK_CHAR *key, Effect *effect)=0
register an effect as a target to edit. a key to search an effect an effect to be edit
static Matrix44 & Inverse(Matrix44 &o, const Matrix44 &in)
逆行列
void SetTextureLoader(TextureLoader *loader)
テクスチャローダーを設定する。
virtual void * Load(const EFK_CHAR *path)
モデルを読み込む。
Definition: Effekseer.h:3112
void GetSRT(Vector3D &s, Matrix43 &r, Vector3D &t) const
行列を、拡大、回転、移動の行列とベクトルに分解する。
AlignedMallocFunc GetAlignedMallocFunc()
get an allocator
static void Normal(Vector3D &o, const Vector3D &in)
単位ベクトル
void GetTranslation(Vector3D &t) const
行列から移動ベクトルを取得する。
virtual void Unload(MaterialData *data)
dispose a material a pointer of loaded a material
Definition: Effekseer.h:3218
#define EFK_STDCALL
Definition: Effekseer.h:24
virtual Vector3D GetLocation(Handle handle)=0
エフェクトのインスタンスの位置を取得する。
std::set< T, std::less< T >, CustomAllocator< T > > CustomSet
Definition: Effekseer.h:795
virtual int32_t GetWaveCount() const =0
格納されている音波形のポインタの個数を取得する。
virtual float GetMaginification() const =0
Get the magnification multiplied by the magnification at the time of loaded and exported.
int32_t GetVertexCount(int32_t index=0)
Definition: Effekseer.h:3381
int32_t LastInstanceStartMax
Maximum start time that the last instance may exist.
Definition: Effekseer.h:1673
A server to edit effect from client such an editor.
Definition: Effekseer.h:3906
virtual void Unload(void *data, int32_t size)=0
エフェクトファイルを破棄する。
virtual void StopRoot(Handle handle)=0
エフェクトのルートだけを停止する。
virtual FileReader * TryOpenRead(const EFK_CHAR *path)
try to open a reader. It need not to succeeds in opening it.
Definition: Effekseer.h:1498
#define NULL
Definition: begin_code.h:167
static Color Lerp(const Color in1, const Color in2, float t)
線形補間
unsigned char uint8_t
void RotationZXY(float rz, float rx, float ry)
反時計周り方向のZXY軸回転行列化を行う。
virtual int GetPosition()=0
virtual TextureData * GetDistortionImage(int n) const =0
格納されている歪み画像のポインタを取得する。
Emitter GetEmitterFromVertex(int32_t index, int32_t time, CoordinateSystem coordinate, float magnification)
Definition: Effekseer.h:3473
std::vector< MaterialTextureParameter > MaterialTextures
used textures in MaterialType::File
Definition: Effekseer.h:615
Vector3D operator+(const Vector3D &o) const
signed char int8_t
virtual FileWriter * OpenWrite(const EFK_CHAR *path)=0
virtual void StopAllEffects()=0
全てのエフェクトを停止する。
int32_t ConvertUtf16ToUtf8(int8_t *dst, int32_t dst_size, const int16_t *src)
文字コードを変換する。(UTF16 -> UTF8)
Definition: Effekseer.h:317
virtual void Reload(const EFK_CHAR *key, void *data, int32_t size)=0
virtual void StopEffect(Handle handle)=0
エフェクトを停止する。
GLenum func
virtual void Stop()=0
int32_t FirstInstanceStartMax
Maximum start time that the first instance may exist.
Definition: Effekseer.h:1645
Emitter GetEmitter(IRandObject *g, int32_t time, CoordinateSystem coordinate, float magnification)
Definition: Effekseer.h:3408
virtual void SetAllColor(Handle handle, Color color)=0
Specify the color of overall effect.
virtual int GetCameraCullingMaskToShowAllEffects()=0
Get a camera's culling mask to show all effects.
void SetAlignedMallocFunc(AlignedMallocFunc func)
GLboolean GLboolean GLboolean b
virtual float GetRand()=0
virtual ~ModelLoader()
デストラクタ
Definition: Effekseer.h:3102
GLdouble s
Definition: SDL_opengl.h:2063
static void Multiple(Matrix43 &out, const Matrix43 &in1, const Matrix43 &in2)
行列同士の乗算を行う。
virtual void DrawHandleFront(Handle handle, const Manager::DrawParameter &drawParameter=Manager::DrawParameter())=0
Draw particles in the front of priority 0.
Vector2D & operator+=(const Vector2D &value)
virtual void SetSetting(Setting *setting)=0
設定クラスを設定する。
virtual ModelRenderer * GetModelRenderer()=0
モデル描画機能を取得する。
void *(EFK_STDCALL * AlignedMallocFunc)(unsigned int size, unsigned int alignment)
AlignedMemory Allocation function.
Definition: Effekseer.h:104
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
virtual ~MaterialData()=default
virtual int32_t GetTotalInstanceCount() const =0
Get the number of instances which is used in playing effects The number of instancesThe number of Roo...
void SetSRT(const Vector3D &s, const Matrix43 &r, const Vector3D &t)
行列の拡大、回転、移動を設定する。
virtual void BeginUpdate()=0
Start to update effects. It is not required if Update is called.
virtual SoundPlayer * GetSoundPlayer()=0
サウンド再生機能を取得する。
virtual void StopTag(SoundTag tag)=0
virtual int32_t GetNormalImageCount() const =0
格納されている法線画像のポインタの個数を取得する。
const int32_t LocalFieldSlotMax
Definition: Effekseer.h:137
Vector3D()
コンストラクタ
DefaultFileWriter(FILE *filePtr)
virtual void Regist(const EFK_CHAR *key, Effect *effect)=0
deprecated
virtual MaterialData * Load(const EFK_CHAR *path)
load a material a file path a pointer of loaded a material
Definition: Effekseer.h:3189
GLuint color
Vector3D operator/(const float &o) const
virtual void UpdateHandle(Handle handle, float deltaFrame=1.0f)=0
Update an effect by a handle. a handle. passed time (1 is 1/60 seconds)You need to call BeginUpdate b...
GLuint buffer
void SetCoordinateSystem(CoordinateSystem coordinateSystem)
座標系を設定する。
uint8_t R
Definition: Effekseer.h:1007
void Translation(float x, float y, float z)
移動行列
virtual CoordinateSystem GetCoordinateSystem() const =0
座標系を取得する。
GLfloat v0
virtual void DrawFront(const Manager::DrawParameter &drawParameter=Manager::DrawParameter())=0
Draw particles in the front of priority 0.
virtual void UnloadResources()=0
画像等リソースの破棄を行う。
virtual bool CheckPlayingTag(SoundTag tag)=0
int32_t FirstInstanceEndMin
Minimum end time that the first instance may exist.
Definition: Effekseer.h:1652
virtual void SetScale(Handle handle, float x, float y, float z)=0
エフェクトのインスタンスの拡大率を指定する。
virtual int32_t GetInstanceCount(Handle handle)=0
エフェクトに使用されているインスタンス数を取得する。
GLfloat angle
EffectLoader()
コンストラクタ
Definition: Effekseer.h:2956
virtual TextureData * GetNormalImage(int n) const =0
格納されている法線画像のポインタを取得する。
void Scaling(float x, float y, float z)
拡大行列化を行う。
::Effekseer::EffectLoader * CreateEffectLoader(::Effekseer::FileInterface *fileInterface=NULL)
標準のエフェクト読込インスタンスを生成する。
Model class.
Definition: Effekseer.h:3244
virtual void StopAll()=0
virtual ~Effect()
Definition: Effekseer.h:1803
Matrix44 & OrthographicRH(float width, float height, float zn, float zf)
正射影行列化(右手系)
virtual void SetName(const char16_t *name)=0
GLuint GLuint GLsizei GLenum type
Definition: SDL_opengl.h:1571
EffectFactory * GetEffectFactory(int32_t ind) const
Get effect factory.
int32_t LastInstanceEndMax
Maximum end time that the last instance may exist.
Definition: Effekseer.h:1687
Face * GetFaces(int32_t index=0) const
Definition: Effekseer.h:3383
static Setting * Create()
設定インスタンスを生成する。
virtual void SetSpeed(Handle handle, float speed)=0
エフェクトのインスタンスを再生スピードを設定する。
設定クラス
Definition: Effekseer.h:3732
int32_t LastInstanceStartMin
Minimum start time that the last instance may exist.
Definition: Effekseer.h:1666
int32_t GetVertexSize() const
Definition: Effekseer.h:3390
void SetModel(Effect *effect, int32_t index, void *data)
set model data into specified index
Common parameters which is passed into a renderer.
Definition: Effekseer.h:639
void GetScale(Vector3D &s) const
行列から拡大ベクトルを取得する。
GLsizei const GLchar *const * path
GLboolean GLboolean GLboolean GLboolean a
virtual bool Start(char *host, uint16_t port)=0
virtual Setting * GetSetting() const =0
設定を取得する。
virtual RibbonRenderer * GetRibbonRenderer()=0
ストライプ描画機能を取得する。
GLubyte GLubyte GLubyte GLubyte w
void deallocate(T *p, std::size_t n)
Definition: Effekseer.h:773
void SetMaterialLoader(MaterialLoader *loader)
specfiy a material loader loader
void RotationAxis(const Vector3D &axis, float angle)
任意軸反時計回転行列
virtual void Seek(int position)=0
RendererMaterialType
material type
Definition: Effekseer.h:562
std::array< TextureWrapType, UserTextureSlotMax > TextureWrapTypes
Definition: Effekseer.h:584
Parameters about a depth which is passed into a renderer.
Definition: Effekseer.h:625
virtual Effect * GetEffect() const =0
ノードが所属しているエフェクトを取得する。
GLhandleARB obj
ShadingModelType
Definition: Effekseer.h:553
virtual bool GetIsResourcesLoadedAutomatically() const
virtual void SetMallocFunc(MallocFunc func)=0
void Indentity()
単位行列化を行う。
TextureLoader()
コンストラクタ
Definition: Effekseer.h:3018
virtual void DrawBack(const Manager::DrawParameter &drawParameter=Manager::DrawParameter())=0
Draw particles in the back of priority 0.
virtual void OnUnloadingResource(Effect *effect)
this method is called when unload resources
std::map< T, U, std::less< T >, CustomAllocator< std::pair< const T, U > >> CustomMap
Definition: Effekseer.h:796
virtual void Update(Manager **managers=nullptr, int32_t managerCount=0, ReloadingThreadType reloadingThreadType=ReloadingThreadType::Main)=0
update a server and reload effects all managers which is playing effects. the number of manager
virtual TextureData * Load(const EFK_CHAR *path, TextureType textureType)
テクスチャを読み込む。
Definition: Effekseer.h:3034
virtual int Release()=0
参照カウンタを減算する。0になった時、インスタンスを削除する。
void(EFK_STDCALL * AlignedFreeFunc)(void *p, unsigned int size)
AlignedMemory Free function.
Definition: Effekseer.h:109
int32_t GetModelCount()
Definition: Effekseer.h:3388
virtual ~Client()
Definition: Effekseer.h:4025
int32_t TermMin
Minimum end time that the effect may exist.
Definition: Effekseer.h:1616
virtual void SetPaused(Handle handle, bool paused)=0
Pause or resume a particle of effect specified.
ReloadingThreadType
A thread where reload function is called.
Definition: Effekseer.h:253
void ClearEffectFactory()
clear effect factories
virtual void SetTextureLoader(TextureLoader *textureLoader)=0
テクスチャ読込クラスを設定する。
Emitter GetEmitterFromFace(int32_t index, int32_t time, CoordinateSystem coordinate, float magnification)
Definition: Effekseer.h:3529
参照カウンタオブジェクト
Definition: Effekseer.h:473
const GLubyte * c
virtual const EFK_CHAR * GetNormalImagePath(int n) const =0
Get a normal image's path.
const int32_t UserTextureSlotMax
the maximum number of texture slot which can be specified by an user
Definition: Effekseer.h:132
FileReader * OpenRead(const EFK_CHAR *path)
virtual void Draw(const Manager::DrawParameter &drawParameter=Manager::DrawParameter())=0
Draw particles.
Handle handle
Definition: Effekseer.h:122
GLboolean GLboolean g
CustomAllocator(const CustomAllocator< U > &)
Definition: Effekseer.h:770
GLuint in
GLfloat GLfloat v1
int32_t CameraCullingMask
A bitmask to show effects For example, if effect's layer is 1 and CameraCullingMask's first bit is 1,...
Definition: Effekseer.h:2276
void Scaling(float x, float y, float z)
拡大行列化
GLenum src
uint8_t B
Definition: Effekseer.h:1017
std::list< T, CustomAllocator< T > > CustomList
Definition: Effekseer.h:794
void *(EFK_STDCALL * MallocFunc)(unsigned int size)
Memory Allocation function.
Definition: Effekseer.h:94
GLdouble GLdouble z
int32_t GetFrameCount() const
Definition: Effekseer.h:3386
uint8_t G
Definition: Effekseer.h:1012
virtual void * GetWave(int n) const =0
格納されている音波形のポインタを取得する。
virtual const EFK_CHAR * GetModelPath(int n) const =0
Get a model's path.
virtual size_t Write(const void *buffer, size_t size)=0
GLint GLint GLsizei GLsizei height
Definition: SDL_opengl.h:1572
virtual RingRenderer * GetRingRenderer()=0
リング描画機能を取得する。
virtual bool Start(uint16_t port)=0
start a server
virtual void Unload(void *data)
モデルを破棄する。
Definition: Effekseer.h:3137
FileWriter * OpenWrite(const EFK_CHAR *path)
MaterialParameter * MaterialParameterPtr
Definition: Effekseer.h:648
MallocFunc GetMallocFunc()
get an allocator
void AddEffectFactory(EffectFactory *effectFactory)
Add effect factory.
virtual void Unregist(Effect *effect)=0
deprecated
virtual TextureData * GetColorImage(int n) const =0
格納されている色画像のポインタを取得する。
virtual void Flip()=0
今までのPlay等の処理をUpdate実行時に適用するようにする。
virtual ~MaterialLoader()=default
Destructor.
signed long long int64_t
bool LoadBody(Effect *effect, const void *data, int32_t size, float magnification, const EFK_CHAR *materialPath)
load body data(parameters of effect) from a binary
unsigned int size_t
static const int32_t Version
Definition: Effekseer.h:3247
Matrix44 & PerspectiveFovRH(float ovY, float aspect, float zn, float zf)
射影行列化(右手系)