2 #ifndef __EFFEKSEER_BASE_PRE_H__ 3 #define __EFFEKSEER_BASE_PRE_H__ 17 #define EFK_STDCALL __stdcall 28 #elif defined(_PSVITA) 29 #include "Effekseer.PSVita.h" 31 #include "Effekseer.PS4.h" 32 #elif defined(_SWITCH) 33 #include "Effekseer.Switch.h" 34 #elif defined(_XBOXONE) 35 #include "Effekseer.XBoxOne.h" 45 typedef uint16_t EFK_CHAR;
65 class ParticleRenderer;
88 typedef void* ( EFK_STDCALL *MallocFunc ) (
unsigned int size );
93 typedef void ( EFK_STDCALL *FreeFunc ) (
void* p,
unsigned int size );
98 typedef int ( EFK_STDCALL *RandFunc ) (void);
106 typedef void ( EFK_STDCALL *EffectInstanceRemovingCallback ) ( Manager* manager, Handle handle,
bool isRemovingManager );
108 #define ES_SAFE_ADDREF(val) if ( (val) != NULL ) { (val)->AddRef(); } 109 #define ES_SAFE_RELEASE(val) if ( (val) != NULL ) { (val)->Release(); (val) = NULL; } 110 #define ES_SAFE_DELETE(val) if ( (val) != NULL ) { delete (val); (val) = NULL; } 111 #define ES_SAFE_DELETE_ARRAY(val) if ( (val) != NULL ) { delete [] (val); (val) = NULL; } 119 enum class AlphaBlendType : int32_t
143 enum class TextureFilterType : int32_t
149 enum class TextureWrapType : int32_t
155 enum class CullingType : int32_t
165 enum class BillboardType : int32_t
170 RotatedBillboard = 3,
173 enum class CoordinateSystem : int32_t
179 enum class CullingShape : int32_t
185 enum class TextureType : int32_t
192 enum class TextureFormatType : int32_t
206 template <
typename T,
typename U>
219 template <
typename T,
typename U>
232 template <
typename T,
typename U,
typename V>
233 T Clamp( T t, U max_, V min_ )
251 inline float NormalizeAngle(
float angle)
253 int32_t ofs = (*(int32_t*)&angle & 0x80000000) | 0x3F000000;
254 return (angle - ((
int)(angle * 0.159154943f + *(
float*)&ofs) * 6.283185307f));
260 inline void SinCos(
float x,
float& s,
float& c)
262 x = NormalizeAngle(x);
264 float x4 = x * x * x * x;
265 float x6 = x * x * x * x * x * x;
266 float x8 = x * x * x * x * x * x * x * x;
267 float x10 = x * x * x * x * x * x * x * x * x * x;
268 s = x * (1.0f - x2 / 6.0f + x4 / 120.0f - x6 / 5040.0f + x8 / 362880.0f - x10 / 39916800.0f);
269 c = 1.0f - x2 / 2.0f + x4 / 24.0f - x6 / 720.0f + x8 / 40320.0f - x10 / 3628800.0f;
282 inline int32_t ConvertUtf16ToUtf8( int8_t* dst, int32_t dst_size,
const int16_t* src )
285 const int16_t* wp = src;
288 if (dst_size == 0)
return 0;
292 for (cnt = 0; cnt < dst_size; )
299 if ((wc & ~0x7f) == 0)
303 }
else if ((wc & ~0x7ff) == 0)
305 *cp++ = ((wc >> 6) & 0x1f) | 0xc0;
306 *cp++ = ((wc) & 0x3f) | 0x80;
309 *cp++ = ((wc >> 12) & 0xf) | 0xe0;
310 *cp++ = ((wc >> 6) & 0x3f) | 0x80;
311 *cp++ = ((wc) & 0x3f) | 0x80;
326 inline int32_t ConvertUtf8ToUtf16( int16_t* dst, int32_t dst_size,
const int8_t* src )
331 if (dst_size == 0)
return 0;
335 for (i = 0; i < dst_size; i++)
345 code = (uint8_t)c0 >> 4;
351 else if (code >= 12 && code <= 13)
355 wc = ((c0 & 0x1F) << 6) | (c1 & 0x3F);
362 wc = ((c0 & 0x0F) << 12) | ((c1 & 0x3F) << 6) | (c2 & 0x3F);
388 virtual int AddRef() = 0;
394 virtual int GetRef() = 0;
400 virtual int Release() = 0;
413 mutable std::atomic<int32_t> m_reference;
426 std::atomic_fetch_add_explicit(&m_reference, 1, std::memory_order_consume);
438 bool destroy = std::atomic_fetch_sub_explicit(&m_reference, 1, std::memory_order_consume) == 1;
459 TextureFormatType TextureFormat;
471 #endif // __EFFEKSEER_BASE_PRE_H__ 472 #ifndef __EFFEKSEER_VECTOR2D_H__ 473 #define __EFFEKSEER_VECTOR2D_H__ 522 #endif // __EFFEKSEER_VECTOR3D_H__ 524 #ifndef __EFFEKSEER_VECTOR3D_H__ 525 #define __EFFEKSEER_VECTOR3D_H__ 567 Vector3D(
float x,
float y,
float z );
573 Vector3D operator * (
const float& o )
const;
575 Vector3D operator / (
const float& o )
const;
581 Vector3D& operator *= (
const float& o );
583 Vector3D& operator /= (
const float& o );
598 static float Length(
const Vector3D& in );
603 static float LengthSq(
const Vector3D& in );
635 #endif // __EFFEKSEER_VECTOR3D_H__ 637 #ifndef __EFFEKSEER_COLOR_H__ 638 #define __EFFEKSEER_COLOR_H__ 656 COLOR_MODE_DWORD = 0x7FFFFFFF
693 Color( uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255 );
708 #endif // __EFFEKSEER_COLOR_H__ 710 #ifndef __EFFEKSEER_RECTF_H__ 711 #define __EFFEKSEER_RECTF_H__ 742 RectF(
float x,
float y,
float width,
float height );
756 #endif // __EFFEKSEER_RECTF_H__ 758 #ifndef __EFFEKSEER_MATRIX43_H__ 759 #define __EFFEKSEER_MATRIX43_H__ 805 void Scaling(
float x,
float y,
float z );
811 void RotationX(
float angle );
817 void RotationY(
float angle );
823 void RotationZ(
float angle );
831 void RotationXYZ(
float rx,
float ry,
float rz );
839 void RotationZXY(
float rz,
float rx,
float ry );
846 void RotationAxis(
const Vector3D& axis,
float angle );
854 void RotationAxis(
const Vector3D& axis,
float s,
float c );
862 void Translation(
float x,
float y,
float z );
882 void GetRotation(
Matrix43& r )
const;
888 void GetTranslation(
Vector3D& t )
const;
915 #endif // __EFFEKSEER_MATRIX43_H__ 917 #ifndef __EFFEKSEER_MATRIX44_H__ 918 #define __EFFEKSEER_MATRIX44_H__ 983 Matrix44& PerspectiveFovRH(
float ovY,
float aspect,
float zn,
float zf );
988 Matrix44& PerspectiveFovRH_OpenGL(
float ovY,
float aspect,
float zn,
float zf );
993 Matrix44& PerspectiveFovLH(
float ovY,
float aspect,
float zn,
float zf );
998 Matrix44& PerspectiveFovLH_OpenGL(
float ovY,
float aspect,
float zn,
float zf );
1003 Matrix44& OrthographicRH(
float width,
float height,
float zn,
float zf );
1008 Matrix44& OrthographicLH(
float width,
float height,
float zn,
float zf );
1013 void Scaling(
float x,
float y,
float z );
1018 void RotationX(
float angle );
1023 void RotationY(
float angle );
1028 void RotationZ(
float angle );
1033 void Translation(
float x,
float y,
float z );
1038 void RotationAxis(
const Vector3D& axis,
float angle );
1043 void Quaternion(
float x,
float y,
float z,
float w );
1064 #endif // __EFFEKSEER_MATRIX44_H__ 1066 #ifndef __EFFEKSEER_FILE_H__ 1067 #define __EFFEKSEER_FILE_H__ 1092 virtual size_t Read(
void* buffer,
size_t size ) = 0;
1094 virtual void Seek(
int position) = 0;
1096 virtual int GetPosition() = 0;
1098 virtual size_t GetLength() = 0;
1113 virtual size_t Write(
const void* buffer,
size_t size ) = 0;
1115 virtual void Flush() = 0;
1117 virtual void Seek(
int position) = 0;
1119 virtual int GetPosition() = 0;
1121 virtual size_t GetLength() = 0;
1132 virtual FileReader* OpenRead(
const EFK_CHAR* path ) = 0;
1134 virtual FileWriter* OpenWrite(
const EFK_CHAR* path ) = 0;
1144 #endif // __EFFEKSEER_FILE_H__ 1146 #ifndef __EFFEKSEER_DEFAULT_FILE_H__ 1147 #define __EFFEKSEER_DEFAULT_FILE_H__ 1174 size_t Read(
void* buffer,
size_t size );
1176 void Seek(
int position );
1193 size_t Write(
const void* buffer,
size_t size );
1197 void Seek(
int position );
1209 FileReader* OpenRead(
const EFK_CHAR* path );
1211 FileWriter* OpenWrite(
const EFK_CHAR* path );
1222 #endif // __EFFEKSEER_DEFAULT_FILE_H__ 1224 #ifndef __EFFEKSEER_EFFECT_H__ 1225 #define __EFFEKSEER_EFFECT_H__ 1263 static Effect* Create(
Manager* manager,
void* data, int32_t size,
float magnification = 1.0f,
const EFK_CHAR* materialPath = NULL );
1273 static Effect* Create(
Manager* manager,
const EFK_CHAR* path,
float magnification = 1.0f,
const EFK_CHAR* materialPath = NULL );
1284 static Effect* Create(
Setting* setting,
void* data, int32_t size,
float magnification = 1.0f,
const EFK_CHAR* materialPath = NULL );
1294 static Effect* Create(
Setting* setting,
const EFK_CHAR* path,
float magnification = 1.0f,
const EFK_CHAR* materialPath = NULL );
1305 virtual Setting* GetSetting()
const = 0;
1311 virtual float GetMaginification()
const = 0;
1316 virtual int GetVersion()
const = 0;
1323 virtual TextureData* GetColorImage(
int n )
const = 0;
1328 virtual int32_t GetColorImageCount()
const = 0;
1335 virtual TextureData* GetNormalImage(
int n)
const = 0;
1340 virtual int32_t GetNormalImageCount()
const = 0;
1347 virtual TextureData* GetDistortionImage(
int n)
const = 0;
1352 virtual int32_t GetDistortionImageCount()
const = 0;
1357 virtual void* GetWave(
int n )
const = 0;
1362 virtual int32_t GetWaveCount()
const = 0;
1367 virtual void* GetModel(
int n )
const = 0;
1372 virtual int32_t GetModelCount()
const = 0;
1377 virtual bool Reload(
void* data, int32_t size,
const EFK_CHAR* materialPath = NULL ) = 0;
1382 virtual bool Reload(
const EFK_CHAR* path,
const EFK_CHAR* materialPath = NULL ) = 0;
1395 virtual bool Reload(
Manager* managers, int32_t managersCount,
void* data, int32_t size,
const EFK_CHAR* materialPath = NULL ) = 0;
1407 virtual bool Reload(
Manager* managers, int32_t managersCount,
const EFK_CHAR* path,
const EFK_CHAR* materialPath = NULL ) = 0;
1412 virtual void ReloadResources(
const EFK_CHAR* materialPath = NULL ) = 0;
1417 virtual void UnloadResources() = 0;
1432 int32_t ColorTextureIndex;
1433 AlphaBlendType AlphaBlend;
1434 TextureFilterType FilterType;
1435 TextureWrapType WrapType;
1439 float DistortionIntensity;
1470 virtual Effect* GetEffect()
const = 0;
1475 virtual int GetChildrenCount()
const = 0;
1480 virtual EffectNode* GetChild(
int index)
const = 0;
1507 #endif // __EFFEKSEER_EFFECT_H__ 1509 #ifndef __EFFEKSEER_MANAGER_H__ 1510 #define __EFFEKSEER_MANAGER_H__ 1542 static Manager* Create(
int instance_max,
bool autoFlip =
true );
1549 virtual void Destroy() = 0;
1554 virtual MallocFunc GetMallocFunc()
const = 0;
1559 virtual void SetMallocFunc( MallocFunc func ) = 0;
1564 virtual FreeFunc GetFreeFunc()
const = 0;
1569 virtual void SetFreeFunc( FreeFunc func ) = 0;
1574 virtual RandFunc GetRandFunc()
const = 0;
1579 virtual void SetRandFunc( RandFunc func ) = 0;
1584 virtual int GetRandMax()
const = 0;
1589 virtual void SetRandMax(
int max_ ) = 0;
1595 virtual CoordinateSystem GetCoordinateSystem()
const = 0;
1604 virtual void SetCoordinateSystem( CoordinateSystem coordinateSystem ) = 0;
1634 virtual void SetRingRenderer(
RingRenderer* renderer ) = 0;
1644 virtual void SetModelRenderer(
ModelRenderer* renderer ) = 0;
1654 virtual void SetTrackRenderer(
TrackRenderer* renderer ) = 0;
1659 virtual Setting* GetSetting() = 0;
1665 virtual void SetSetting(
Setting* setting) = 0;
1675 virtual void SetEffectLoader(
EffectLoader* effectLoader ) = 0;
1685 virtual void SetTextureLoader(
TextureLoader* textureLoader ) = 0;
1695 virtual void SetSoundPlayer(
SoundPlayer* soundPlayer ) = 0;
1705 virtual void SetSoundLoader(
SoundLoader* soundLoader ) = 0;
1715 virtual void SetModelLoader(
ModelLoader* modelLoader ) = 0;
1721 virtual void StopEffect( Handle handle ) = 0;
1726 virtual void StopAllEffects() = 0;
1732 virtual void StopRoot( Handle handle ) = 0;
1738 virtual void StopRoot(
Effect* effect ) = 0;
1745 virtual bool Exists( Handle handle ) = 0;
1756 virtual int32_t GetInstanceCount( Handle handle ) = 0;
1763 virtual Matrix43 GetMatrix( Handle handle ) = 0;
1770 virtual void SetMatrix( Handle handle,
const Matrix43& mat ) = 0;
1777 virtual Vector3D GetLocation( Handle handle ) = 0;
1785 virtual void SetLocation( Handle handle,
float x,
float y,
float z ) = 0;
1791 virtual void SetLocation( Handle handle,
const Vector3D& location ) = 0;
1797 virtual void AddLocation( Handle handle,
const Vector3D& location ) = 0;
1802 virtual void SetRotation( Handle handle,
float x,
float y,
float z ) = 0;
1810 virtual void SetRotation( Handle handle,
const Vector3D& axis,
float angle ) = 0;
1819 virtual void SetScale( Handle handle,
float x,
float y,
float z ) = 0;
1827 virtual void SetTargetLocation( Handle handle,
float x,
float y,
float z ) = 0;
1833 virtual void SetTargetLocation( Handle handle,
const Vector3D& location ) = 0;
1840 virtual Matrix43 GetBaseMatrix( Handle handle ) = 0;
1849 virtual void SetBaseMatrix( Handle handle,
const Matrix43& mat ) = 0;
1856 virtual void SetRemovingCallback( Handle handle, EffectInstanceRemovingCallback callback ) = 0;
1865 virtual bool GetShown(Handle handle) = 0;
1872 virtual void SetShown( Handle handle,
bool shown ) = 0;
1881 virtual bool GetPaused(Handle handle) = 0;
1890 virtual void SetPaused( Handle handle,
bool paused ) = 0;
1898 virtual void SetPausedToAllEffects(
bool paused) = 0;
1905 virtual void SetSpeed( Handle handle,
float speed ) = 0;
1912 virtual void SetAutoDrawing( Handle handle,
bool autoDraw ) = 0;
1917 virtual void Flip() = 0;
1923 virtual void Update(
float deltaFrame = 1.0f ) = 0;
1930 virtual void BeginUpdate() = 0;
1937 virtual void EndUpdate() = 0;
1946 virtual void UpdateHandle( Handle handle,
float deltaFrame = 1.0f ) = 0;
1951 virtual void Draw() = 0;
1956 virtual void DrawHandle( Handle handle ) = 0;
1966 virtual Handle Play(
Effect* effect,
float x,
float y,
float z ) = 0;
1971 virtual int GetUpdateTime()
const = 0;
1976 virtual int GetDrawTime()
const = 0;
1981 virtual int32_t GetRestInstancesCount()
const = 0;
1990 virtual void CreateCullingWorld(
float xsize,
float ysize,
float zsize, int32_t layerCount) = 0;
1997 virtual void CalcCulling(
const Matrix44& cameraProjMat,
bool isOpenGL) = 0;
2002 virtual void RessignCulling() = 0;
2011 #endif // __EFFEKSEER_MANAGER_H__ 2013 #ifndef __EFFEKSEER_SPRITE_RENDERER_H__ 2014 #define __EFFEKSEER_SPRITE_RENDERER_H__ 2036 int32_t ColorTextureIndex;
2037 AlphaBlendType AlphaBlend;
2038 TextureFilterType TextureFilter;
2039 TextureWrapType TextureWrap;
2042 BillboardType Billboard;
2045 float DistortionIntensity;
2066 virtual void BeginRendering(
const NodeParameter& parameter, int32_t count,
void* userData ) {}
2070 virtual void EndRendering(
const NodeParameter& parameter,
void* userData ) {}
2080 #endif // __EFFEKSEER_SPRITE_RENDERER_H__ 2082 #ifndef __EFFEKSEER_RIBBON_RENDERER_H__ 2083 #define __EFFEKSEER_RIBBON_RENDERER_H__ 2105 int32_t ColorTextureIndex;
2106 AlphaBlendType AlphaBlend;
2107 TextureFilterType TextureFilter;
2108 TextureWrapType TextureWrap;
2111 bool ViewpointDependent;
2114 float DistortionIntensity;
2119 int32_t InstanceCount;
2120 int32_t InstanceIndex;
2137 virtual void BeginRendering(
const NodeParameter& parameter, int32_t count,
void* userData ) {}
2141 virtual void EndRendering(
const NodeParameter& parameter,
void* userData ) {}
2151 #endif // __EFFEKSEER_RIBBON_RENDERER_H__ 2153 #ifndef __EFFEKSEER_RING_RENDERER_H__ 2154 #define __EFFEKSEER_RING_RENDERER_H__ 2176 int32_t ColorTextureIndex;
2177 AlphaBlendType AlphaBlend;
2178 TextureFilterType TextureFilter;
2179 TextureWrapType TextureWrap;
2182 BillboardType Billboard;
2183 int32_t VertexCount;
2186 float DistortionIntensity;
2208 virtual void BeginRendering(
const NodeParameter& parameter, int32_t count,
void* userData ) {}
2212 virtual void EndRendering(
const NodeParameter& parameter,
void* userData ) {}
2222 #endif // __EFFEKSEER_RING_RENDERER_H__ 2224 #ifndef __EFFEKSEER_MODEL_RENDERER_H__ 2225 #define __EFFEKSEER_MODEL_RENDERER_H__ 2247 AlphaBlendType AlphaBlend;
2248 TextureFilterType TextureFilter;
2249 TextureWrapType TextureWrap;
2253 CullingType Culling;
2255 int32_t ColorTextureIndex;
2256 int32_t NormalTextureIndex;
2257 float Magnification;
2261 float DistortionIntensity;
2276 virtual void BeginRendering(
const NodeParameter& parameter, int32_t count,
void* userData ) {}
2280 virtual void EndRendering(
const NodeParameter& parameter,
void* userData ) {}
2290 #endif // __EFFEKSEER_MODEL_RENDERER_H__ 2292 #ifndef __EFFEKSEER_TRACK_RENDERER_H__ 2293 #define __EFFEKSEER_TRACK_RENDERER_H__ 2315 int32_t ColorTextureIndex;
2316 AlphaBlendType AlphaBlend;
2317 TextureFilterType TextureFilter;
2318 TextureWrapType TextureWrap;
2323 float DistortionIntensity;
2333 int32_t InstanceCount;
2334 int32_t InstanceIndex;
2341 Color ColorLeftMiddle;
2342 Color ColorCenterMiddle;
2343 Color ColorRightMiddle;
2357 virtual void BeginRendering(
const NodeParameter& parameter, int32_t count,
void* userData ) {}
2361 virtual void EndRendering(
const NodeParameter& parameter,
void* userData ) {}
2371 #endif // __EFFEKSEER_TRACK_RENDERER_H__ 2373 #ifndef __EFFEKSEER_EFFECTLOADER_H__ 2374 #define __EFFEKSEER_EFFECTLOADER_H__ 2413 virtual bool Load(
const EFK_CHAR* path,
void*& data, int32_t& size ) = 0;
2423 virtual void Unload(
void* data, int32_t size ) = 0;
2433 #endif // __EFFEKSEER_EFFECTLOADER_H__ 2435 #ifndef __EFFEKSEER_TEXTURELOADER_H__ 2436 #define __EFFEKSEER_TEXTURELOADER_H__ 2474 virtual TextureData*
Load(
const EFK_CHAR* path, TextureType textureType ) {
return nullptr; }
2493 #endif // __EFFEKSEER_TEXTURELOADER_H__ 2495 #ifndef __EFFEKSEER_MODELLOADER_H__ 2496 #define __EFFEKSEER_MODELLOADER_H__ 2533 virtual void*
Load(
const EFK_CHAR* path ) {
return NULL; }
2552 #endif // __EFFEKSEER_MODELLOADER_H__ 2554 #ifndef __EFFEKSEER_MODEL_H__ 2555 #define __EFFEKSEER_MODEL_H__ 2576 static const int32_t Version = 1;
2618 int32_t m_vertexCount;
2621 int32_t m_faceCount;
2624 int32_t m_modelCount;
2637 , m_vertexCount ( 0 )
2638 , m_vertexes ( NULL )
2642 m_data =
new uint8_t[m_size];
2643 memcpy( m_data, data, m_size );
2645 uint8_t* p = (uint8_t*)m_data;
2647 memcpy( &m_version, p,
sizeof(int32_t) );
2648 p +=
sizeof(int32_t);
2654 p +=
sizeof(int32_t);
2657 memcpy( &m_modelCount, p,
sizeof(int32_t) );
2658 p +=
sizeof(int32_t);
2660 memcpy( &m_vertexCount, p,
sizeof(int32_t) );
2661 p +=
sizeof(int32_t);
2665 m_vertexes = (
Vertex*) p;
2666 p += (
sizeof(
Vertex) * m_vertexCount);
2671 m_vertexes =
new Vertex[m_vertexCount];
2673 for (int32_t i = 0; i < m_vertexCount; i++)
2675 memcpy(&m_vertexes[i], p,
sizeof(
Vertex) -
sizeof(
Color));
2676 m_vertexes[i].VColor =
Color(255, 255, 255, 255);
2682 memcpy( &m_faceCount, p,
sizeof(int32_t) );
2683 p +=
sizeof(int32_t);
2686 p += (
sizeof(
Face) * m_faceCount );
2689 Vertex* GetVertexes()
const {
return m_vertexes; }
2690 int32_t GetVertexCount() {
return m_vertexCount; }
2692 Face* GetFaces()
const {
return m_faces; }
2693 int32_t GetFaceCount() {
return m_faceCount; }
2695 int32_t GetModelCount() {
return m_modelCount; }
2706 ES_SAFE_DELETE_ARRAY(m_vertexes);
2709 ES_SAFE_DELETE_ARRAY( m_data );
2712 Emitter GetEmitter(
Manager* manager, CoordinateSystem coordinate,
float magnification )
2717 int32_t faceInd = (int32_t)( (GetFaceCount() - 1) * ( (float)randFunc() / (float)randMax ) );
2718 faceInd = Clamp( faceInd, GetFaceCount() - 1, 0 );
2719 Face& face = GetFaces()[faceInd];
2720 Vertex& v0 = GetVertexes()[face.Indexes[0]];
2721 Vertex& v1 = GetVertexes()[face.Indexes[1]];
2722 Vertex& v2 = GetVertexes()[face.Indexes[2]];
2724 float p1 = ( (float)randFunc() / (float)randMax );
2725 float p2 = ( (float)randFunc() / (float)randMax );
2728 if( p1 + p2 > 1.0f )
2734 float p0 = 1.0f - p1 - p2;
2737 emitter.Position = (v0.Position * p0 + v1.Position * p1 + v2.Position * p2) * magnification;
2738 emitter.Normal = v0.Normal * p0 + v1.Normal * p1 + v2.Normal * p2;
2739 emitter.Binormal = v0.Binormal * p0 + v1.Binormal * p1 + v2.Binormal * p2;
2740 emitter.Tangent = v0.Tangent * p0 + v1.Tangent * p1 + v2.Tangent * p2;
2742 if( coordinate == CoordinateSystem::LH )
2744 emitter.Position.
Z = - emitter.Position.
Z;
2745 emitter.Normal.
Z = - emitter.Normal.
Z;
2746 emitter.Binormal.
Z = - emitter.Binormal.
Z;
2747 emitter.Tangent.
Z = - emitter.Tangent.
Z;
2753 Emitter GetEmitterFromVertex(
Manager* manager, CoordinateSystem coordinate,
float magnification )
2758 int32_t vertexInd = (int32_t)( (GetVertexCount() - 1) * ( (float)randFunc() / (float)randMax ) );
2759 vertexInd = Clamp( vertexInd, GetVertexCount() - 1, 0 );
2760 Vertex& v = GetVertexes()[vertexInd];
2763 emitter.Position = v.Position * magnification;
2764 emitter.Normal = v.Normal;
2765 emitter.Binormal = v.Binormal;
2766 emitter.Tangent = v.Tangent;
2768 if( coordinate == CoordinateSystem::LH )
2770 emitter.Position.
Z = - emitter.Position.
Z;
2771 emitter.Normal.
Z = - emitter.Normal.
Z;
2772 emitter.Binormal.
Z = - emitter.Binormal.
Z;
2773 emitter.Tangent.
Z = - emitter.Tangent.
Z;
2779 Emitter GetEmitterFromVertex( int32_t index, CoordinateSystem coordinate,
float magnification )
2781 int32_t vertexInd = index % GetVertexCount();
2782 Vertex& v = GetVertexes()[vertexInd];
2785 emitter.Position = v.Position * magnification;
2786 emitter.Normal = v.Normal;
2787 emitter.Binormal = v.Binormal;
2788 emitter.Tangent = v.Tangent;
2790 if( coordinate == CoordinateSystem::LH )
2792 emitter.Position.
Z = - emitter.Position.
Z;
2793 emitter.Normal.
Z = - emitter.Normal.
Z;
2794 emitter.Binormal.
Z = - emitter.Binormal.
Z;
2795 emitter.Tangent.
Z = - emitter.Tangent.
Z;
2801 Emitter GetEmitterFromFace(
Manager* manager, CoordinateSystem coordinate,
float magnification )
2806 int32_t faceInd = (int32_t)( (GetFaceCount() - 1) * ( (float)randFunc() / (float)randMax ) );
2807 faceInd = Clamp( faceInd, GetFaceCount() - 1, 0 );
2808 Face& face = GetFaces()[faceInd];
2809 Vertex& v0 = GetVertexes()[face.Indexes[0]];
2810 Vertex& v1 = GetVertexes()[face.Indexes[1]];
2811 Vertex& v2 = GetVertexes()[face.Indexes[2]];
2813 float p0 = 1.0f / 3.0f;
2814 float p1 = 1.0f / 3.0f;
2815 float p2 = 1.0f / 3.0f;
2818 emitter.Position = (v0.Position * p0 + v1.Position * p1 + v2.Position * p2) * magnification;
2819 emitter.Normal = v0.Normal * p0 + v1.Normal * p1 + v2.Normal * p2;
2820 emitter.Binormal = v0.Binormal * p0 + v1.Binormal * p1 + v2.Binormal * p2;
2821 emitter.Tangent = v0.Tangent * p0 + v1.Tangent * p1 + v2.Tangent * p2;
2823 if( coordinate == CoordinateSystem::LH )
2825 emitter.Position.
Z = - emitter.Position.
Z;
2826 emitter.Normal.
Z = - emitter.Normal.
Z;
2827 emitter.Binormal.
Z = - emitter.Binormal.
Z;
2828 emitter.Tangent.
Z = - emitter.Tangent.
Z;
2834 Emitter GetEmitterFromFace( int32_t index, CoordinateSystem coordinate,
float magnification )
2836 int32_t faceInd = index % (GetFaceCount() - 1);
2837 Face& face = GetFaces()[faceInd];
2838 Vertex& v0 = GetVertexes()[face.Indexes[0]];
2839 Vertex& v1 = GetVertexes()[face.Indexes[1]];
2840 Vertex& v2 = GetVertexes()[face.Indexes[2]];
2842 float p0 = 1.0f / 3.0f;
2843 float p1 = 1.0f / 3.0f;
2844 float p2 = 1.0f / 3.0f;
2847 emitter.Position = (v0.Position * p0 + v1.Position * p1 + v2.Position * p2) * magnification;
2848 emitter.Normal = v0.Normal * p0 + v1.Normal * p1 + v2.Normal * p2;
2849 emitter.Binormal = v0.Binormal * p0 + v1.Binormal * p1 + v2.Binormal * p2;
2850 emitter.Tangent = v0.Tangent * p0 + v1.Tangent * p1 + v2.Tangent * p2;
2852 if( coordinate == CoordinateSystem::LH )
2854 emitter.Position.
Z = - emitter.Position.
Z;
2855 emitter.Normal.
Z = - emitter.Normal.
Z;
2856 emitter.Binormal.
Z = - emitter.Binormal.
Z;
2857 emitter.Tangent.
Z = - emitter.Tangent.
Z;
2871 #endif // __EFFEKSEER_MODEL_H__ 2873 #ifndef __EFFEKSEER_SOUND_PLAYER_H__ 2874 #define __EFFEKSEER_SOUND_PLAYER_H__ 2889 typedef void* SoundHandle;
2890 typedef void* SoundTag;
2911 virtual SoundHandle Play( SoundTag tag,
const InstanceParameter& parameter ) = 0;
2913 virtual void Stop( SoundHandle handle, SoundTag tag ) = 0;
2915 virtual void Pause( SoundHandle handle, SoundTag tag,
bool pause ) = 0;
2917 virtual bool CheckPlaying( SoundHandle handle, SoundTag tag ) = 0;
2919 virtual void StopTag( SoundTag tag ) = 0;
2921 virtual void PauseTag( SoundTag tag,
bool pause ) = 0;
2923 virtual bool CheckPlayingTag( SoundTag tag ) = 0;
2925 virtual void StopAll() = 0;
2935 #endif // __EFFEKSEER_SOUND_PLAYER_H__ 2937 #ifndef __EFFEKSEER_SOUNDLOADER_H__ 2938 #define __EFFEKSEER_SOUNDLOADER_H__ 2975 virtual void*
Load(
const EFK_CHAR* path ) {
return NULL; }
2994 #endif // __EFFEKSEER_SOUNDLOADER_H__ 2996 #ifndef __EFFEKSEER_LOADER_H__ 2997 #define __EFFEKSEER_LOADER_H__ 3021 CoordinateSystem m_coordinateSystem;
3049 CoordinateSystem GetCoordinateSystem()
const;
3058 void SetCoordinateSystem(CoordinateSystem coordinateSystem);
3116 #endif // __EFFEKSEER_LOADER_H__ 3118 #ifndef __EFFEKSEER_SERVER_H__ 3119 #define __EFFEKSEER_SERVER_H__ 3121 #if !( defined(_PSVITA) || defined(_PS4) || defined(_SWITCH) || defined(_XBOXONE) ) 3146 virtual bool Start( uint16_t port ) = 0;
3148 virtual void Stop() = 0;
3155 virtual void Regist(
const EFK_CHAR* key,
Effect* effect ) = 0;
3161 virtual void Unregist(
Effect* effect ) = 0;
3166 virtual void Update() = 0;
3171 virtual void SetMaterialPath(
const EFK_CHAR* materialPath ) = 0;
3182 #endif // #if !( defined(_PSVITA) || defined(_PS4) || defined(_SWITCH) || defined(_XBOXONE) ) 3184 #endif // __EFFEKSEER_SERVER_H__ 3186 #ifndef __EFFEKSEER_CLIENT_H__ 3187 #define __EFFEKSEER_CLIENT_H__ 3189 #if !( defined(_PSVITA) || defined(_PS4) || defined(_SWITCH) || defined(_XBOXONE) ) 3210 virtual bool Start(
char* host, uint16_t port ) = 0;
3211 virtual void Stop()= 0;
3213 virtual void Reload(
const EFK_CHAR* key,
void* data, int32_t size ) = 0;
3214 virtual void Reload(
Manager* manager,
const EFK_CHAR* path,
const EFK_CHAR* key ) = 0;
3215 virtual bool IsConnected() = 0;
3226 #endif // #if !( defined(_PSVITA) || defined(_PS4) || defined(_SWITCH) || defined(_XBOXONE) ) 3228 #endif // __EFFEKSEER_CLIENT_H__ 3230 #ifndef __EFFEKSEER_CRITICALSESSION_H__ 3231 #define __EFFEKSEER_CRITICALSESSION_H__ 3252 mutable CRITICAL_SECTION m_criticalSection;
3253 #elif defined(_PSVITA) || defined(_PS4) || defined(_SWITCH) || defined(_XBOXONE) 3254 mutable CONSOLE_GAME_MUTEX m_mutex;
3256 mutable pthread_mutex_t m_mutex;
3277 #endif // __EFFEKSEER_CRITICALSESSION_H__ 3279 #ifndef __EFFEKSEER_THREAD_H__ 3280 #define __EFFEKSEER_THREAD_H__ 3299 static unsigned long EFK_STDCALL ThreadProc(
void* arguments);
3300 #elif defined(_PSVITA) || defined(_PS4) || defined(_SWITCH) || defined(_XBOXONE) 3303 static void* ThreadProc(
void* arguments );
3309 #elif defined(_PSVITA) || defined(_PS4) || defined(_SWITCH) || defined(_XBOXONE) 3317 void (*m_mainProc)(
void* );
3332 bool Create(
void (*threadFunc)(
void* ),
void* data );
3337 bool IsExitThread()
const;
3351 #endif // __EFFEKSEER_VECTOR3D_H__ virtual int Release()
参照カウンタを減算する。0になった時、インスタンスを削除する。
Definition: Effekseer.h:436
virtual int AddRef()
参照カウンタを加算する。
Definition: Effekseer.h:424
エフェクトファイル読み込み破棄関数指定クラス
Definition: Effekseer.h:2390
標準のファイル読み込みクラス
Definition: Effekseer.h:1164
Definition: Effekseer.h:2604
Definition: Effekseer.h:2240
モデルパラメーター
Definition: Effekseer.h:1451
クリティカルセクション
Definition: Effekseer.h:3248
float Z
Z
Definition: Effekseer.h:557
virtual int GetRef()
参照カウンタを取得する。
Definition: Effekseer.h:431
ノードインスタンス生成クラス
Definition: Effekseer.h:1461
Model(void *data, int32_t size)
コンストラクタ
Definition: Effekseer.h:2633
Definition: Effekseer.h:2048
Definition: Effekseer.h:2098
ModelLoader()
コンストラクタ
Definition: Effekseer.h:2518
virtual RandFunc GetRandFunc() const =0
ランダム関数を取得する。
サウンド読み込み破棄関数指定クラス
Definition: Effekseer.h:2954
virtual ~TextureLoader()
デストラクタ
Definition: Effekseer.h:2463
Definition: Effekseer.h:2029
virtual int GetRandMax() const =0
ランダム最大値を取得する。
ファイルアクセス用のファクトリクラス
Definition: Effekseer.h:1127
uint8_t A
透明度
Definition: Effekseer.h:683
Definition: Effekseer.h:2189
エフェクト管理クラス
Definition: Effekseer.h:1528
Definition: Effekseer.h:2244
Definition: Effekseer.h:2578
テクスチャデータ
Definition: Effekseer.h:455
行列
Definition: Effekseer.h:944
Definition: Effekseer.h:1183
SoundLoader()
コンストラクタ
Definition: Effekseer.h:2960
virtual ~EffectLoader()
デストラクタ
Definition: Effekseer.h:2401
Definition: Effekseer.h:2102
Definition: Effekseer.h:50
テクスチャ読み込み破棄関数指定クラス
Definition: Effekseer.h:2452
モデル読み込み破棄関数指定クラス
Definition: Effekseer.h:2512
virtual void Unload(TextureData *data)
テクスチャを破棄する。
Definition: Effekseer.h:2483
float X
X
Definition: Effekseer.h:495
四角形
Definition: Effekseer.h:727
virtual void * Load(const EFK_CHAR *path)
サウンドを読み込む。
Definition: Effekseer.h:2975
エフェクトパラメータークラス
Definition: Effekseer.h:1245
virtual ~Model()
デストラクタ
Definition: Effekseer.h:2702
Definition: Effekseer.h:2169
4x3行列
Definition: Effekseer.h:784
Definition: Effekseer.h:2895
virtual ~SoundLoader()
デストラクタ
Definition: Effekseer.h:2965
ファイル読み込みクラス
Definition: Effekseer.h:1083
virtual void Unload(void *source)
サウンドを破棄する。
Definition: Effekseer.h:2984
Definition: Effekseer.h:1204
3次元ベクトル
Definition: Effekseer.h:541
3次元ベクトル
Definition: Effekseer.h:489
ファイル書き込みクラス
Definition: Effekseer.h:1104
float X
X
Definition: Effekseer.h:547
参照カウンタのインターフェース
Definition: Effekseer.h:381
共通描画パラメーター
Definition: Effekseer.h:1430
Definition: Effekseer.h:2173
virtual void * Load(const EFK_CHAR *path)
モデルを読み込む。
Definition: Effekseer.h:2533
Definition: Effekseer.h:2588
Definition: Effekseer.h:2308
Definition: Effekseer.h:2331
Definition: Effekseer.h:3134
色
Definition: Effekseer.h:663
float Y
Y
Definition: Effekseer.h:500
Definition: Effekseer.h:2312
Definition: Effekseer.h:2264
virtual ~ModelLoader()
デストラクタ
Definition: Effekseer.h:2523
Definition: Effekseer.h:2599
uint8_t R
赤
Definition: Effekseer.h:668
EffectLoader()
コンストラクタ
Definition: Effekseer.h:2396
モデルクラス
Definition: Effekseer.h:2573
Definition: Effekseer.h:2033
Definition: Effekseer.h:2117
Definition: Effekseer.h:3202
Definition: Effekseer.h:3294
設定クラス
Definition: Effekseer.h:3016
Definition: Effekseer.h:2892
TextureLoader()
コンストラクタ
Definition: Effekseer.h:2458
virtual TextureData * Load(const EFK_CHAR *path, TextureType textureType)
テクスチャを読み込む。
Definition: Effekseer.h:2474
float Y
Y
Definition: Effekseer.h:552
参照カウンタオブジェクト
Definition: Effekseer.h:409
uint8_t B
青
Definition: Effekseer.h:678
uint8_t G
緑
Definition: Effekseer.h:673
Definition: Effekseer.h:2326
virtual void Unload(void *data)
モデルを破棄する。
Definition: Effekseer.h:2542