Merge pull request #242 from songchengjiang/particle_merge

update particles
This commit is contained in:
XiaoYang 2015-03-03 11:56:08 +08:00
commit 791224ee09
220 changed files with 15127 additions and 613 deletions

View File

@ -191,6 +191,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\CCPUParticle3DDynamicAttribute.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\CCPUParticle3DDynamicAttributeTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\CCPUParticle3DForceField.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\CCPUParticle3DListener.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\CCPUParticle3DMaterialManager.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\CCPUParticle3DMaterialTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\CCPUParticle3DNoise.cpp" />
@ -262,6 +263,11 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleAffectors\CCPUParticle3DVelocityMatchingAffectorTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleAffectors\CCPUParticle3DVortexAffector.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleAffectors\CCPUParticle3DVortexAffectorTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleBehaviours\CCPUParticle3DBehaviour.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleBehaviours\CCPUParticle3DBehaviourManager.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleBehaviours\CCPUParticle3DBehaviourTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleBehaviours\CCPUParticle3DSlaveBehaviour.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleBehaviours\CCPUParticle3DSlaveBehaviourTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEmitters\CCPUParticle3DBoxEmitter.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEmitters\CCPUParticle3DBoxEmitterTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEmitters\CCPUParticle3DCircleEmitter.cpp" />
@ -282,6 +288,50 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEmitters\CCPUParticle3DSphereSurfaceEmitter.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEmitters\CCPUParticle3DSphereSurfaceEmitterTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEmitters\CCPUParticle3DVertexEmitter.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoAffectorEventHandler.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoAffectorEventHandlerTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoEnableComponentEventHandler.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoEnableComponentEventHandlerTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoExpireEventHandler.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoExpireEventHandlerTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoFreezeEventHandler.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoFreezeEventHandlerTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoPlacementParticleEventHandler.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoPlacementParticleEventHandlerTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoScaleEventHandler.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoScaleEventHandlerTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoStopSystemEventHandler.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoStopSystemEventHandlerTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DEventHandler.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DEventHandlerManager.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DEventHandlerTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DObserver.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DObserverManager.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DObserverTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnClearObserver.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnClearObserverTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnCollisionObserver.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnCollisionObserverTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnCountObserver.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnCountObserverTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnEmissionObserver.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnEmissionObserverTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnEventFlagObserver.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnEventFlagObserverTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnExpireObserver.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnExpireObserverTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnPositionObserver.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnPositionObserverTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnQuotaObserver.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnQuotaObserverTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnRandomObserver.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnRandomObserverTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnTimeObserver.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnTimeObserverTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnVelocityObserver.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnVelocityObserverTranslator.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleRenders\CCPUParticle3DBeamRender.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleRenders\CCPUParticle3DBillboardChain.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleRenders\CCPUParticle3DRender.cpp" />
<ClCompile Include="..\..\extensions\assets-manager\AssetsManager.cpp" />
<ClCompile Include="..\..\extensions\assets-manager\AssetsManagerEx.cpp" />
@ -303,6 +353,8 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClCompile Include="..\..\extensions\GUI\CCScrollView\CCScrollView.cpp" />
<ClCompile Include="..\..\extensions\GUI\CCScrollView\CCTableView.cpp" />
<ClCompile Include="..\..\extensions\GUI\CCScrollView\CCTableViewCell.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleRenders\CCPUParticle3DRibbonTrail.cpp" />
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleRenders\CCPUParticle3DRibbonTrailRender.cpp" />
<ClCompile Include="..\..\extensions\physics-nodes\CCPhysicsDebugNode.cpp" />
<ClCompile Include="..\..\extensions\physics-nodes\CCPhysicsSprite.cpp" />
<ClCompile Include="..\..\external\ConvertUTF\ConvertUTF.c" />
@ -647,6 +699,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\CCPUParticle3DDynamicAttribute.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\CCPUParticle3DDynamicAttributeTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\CCPUParticle3DForceField.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\CCPUParticle3DListener.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\CCPUParticle3DMaterialManager.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\CCPUParticle3DMaterialTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\CCPUParticle3DNoise.h" />
@ -718,6 +771,11 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleAffectors\CCPUParticle3DVelocityMatchingAffectorTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleAffectors\CCPUParticle3DVortexAffector.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleAffectors\CCPUParticle3DVortexAffectorTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleBehaviours\CCPUParticle3DBehaviour.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleBehaviours\CCPUParticle3DBehaviourManager.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleBehaviours\CCPUParticle3DBehaviourTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleBehaviours\CCPUParticle3DSlaveBehaviour.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleBehaviours\CCPUParticle3DSlaveBehaviourTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEmitters\CCPUParticle3DBoxEmitter.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEmitters\CCPUParticle3DBoxEmitterTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEmitters\CCPUParticle3DCircleEmitter.h" />
@ -738,6 +796,50 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEmitters\CCPUParticle3DSphereSurfaceEmitter.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEmitters\CCPUParticle3DSphereSurfaceEmitterTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEmitters\CCPUParticle3DVertexEmitter.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoAffectorEventHandler.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoAffectorEventHandlerTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoEnableComponentEventHandler.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoEnableComponentEventHandlerTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoExpireEventHandler.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoExpireEventHandlerTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoFreezeEventHandler.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoFreezeEventHandlerTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoPlacementParticleEventHandler.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoPlacementParticleEventHandlerTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoScaleEventHandler.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoScaleEventHandlerTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoStopSystemEventHandler.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoStopSystemEventHandlerTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DEventHandler.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DEventHandlerManager.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DEventHandlerTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DObserver.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DObserverManager.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DObserverTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnClearObserver.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnClearObserverTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnCollisionObserver.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnCollisionObserverTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnCountObserver.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnCountObserverTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnEmissionObserver.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnEmissionObserverTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnEventFlagObserver.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnEventFlagObserverTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnExpireObserver.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnExpireObserverTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnPositionObserver.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnPositionObserverTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnQuotaObserver.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnQuotaObserverTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnRandomObserver.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnRandomObserverTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnTimeObserver.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnTimeObserverTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnVelocityObserver.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnVelocityObserverTranslator.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleRenders\CCPUParticle3DBeamRender.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleRenders\CCPUParticle3DBillboardChain.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleRenders\CCPUParticle3DRender.h" />
<ClInclude Include="..\..\extensions\assets-manager\AssetsManager.h" />
<ClInclude Include="..\..\extensions\assets-manager\AssetsManagerEx.h" />
@ -763,6 +865,8 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClInclude Include="..\..\extensions\GUI\CCScrollView\CCScrollView.h" />
<ClInclude Include="..\..\extensions\GUI\CCScrollView\CCTableView.h" />
<ClInclude Include="..\..\extensions\GUI\CCScrollView\CCTableViewCell.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleRenders\CCPUParticle3DRibbonTrail.h" />
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleRenders\CCPUParticle3DRibbonTrailRender.h" />
<ClInclude Include="..\..\extensions\physics-nodes\CCPhysicsDebugNode.h" />
<ClInclude Include="..\..\extensions\physics-nodes\CCPhysicsSprite.h" />
<ClInclude Include="..\..\external\ConvertUTF\ConvertUTF.h" />

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="physics">
@ -259,6 +259,15 @@
<Filter Include="ui\shaders">
<UniqueIdentifier>{e6eaa24a-a21e-4c1d-b6b2-19326d129af2}</UniqueIdentifier>
</Filter>
<Filter Include="extension\Particle3D\ParticleUniverse\ParticleBehaviours">
<UniqueIdentifier>{8424cf9d-4b97-4380-aa84-b513dbbd48bf}</UniqueIdentifier>
</Filter>
<Filter Include="extension\Particle3D\ParticleUniverse\ParticleEventHandlers">
<UniqueIdentifier>{0586959b-c574-4f26-b637-cb1b23d9ad8e}</UniqueIdentifier>
</Filter>
<Filter Include="extension\Particle3D\ParticleUniverse\ParticleObservers">
<UniqueIdentifier>{53934053-8723-4b5c-abd7-809cec0f43e8}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\physics\CCPhysicsBody.cpp">
@ -1615,6 +1624,162 @@
<ClCompile Include="..\3d\CCAABB.cpp">
<Filter>3d</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\CCPUParticle3DListener.cpp">
<Filter>extension\Particle3D\ParticleUniverse</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DObserver.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DObserverManager.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DObserverTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnClearObserver.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnClearObserverTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnCollisionObserver.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnCollisionObserverTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnCountObserver.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnCountObserverTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnEmissionObserver.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnEmissionObserverTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnEventFlagObserver.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnEventFlagObserverTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnExpireObserver.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnExpireObserverTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnPositionObserver.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnPositionObserverTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnQuotaObserver.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnQuotaObserverTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnRandomObserver.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnRandomObserverTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnTimeObserver.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnTimeObserverTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnVelocityObserver.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnVelocityObserverTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoAffectorEventHandler.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoAffectorEventHandlerTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoEnableComponentEventHandler.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoEnableComponentEventHandlerTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoExpireEventHandler.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoExpireEventHandlerTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoFreezeEventHandler.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoFreezeEventHandlerTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoPlacementParticleEventHandler.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoPlacementParticleEventHandlerTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoScaleEventHandler.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoScaleEventHandlerTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoStopSystemEventHandler.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoStopSystemEventHandlerTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DEventHandler.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DEventHandlerManager.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DEventHandlerTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleBehaviours\CCPUParticle3DBehaviour.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleBehaviours</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleBehaviours\CCPUParticle3DBehaviourManager.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleBehaviours</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleBehaviours\CCPUParticle3DBehaviourTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleBehaviours</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleBehaviours\CCPUParticle3DSlaveBehaviour.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleBehaviours</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleBehaviours\CCPUParticle3DSlaveBehaviourTranslator.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleBehaviours</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleRenders\CCPUParticle3DBeamRender.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleRenders</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleRenders\CCPUParticle3DBillboardChain.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleRenders</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleRenders\CCPUParticle3DRibbonTrail.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleRenders</Filter>
</ClCompile>
<ClCompile Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleRenders\CCPUParticle3DRibbonTrailRender.cpp">
<Filter>extension\Particle3D\ParticleUniverse\ParticleRenders</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\physics\CCPhysicsBody.h">
@ -3157,6 +3322,162 @@
<ClInclude Include="..\physics\CCPhysicsHelper.h">
<Filter>physics</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\CCPUParticle3DListener.h">
<Filter>extension\Particle3D\ParticleUniverse</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DObserver.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DObserverManager.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DObserverTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnClearObserver.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnClearObserverTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnCollisionObserver.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnCollisionObserverTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnCountObserver.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnCountObserverTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnEmissionObserver.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnEmissionObserverTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnEventFlagObserver.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnEventFlagObserverTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnExpireObserver.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnExpireObserverTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnPositionObserver.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnPositionObserverTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnQuotaObserver.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnQuotaObserverTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnRandomObserver.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnRandomObserverTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnTimeObserver.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnTimeObserverTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnVelocityObserver.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleObservers\CCPUParticle3DOnVelocityObserverTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleObservers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoAffectorEventHandler.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoAffectorEventHandlerTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoEnableComponentEventHandler.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoEnableComponentEventHandlerTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoExpireEventHandler.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoExpireEventHandlerTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoFreezeEventHandler.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoFreezeEventHandlerTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoPlacementParticleEventHandler.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoPlacementParticleEventHandlerTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoScaleEventHandler.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoScaleEventHandlerTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoStopSystemEventHandler.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DDoStopSystemEventHandlerTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DEventHandler.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DEventHandlerManager.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleEventHandlers\CCPUParticle3DEventHandlerTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleEventHandlers</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleBehaviours\CCPUParticle3DBehaviour.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleBehaviours</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleBehaviours\CCPUParticle3DBehaviourManager.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleBehaviours</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleBehaviours\CCPUParticle3DBehaviourTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleBehaviours</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleBehaviours\CCPUParticle3DSlaveBehaviour.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleBehaviours</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleBehaviours\CCPUParticle3DSlaveBehaviourTranslator.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleBehaviours</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleRenders\CCPUParticle3DBeamRender.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleRenders</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleRenders\CCPUParticle3DBillboardChain.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleRenders</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleRenders\CCPUParticle3DRibbonTrail.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleRenders</Filter>
</ClInclude>
<ClInclude Include="..\..\extensions\Particle3D\ParticleUniverse\ParticleRenders\CCPUParticle3DRibbonTrailRender.h">
<Filter>extension\Particle3D\ParticleUniverse\ParticleRenders</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\math\Mat4.inl">

View File

@ -51,6 +51,7 @@ Particle3D/ParticleUniverse/CCPUParticle3DTranslateManager.cpp \
Particle3D/ParticleUniverse/CCPUParticle3DUtil.cpp \
Particle3D/ParticleUniverse/CCPUParticleSystem3D.cpp \
Particle3D/ParticleUniverse/CCPUParticleSystem3DTranslator.cpp \
Particle3D/ParticleUniverse/CCPUParticle3DListener.cpp \
Particle3D/ParticleUniverse/ParticleAffectors/CCPUParticle3DAffector.cpp \
Particle3D/ParticleUniverse/ParticleAffectors/CCPUParticle3DAffectorManager.cpp \
Particle3D/ParticleUniverse/ParticleAffectors/CCPUParticle3DAffectorTranslator.cpp \
@ -127,6 +128,57 @@ Particle3D/ParticleUniverse/ParticleEmitters/CCPUParticle3DSphereSurfaceEmitter.
Particle3D/ParticleUniverse/ParticleEmitters/CCPUParticle3DSphereSurfaceEmitterTranslator.cpp \
Particle3D/ParticleUniverse/ParticleEmitters/CCPUParticle3DVertexEmitter.cpp \
Particle3D/ParticleUniverse/ParticleRenders/CCPUParticle3DRender.cpp \
Particle3D/ParticleUniverse/ParticleRenders/CCPUParticle3DBeamRender.cpp \
Particle3D/ParticleUniverse/ParticleRenders/CCPUParticle3DBillboardChain.cpp \
Particle3D/ParticleUniverse/ParticleRenders/CCPUParticle3DRibbonTrail.cpp \
Particle3D/ParticleUniverse/ParticleRenders/CCPUParticle3DRibbonTrailRender.cpp \
Particle3D/ParticleUniverse/ParticleEventHandlers/CCPUParticle3DDoAffectorEventHandler.cpp \
Particle3D/ParticleUniverse/ParticleEventHandlers/CCPUParticle3DDoAffectorEventHandlerTranslator.cpp \
Particle3D/ParticleUniverse/ParticleEventHandlers/CCPUParticle3DDoEnableComponentEventHandler.cpp \
Particle3D/ParticleUniverse/ParticleEventHandlers/CCPUParticle3DDoEnableComponentEventHandlerTranslator.cpp \
Particle3D/ParticleUniverse/ParticleEventHandlers/CCPUParticle3DDoExpireEventHandler.cpp \
Particle3D/ParticleUniverse/ParticleEventHandlers/CCPUParticle3DDoExpireEventHandlerTranslator.cpp \
Particle3D/ParticleUniverse/ParticleEventHandlers/CCPUParticle3DDoFreezeEventHandler.cpp \
Particle3D/ParticleUniverse/ParticleEventHandlers/CCPUParticle3DDoFreezeEventHandlerTranslator.cpp \
Particle3D/ParticleUniverse/ParticleEventHandlers/CCPUParticle3DDoPlacementParticleEventHandler.cpp \
Particle3D/ParticleUniverse/ParticleEventHandlers/CCPUParticle3DDoPlacementParticleEventHandlerTranslator.cpp \
Particle3D/ParticleUniverse/ParticleEventHandlers/CCPUParticle3DDoScaleEventHandler.cpp \
Particle3D/ParticleUniverse/ParticleEventHandlers/CCPUParticle3DDoScaleEventHandlerTranslator.cpp \
Particle3D/ParticleUniverse/ParticleEventHandlers/CCPUParticle3DDoStopSystemEventHandler.cpp \
Particle3D/ParticleUniverse/ParticleEventHandlers/CCPUParticle3DDoStopSystemEventHandlerTranslator.cpp \
Particle3D/ParticleUniverse/ParticleEventHandlers/CCPUParticle3DEventHandler.cpp \
Particle3D/ParticleUniverse/ParticleEventHandlers/CCPUParticle3DEventHandlerManager.cpp \
Particle3D/ParticleUniverse/ParticleEventHandlers/CCPUParticle3DEventHandlerTranslator.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DObserver.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DObserverManager.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DObserverTranslator.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnClearObserver.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnClearObserverTranslator.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnCollisionObserver.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnCollisionObserverTranslator.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnCountObserver.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnCountObserverTranslator.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnEmissionObserver.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnEmissionObserverTranslator.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnEventFlagObserver.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnEventFlagObserverTranslator.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnExpireObserver.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnExpireObserverTranslator.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnPositionObserver.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnPositionObserverTranslator.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnQuotaObserver.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnQuotaObserverTranslator.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnRandomObserver.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnRandomObserverTranslator.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnTimeObserver.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnTimeObserverTranslator.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnVelocityObserver.cpp \
Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DOnVelocityObserverTranslator.cpp \
Particle3D/ParticleUniverse/ParticleBehaviours/CCPUParticle3DBehaviour.cpp \
Particle3D/ParticleUniverse/ParticleBehaviours/CCPUParticle3DBehaviourManager.cpp \
Particle3D/ParticleUniverse/ParticleBehaviours/CCPUParticle3DBehaviourTranslator.cpp \
Particle3D/ParticleUniverse/ParticleBehaviours/CCPUParticle3DSlaveBehaviour.cpp \
Particle3D/ParticleUniverse/ParticleBehaviours/CCPUParticle3DSlaveBehaviourTranslator.cpp \
LOCAL_STATIC_LIBRARIES := cocos2dx_internal_static
LOCAL_STATIC_LIBRARIES += cocos_curl_static

View File

@ -60,15 +60,12 @@ Particle3DQuadRender* Particle3DQuadRender::create(const std::string& texFile)
if (ret && ret->initQuadRender(texFile))
{
ret->autorelease();
return ret;
}
else
{
delete ret;
ret = nullptr;
CC_SAFE_DELETE(ret);
}
CC_SAFE_DELETE(ret);
return ret;
}
@ -99,7 +96,7 @@ void Particle3DQuadRender::render(Renderer* renderer, const Mat4 &transform, Par
}
_indexBuffer->retain();
}
ParticlePool::PoolList activeParticleList = particlePool.getActiveParticleList();
ParticlePool::PoolList activeParticleList = particlePool.getActiveDataList();
if (_posuvcolors.size() < activeParticleList.size() * 4)
{
_posuvcolors.resize(activeParticleList.size() * 4);
@ -192,13 +189,12 @@ bool Particle3DQuadRender::initQuadRender( const std::string& texFile )
//ret->_indexBuffer = IndexBuffer::create(IndexBuffer::IndexType::INDEX_TYPE_SHORT_16, 6 * 10000);
//ret->_indexBuffer->retain();
_meshCommand = new (std::nothrow)MeshCommand();
_meshCommand = new (std::nothrow) MeshCommand();
_meshCommand->setTransparent(true);
_meshCommand->setDepthTestEnabled(_depthTest);
_meshCommand->setDepthWriteEnabled(_depthWrite);
_meshCommand->setCullFace(GL_BACK);
_meshCommand->setCullFaceEnabled(true);
return true;
}
@ -244,6 +240,11 @@ void Particle3DModelRender::render(Renderer* renderer, const Mat4 &transform, Pa
if (_spriteList.empty()){
for (unsigned int i = 0; i < particleSystem->getParticleQuota(); ++i){
Sprite3D *sprite = Sprite3D::create(_modelFile);
if (sprite == nullptr)
{
CCLOG("failed to load file %s", _modelFile.c_str());
continue;
}
sprite->setTexture(_texFile);
sprite->retain();
_spriteList.push_back(sprite);
@ -258,15 +259,16 @@ void Particle3DModelRender::render(Renderer* renderer, const Mat4 &transform, Pa
const ParticlePool& particlePool = particleSystem->getParticlePool();
ParticlePool::PoolList activeParticleList = particlePool.getActiveParticleList();
ParticlePool::PoolList activeParticleList = particlePool.getActiveDataList();
Mat4 mat;
Mat4 rotMat;
Mat4 sclMat;
Quaternion q;
transform.decompose(nullptr, &q, nullptr);
for (unsigned int i = 0; i < activeParticleList.size(); ++i)
unsigned int index = 0;
for (auto iter : activeParticleList)
{
auto particle = activeParticleList[i];
auto particle = iter;
q *= particle->orientation;
Mat4::createRotation(q, &rotMat);
sclMat.m[0] = particle->width / _spriteSize.x;
@ -276,17 +278,17 @@ void Particle3DModelRender::render(Renderer* renderer, const Mat4 &transform, Pa
mat.m[12] = particle->position.x;
mat.m[13] = particle->position.y;
mat.m[14] = particle->position.z;
_spriteList[i]->draw(renderer, mat, 0);
_spriteList[index++]->draw(renderer, mat, 0);
}
}
void Particle3DRender::notifyStart( void )
void Particle3DRender::notifyStart()
{
setVisible(true);
}
void Particle3DRender::notifyStop( void )
void Particle3DRender::notifyStop()
{
setVisible(false);
}

View File

@ -45,6 +45,7 @@ class Texture2D;
*/
class CC_DLL Particle3DRender : public Ref
{
friend class ParticleSystem3D;
public:
virtual void render(Renderer* renderer, const Mat4 &transform, ParticleSystem3D* particleSystem) = 0;
@ -68,12 +69,16 @@ public:
CC_CONSTRUCTOR_ACCESS:
Particle3DRender()
: _depthTest(true)
: _particleSystem(nullptr)
, _isVisible(true)
, _rendererScale(Vec3::ONE)
, _depthTest(true)
, _depthWrite(false)
{};
virtual ~Particle3DRender(){};
protected:
ParticleSystem3D *_particleSystem;
bool _isVisible;
Vec3 _rendererScale;
bool _depthTest;

View File

@ -46,92 +46,10 @@ Particle3D::~Particle3D()
}
ParticlePool::ParticlePool()
{
}
ParticlePool::~ParticlePool()
{
}
Particle3D* ParticlePool::createParticle()
{
if (_locked.empty()) return nullptr;
Particle3D* p = _locked.front();
_released.push_back(p);
_locked.erase(_locked.begin());
//_released.splice(_released.end(), _locked, _locked.begin());
return p;
}
void ParticlePool::lockLatestParticle()
{
_locked.push_back(*_releasedIter);
_releasedIter = _released.erase(_releasedIter);
if (_releasedIter != _released.begin() && _releasedIter != _released.end())
{
--_releasedIter;
}
}
void ParticlePool::lockAllParticles()
{
//_locked.splice(_locked.end(), _released);
_locked.insert(_locked.end(), _released.begin(), _released.end());
_released.clear();
_releasedIter = _released.begin();
}
Particle3D* ParticlePool::getFirst()
{
_releasedIter = _released.begin();
if (_releasedIter == _released.end()) return nullptr;
return *_releasedIter;
}
Particle3D* ParticlePool::getNext()
{
if (_releasedIter == _released.end()) return nullptr;
++_releasedIter;
if (_releasedIter == _released.end()) return nullptr;
return *_releasedIter;
}
void ParticlePool::addParticle( Particle3D *particle )
{
_locked.push_back(particle);
}
bool ParticlePool::empty() const
{
return _released.empty();
}
void ParticlePool::removeAllParticles( bool needDelete /*= false*/ )
{
lockAllParticles();
if (needDelete){
for (auto iter : _locked){
delete iter;
}
_locked.clear();
}
else{
_locked.clear();
}
}
const ParticlePool::PoolList& ParticlePool::getActiveParticleList() const
{
return _released;
}
ParticleSystem3D::ParticleSystem3D()
: _emitter(nullptr)
, _render(nullptr)
, _aliveParticlesCnt(0)
, _particleQuota(0)
, _state(State::STOP)
, _blend(BlendFunc::ALPHA_NON_PREMULTIPLIED)
@ -142,7 +60,7 @@ ParticleSystem3D::ParticleSystem3D()
}
ParticleSystem3D::~ParticleSystem3D()
{
stopParticleSystem();
//stopParticle();
removeAllAffector();
CC_SAFE_RELEASE(_emitter);
CC_SAFE_RELEASE(_render);
@ -205,6 +123,7 @@ void ParticleSystem3D::setRender(Particle3DRender* render)
{
CC_SAFE_RELEASE(_render);
_render = render;
_render->_particleSystem = this;
CC_SAFE_RETAIN(_render);
}
}

View File

@ -58,24 +58,83 @@ struct CC_DLL Particle3D
std::map<std::string, void*> userDefs;
};
class CC_DLL ParticlePool
template<typename T>
class CC_DLL DataPool
{
public:
typedef std::vector<Particle3D *> PoolList;
typedef std::vector<Particle3D *>::iterator PoolIterator;
typedef typename std::list<T*> PoolList;
typedef typename std::list<T*>::iterator PoolIterator;
ParticlePool();
~ParticlePool();
DataPool(){};
~DataPool(){};
Particle3D* createParticle();
void lockLatestParticle();
void lockAllParticles();
Particle3D* getFirst();
Particle3D* getNext();
const PoolList& getActiveParticleList() const;
void addParticle(Particle3D *particle);
bool empty() const;
void removeAllParticles(bool needDelete = false);
T* createData(){
if (_locked.empty()) return nullptr;
T* p = _locked.front();
//_released.push_back(p);
//_locked.erase(_locked.begin());
_released.splice(_released.end(), _locked, _locked.begin());
return p;
};
void lockLatestData(){
_locked.push_back(*_releasedIter);
_releasedIter = _released.erase(_releasedIter);
if (_releasedIter != _released.begin() && _releasedIter != _released.end())
{
--_releasedIter;
}
};
void lockData(T *data){
PoolIterator tempIter = _releasedIter;
T *ptr = getFirst();
while (ptr)
{
if (ptr == data) break;
ptr = getNext();
}
if (ptr)
lockLatestData();
_releasedIter = tempIter;
}
void lockAllDatas(){
_locked.splice(_locked.end(), _released);
//_locked.insert(_locked.end(), _released.begin(), _released.end());
//_released.clear();
_releasedIter = _released.begin();
};
T* getFirst(){
_releasedIter = _released.begin();
if (_releasedIter == _released.end()) return nullptr;
return *_releasedIter;
};
T* getNext(){
if (_releasedIter == _released.end()) return nullptr;
++_releasedIter;
if (_releasedIter == _released.end()) return nullptr;
return *_releasedIter;
};
const PoolList& getActiveDataList() const { return _released; };
const PoolList& getUnActiveDataList() const { return _locked; };
void addData(T* data){
_locked.push_back(data);
};
bool empty() const { return _released.empty(); };
void removeAllDatas(){
lockAllDatas();
for (auto iter : _locked){
delete iter;
}
_locked.clear();
};
private:
@ -84,9 +143,12 @@ private:
PoolList _locked;
};
typedef DataPool<Particle3D> ParticlePool;
class CC_DLL ParticleSystem3D : public Node, public BlendProtocol
{
public:
enum class State
{
STOP,
@ -189,7 +251,7 @@ protected:
//particles
ParticlePool _particlePool;
int _aliveParticlesCnt;
unsigned int _particleQuota;
BlendFunc _blend;

View File

@ -72,6 +72,23 @@ float PUDynamicAttributeFixed::getValue (float x)
{
return _value;
}
void PUDynamicAttributeFixed::copyAttributesTo( PUDynamicAttribute* dynamicAttribute )
{
if (!dynamicAttribute || dynamicAttribute->getType() != PUDynamicAttribute::DAT_FIXED)
return;
PUDynamicAttributeFixed* dynAttr = static_cast<PUDynamicAttributeFixed*>(dynamicAttribute);
dynAttr->_value = _value;
}
PUDynamicAttributeFixed* PUDynamicAttributeFixed::clone()
{
auto af = new (std::nothrow) PUDynamicAttributeFixed();
this->copyAttributesTo(af);
return af;
}
//-----------------------------------------------------------------------
PUDynamicAttributeRandom::PUDynamicAttributeRandom (void) : _min(0), _max(0)
{
@ -120,6 +137,23 @@ float PUDynamicAttributeRandom::getValue (float x)
return cocos2d::random(_min, _max);
}
void PUDynamicAttributeRandom::copyAttributesTo( PUDynamicAttribute* dynamicAttribute )
{
if (!dynamicAttribute || dynamicAttribute->getType() != PUDynamicAttribute::DAT_RANDOM)
return;
PUDynamicAttributeRandom* dynAttr = static_cast<PUDynamicAttributeRandom*>(dynamicAttribute);
dynAttr->_min = _min;
dynAttr->_max = _max;
}
PUDynamicAttributeRandom* PUDynamicAttributeRandom::clone()
{
auto ar = new (std::nothrow) PUDynamicAttributeRandom();
this->copyAttributesTo(ar);
return ar;
}
//-----------------------------------------------------------------------
PUDynamicAttributeCurved::PUDynamicAttributeCurved (void) :
_interpolationType(IT_LINEAR),
@ -279,6 +313,34 @@ PUDynamicAttributeCurved::ControlPointList::iterator PUDynamicAttributeCurved::g
return _controlPoints.end() - 1;
}
void PUDynamicAttributeCurved::copyAttributesTo( PUDynamicAttribute* dynamicAttribute )
{
if (!dynamicAttribute || dynamicAttribute->getType() != PUDynamicAttribute::DAT_CURVED)
return;
PUDynamicAttributeCurved* dynAttr = static_cast<PUDynamicAttributeCurved*>(dynamicAttribute);
dynAttr->_interpolationType = _interpolationType;
dynAttr->_spline = _spline;
dynAttr->_range = _range;
// Copy controlpoints
PUDynamicAttributeCurved::ControlPointList::const_iterator it; // Need const_iterator here!
PUDynamicAttributeCurved::ControlPointList::const_iterator itEnd = _controlPoints.end();
for (it = _controlPoints.begin(); it != itEnd; ++it)
{
Vec2 controlPoint = *it;
dynAttr->_controlPoints.push_back(controlPoint);
}
dynAttr->processControlPoints();
}
PUDynamicAttributeCurved* PUDynamicAttributeCurved::clone()
{
auto ac = new (std::nothrow) PUDynamicAttributeCurved();
this->copyAttributesTo(ac);
return ac;
}
//-----------------------------------------------------------------------
PUDynamicAttributeOscillate::PUDynamicAttributeOscillate (void) :
_oscillationType(PUDynamicAttributeOscillate::OSCT_SINE),
@ -370,6 +432,27 @@ float PUDynamicAttributeOscillate::getValue (float x)
return 0;
}
void PUDynamicAttributeOscillate::copyAttributesTo( PUDynamicAttribute* dynamicAttribute )
{
if (!dynamicAttribute || dynamicAttribute->getType() != PUDynamicAttribute::DAT_OSCILLATE)
return;
PUDynamicAttributeOscillate* dynAttr = static_cast<PUDynamicAttributeOscillate*>(dynamicAttribute);
dynAttr->_oscillationType = _oscillationType;
dynAttr->_frequency = _frequency;
dynAttr->_phase = _phase;
dynAttr->_base = _base;
dynAttr->_amplitude = _amplitude;
}
PUDynamicAttributeOscillate* PUDynamicAttributeOscillate::clone()
{
auto ao = new (std::nothrow) PUDynamicAttributeOscillate();
this->copyAttributesTo(ao);
return ao;
}
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------

View File

@ -94,6 +94,9 @@ class CC_DLL PUDynamicAttribute : public Ref
*/
bool isValueChangedExternally(void) const;
virtual void copyAttributesTo(PUDynamicAttribute* dynamicAttribute) = 0;
virtual PUDynamicAttribute* clone() = 0;
protected:
DynamicAttributeType _type;
bool _valueChangedExternally;
@ -128,6 +131,9 @@ class CC_DLL PUDynamicAttributeFixed : public PUDynamicAttribute
*/
virtual void setValue (float value);
virtual PUDynamicAttributeFixed* clone() override;
virtual void copyAttributesTo(PUDynamicAttribute* dynamicAttribute);
protected:
float _value;
};
@ -161,6 +167,9 @@ class CC_DLL PUDynamicAttributeRandom : public PUDynamicAttribute
float getMax (void) const;
void setMinMax (float min, float max);
virtual PUDynamicAttributeRandom* clone() override;
virtual void copyAttributesTo(PUDynamicAttribute* dynamicAttribute);
protected:
float _min, _max;
};
@ -218,6 +227,9 @@ class CC_DLL PUDynamicAttributeCurved : public PUDynamicAttribute
*/
void removeAllControlPoints(void);
virtual PUDynamicAttributeCurved* clone() override;
virtual void copyAttributesTo(PUDynamicAttribute* dynamicAttribute);
protected:
/** Todo
@ -298,6 +310,9 @@ class CC_DLL PUDynamicAttributeOscillate : public PUDynamicAttribute
float getAmplitude (void) const;
void setAmplitude (float amplitude);
virtual PUDynamicAttributeOscillate* clone() override;
virtual void copyAttributesTo(PUDynamicAttribute* dynamicAttribute);
protected:
OscillationType _oscillationType;
float _frequency;

View File

@ -22,7 +22,6 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCPUParticle3DDynamicAttributeTranslator.h"
#include "extensions/Particle3D/ParticleUniverse/CCPUParticleSystem3D.h"

View File

@ -22,7 +22,6 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __CC_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_TRANSLATOR_H__
#define __CC_PU_PARTICLE_3D_DYNAMIC_ATTRIBUTE_TRANSLATOR_H__

View File

@ -151,6 +151,174 @@ void PURealTimeForceFieldCalculationFactory::determineForce(const Vec3& position
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
//const uint16 MatrixForceFieldCalculationFactory::WORKQUEUE_GENERATE_REQUEST = 1;
////-----------------------------------------------------------------------
//MatrixForceFieldCalculationFactory::MatrixForceFieldCalculationFactory(void) :
// ForceFieldCalculationFactory(),
// mMatrixPositions(0),
// mForceFieldSize(0),
// mX(0),
// mY(0),
// mZ(0),
// mInitialising(false)
//{
// Ogre::WorkQueue* wq = Ogre::Root::getSingleton().getWorkQueue();
// mWorkQueueChannel = wq->getChannel("ParticleUniverse/MatrixForceFieldCalculationFactory");
// wq->addRequestHandler(mWorkQueueChannel, this);
// wq->addResponseHandler(mWorkQueueChannel, this);
//}
////-----------------------------------------------------------------------
//MatrixForceFieldCalculationFactory::~MatrixForceFieldCalculationFactory(void)
//{
// Ogre::WorkQueue* wq = Ogre::Root::getSingleton().getWorkQueue();
// wq->removeRequestHandler(mWorkQueueChannel, this);
// wq->removeResponseHandler(mWorkQueueChannel, this);
// deleteMatrix();
//}
////-----------------------------------------------------------------------
//void MatrixForceFieldCalculationFactory::generate(unsigned int forceFieldSize,
// unsigned short octaves,
// double frequency,
// double amplitude,
// double persistence,
// const Vec3& worldSize)
//{
// // Push request to the workerqueue
// MatrixRequest req(this);
// req.forceFieldSize = forceFieldSize;
// req.octaves = octaves;
// req.frequency = frequency;
// req.amplitude = amplitude;
// req.persistence = persistence;
// req.worldSize = worldSize;
// mInitialising = true;
// Ogre::Root::getSingleton().getWorkQueue()->addRequest(mWorkQueueChannel, WORKQUEUE_GENERATE_REQUEST, Any(req), 0, false);
//}
////-----------------------------------------------------------------------
//void MatrixForceFieldCalculationFactory::deleteMatrix(void)
//{
// if (!mMatrixPositions)
// return;
//
// for(unsigned int i = 0; i < mForceFieldSize; ++i)
// {
// for(unsigned int j = 0; j < mForceFieldSize; ++j)
// {
// delete [] mMatrixPositions[i][j];
// }
// delete [] mMatrixPositions[i];
// }
// delete [] mMatrixPositions;
// mMatrixPositions = 0;
//}
////-----------------------------------------------------------------------
//void MatrixForceFieldCalculationFactory::determineForce(const Vec3& position, Vec3& force, float delta)
//{
// if (mInitialising)
// {
// return;
// }
//
// // Ignore delta, because it is not needed to search into the matrix
// mX = (unsigned int)(mMapScale.x * position.x);
// mY = (unsigned int)(mMapScale.y * position.y);
// mZ = (unsigned int)(mMapScale.z * position.z);
// if (mX >= mForceFieldSize || mY >= mForceFieldSize || mZ >= mForceFieldSize)
// {
// // Position is outside the forcefield
// return;
// }
//
// force.x = mMatrixPositions[mX][mY][mZ].x;
// force.y = mMatrixPositions[mX][mY][mZ].y;
// force.z = mMatrixPositions[mX][mY][mZ].z;
//}
////---------------------------------------------------------------------
//bool MatrixForceFieldCalculationFactory::canHandleRequest(const Ogre::WorkQueue::Request* req, const Ogre::WorkQueue* srcQ)
//{
// MatrixRequest preq = any_cast<MatrixRequest>(req->getData());
// if (preq.src != this)
// return false;
// else
// return RequestHandler::canHandleRequest(req, srcQ);
//}
////---------------------------------------------------------------------
//bool MatrixForceFieldCalculationFactory::canHandleResponse(const Ogre::WorkQueue::Response* res, const Ogre::WorkQueue* srcQ)
//{
// MatrixRequest preq = any_cast<MatrixRequest>(res->getRequest()->getData());
// if (preq.src != this)
// return false;
// else
// return true;
//}
////---------------------------------------------------------------------
//Ogre::WorkQueue::Response* MatrixForceFieldCalculationFactory::handleRequest(const Ogre::WorkQueue::Request* req, const Ogre::WorkQueue* srcQ)
//{
// MatrixRequest preq = any_cast<MatrixRequest>(req->getData());
// if (preq.src != this)
// return 0;
//
// // Setup the 3D matrix with precalculated force field vectors
// mNoise3D.initialise(preq.octaves, preq.frequency, preq.amplitude, preq.persistence);
// mMapScale.x = preq.forceFieldSize / preq.worldSize.x;
// mMapScale.y = preq.forceFieldSize / preq.worldSize.y;
// mMapScale.z = preq.forceFieldSize / preq.worldSize.z;
//
// deleteMatrix();
// mForceFieldSize = preq.forceFieldSize;
// mMatrixPositions = new MatrixPosition**[mForceFieldSize];
// for(unsigned int i = 0; i < mForceFieldSize; ++i)
// {
// mMatrixPositions[i] = new MatrixPosition*[mForceFieldSize];
// for(unsigned int j = 0; j < mForceFieldSize; ++j)
// {
// mMatrixPositions[i][j] = new MatrixPosition[mForceFieldSize];
// }
// }
//
// // Fill the matrix
// mForceFieldSize = mForceFieldSize == 0 ? 1 : mForceFieldSize; // The forcefield may not be 0
// float delta = 1.0f / mForceFieldSize;
// for(unsigned int i = 0; i < mForceFieldSize; ++i)
// {
// for(unsigned int j = 0; j < mForceFieldSize; ++j)
// {
// for(unsigned int k = 0; k < mForceFieldSize; ++k)
// {
// mMatrixPositions[i][j][k].x = (float)(mNoise3D.noise(i * delta + delta, j * delta, k * delta) -
// mNoise3D.noise(i * delta - delta, j * delta, k * delta));
// mMatrixPositions[i][j][k].y = (float)(mNoise3D.noise(i * delta, j * delta + delta, k * delta) -
// mNoise3D.noise(i * delta, j * delta - delta, k * delta));
// mMatrixPositions[i][j][k].z = (float)(mNoise3D.noise(i * delta, j * delta, k * delta + delta) -
// mNoise3D.noise(i * delta, j * delta, k * delta - delta));
// }
// }
// }
//
// MatrixResponse res;
// Ogre::WorkQueue::Response* response = PU_NEW Ogre::WorkQueue::Response(req, true, Any(res));
// return response;
//}
////---------------------------------------------------------------------
//void MatrixForceFieldCalculationFactory::handleResponse(const Ogre::WorkQueue::Response* res, const Ogre::WorkQueue* srcQ)
//{
// // Response itself is not used
// mInitialising = false;
//}
////-----------------------------------------------------------------------
//unsigned int MatrixForceFieldCalculationFactory::getForceFieldSize(void) const
//{
// return mForceFieldSize;
//}
////-----------------------------------------------------------------------
//void MatrixForceFieldCalculationFactory::setForceFieldSize(unsigned int forceFieldSize)
//{
// mForceFieldSize = forceFieldSize;
// generate(mForceFieldSize, mOctaves, mFrequency, mAmplitude, mPersistence, mWorldSize);
//}
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
PUForceField::PUForceField(void) :
_forceFieldCalculationFactory(0),
_forceFieldPositionBase(Vec3::ZERO),
@ -249,7 +417,7 @@ PUForceFieldCalculationFactory* PUForceField::createForceFieldCalculationFactory
if (type == FF_MATRIX_CALC)
{
// Use precreated matrix
//setForceFieldCalculationFactory(new (std::nothrow) MatrixForceFieldCalculationFactory());
//setForceFieldCalculationFactory(new MatrixForceFieldCalculationFactory());
return getForceFieldCalculationFactory();
}
else

View File

@ -127,6 +127,99 @@ public:
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
///** Factory class to calculate forces based on a precalculated force field
//*/
//class MatrixForceFieldCalculationFactory :
// public ForceFieldCalculationFactory,
// public Ogre::WorkQueue::RequestHandler,
// public Ogre::WorkQueue::ResponseHandler
//{
//public:
// static const uint16 WORKQUEUE_GENERATE_REQUEST;
// struct MatrixPosition
// {
// float x;
// float y;
// float z;
// };
//
// MatrixForceFieldCalculationFactory(void);
// virtual ~MatrixForceFieldCalculationFactory(void);
//
// /** Override from ForceFieldCalculationFactory
// */
// virtual void generate(unsigned int forceFieldSize,
// unsigned short octaves,
// double frequency,
// double amplitude,
// double persistence,
// const Vec3& worldSize);
//
// /** Delete the internally build matrix
// */
// void deleteMatrix(void);
//
// /** Override from ForceFieldCalculationFactory
// */
// virtual void determineForce(const Vec3& position, Vec3& force, float delta);
//
// /** WorkQueue::RequestHandler override
// */
// bool canHandleRequest(const Ogre::WorkQueue::Request* req, const Ogre::WorkQueue* srcQ);
//
// /** WorkQueue::RequestHandler override
// */
// Ogre::WorkQueue::Response* handleRequest(const Ogre::WorkQueue::Request* req, const Ogre::WorkQueue* srcQ);
//
// /** WorkQueue::ResponseHandler override
// */
// bool canHandleResponse(const Ogre::WorkQueue::Response* res, const Ogre::WorkQueue* srcQ);
//
// /** WorkQueue::ResponseHandler override
// */
// void handleResponse(const Ogre::WorkQueue::Response* res, const Ogre::WorkQueue* srcQ);
//
// /** Get/Set Forcefield size.
// @remarks
// These get/set functions override default ones.
// */
// virtual unsigned int getForceFieldSize(void) const;
// virtual void setForceFieldSize(unsigned int forceFieldSize);
//
//protected:
// MatrixPosition*** mMatrixPositions;
// unsigned int mForceFieldSize;
// unsigned int mX;
// unsigned int mY;
// unsigned int mZ;
// uint16 mWorkQueueChannel;
// bool mInitialising;
//
// // Request / response structures
// struct MatrixRequest
// {
// unsigned int forceFieldSize;
// unsigned short octaves;
// double frequency;
// double amplitude;
// double persistence;
// Vec3 worldSize;
// MatrixForceFieldCalculationFactory* src;
// friend std::ostream& operator<<(std::ostream& o, const MatrixRequest& r)
// {return o;}
// MatrixRequest(MatrixForceFieldCalculationFactory* f): src(f) {};
// };
//
// struct MatrixResponse
// {
// friend std::ostream& operator<<(std::ostream& o, const MatrixResponse& r)
// {return o;}
// };
//};
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
/** Force Field Affector Class:
This class defines a force field to affect the particle direction. The force field is based on 3D noise. The force can be calculated in

View File

@ -0,0 +1,42 @@
/****************************************************************************
Copyright (C) 2013 Henry van Merode. All rights reserved.
Copyright (c) 2015 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "extensions/Particle3D/ParticleUniverse/CCPUParticle3DListener.h"
#include "extensions/Particle3D/ParticleUniverse/CCPUParticleSystem3D.h"
NS_CC_BEGIN
PUParticle3DListener::PUParticle3DListener()
{
}
PUParticle3DListener::~PUParticle3DListener()
{
}
NS_CC_END

View File

@ -0,0 +1,56 @@
/****************************************************************************
Copyright (C) 2013 Henry van Merode. All rights reserved.
Copyright (c) 2015 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __CC_PU_PARTICLE_3D_LISTENER_H__
#define __CC_PU_PARTICLE_3D_LISTENER_H__
#include "base/CCRef.h"
#include "math/CCMath.h"
#include <vector>
#include <string>
NS_CC_BEGIN
struct PUParticle3D;
class PUParticleSystem3D;
class CC_DLL PUParticle3DListener
{
public:
PUParticle3DListener();
virtual ~PUParticle3DListener();
/* Callback function, which is called as soon as a particle is emitted.
*/
virtual void particleEmitted(PUParticleSystem3D* particleSystem, PUParticle3D* particle) = 0;
/* Callback function, which is called as soon as a particle is expired.
*/
virtual void particleExpired(PUParticleSystem3D* particleSystem, PUParticle3D* particle) = 0;
};
NS_CC_END
#endif

View File

@ -89,9 +89,6 @@ PUParticle3DMaterial* PUParticle3DMaterialCache::getMaterial( const std::string
bool PUParticle3DMaterialCache::loadMaterials( const std::string &file )
{
//std::string data = FileUtils::getInstance()->getStringFromFile(file);
//auto iter = _materialMap.find(file);
//if (iter != _materialMap.end()) return true;
bool isFirstCompile = true;
auto list = PUScriptCompiler::Instance()->compile(file, isFirstCompile);
if (list == nullptr || list->empty()) return false;
@ -131,7 +128,6 @@ bool PUParticle3DMaterialCache::loadMaterialsFromSearchPaths( const std::string
{
bool state = false;
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
//for (auto iter : FileUtils::getInstance()->getSearchPaths()){
std::string seg("/");
std::string fullPath = fileFolder + seg + std::string("*.material");
_finddata_t data;
@ -144,7 +140,6 @@ bool PUParticle3DMaterialCache::loadMaterialsFromSearchPaths( const std::string
state = true;
}
_findclose(handle);
// }
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID/* || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX*/)
std::string::size_type pos = fileFolder.find("assets/");
std::string relativePath = fileFolder;
@ -168,7 +163,7 @@ bool PUParticle3DMaterialCache::loadMaterialsFromSearchPaths( const std::string
DIR *d; //dir handle
struct dirent *file; //readdir
struct stat statbuf;
if(!(d = opendir(fileFolder.c_str())))
{
CCLOG("error opendir %s!!!\n",fileFolder.c_str());
@ -180,7 +175,7 @@ bool PUParticle3DMaterialCache::loadMaterialsFromSearchPaths( const std::string
{
continue;
}
std::string fullpath = fileFolder + "/" + file->d_name;
if (strlen(file->d_name) > 9 && strcmp(".material", file->d_name + strlen(file->d_name) - 9))
{

View File

@ -222,12 +222,12 @@ void PUParticle3DMaterialPassTranslator::translate( PUScriptCompiler* compiler,
}
else if (prop->name == matToken[TOKEN_MAT_SPECULAR])
{
PUAbstractNodeList::const_iterator it = prop->values.begin();
PUAbstractNodeList::const_iterator i = prop->values.begin();
PUAbstractNodeList::const_iterator end = prop->values.end();
unsigned int n = 0;
Vec4 color;
float shininess;
while(it != end)
while(i != end)
{
float v = 0;
if(getFloat(**i, &v))
@ -252,7 +252,7 @@ void PUParticle3DMaterialPassTranslator::translate( PUScriptCompiler* compiler,
}
}
++n;
++it;
++i;
}
material->specularColor = color;
@ -399,7 +399,9 @@ void PUParticle3DMaterialTextureUnitTranslator::translate( PUScriptCompiler* com
PUPropertyAbstractNode *prop = reinterpret_cast<PUPropertyAbstractNode*>((*i));
if (prop->name == matToken[TOKEN_MAT_TEXTURE_FILE])
{
if (passValidateProperty(compiler, prop, matToken[TOKEN_MAT_TEXTURE_FILE], VAL_STRING))
//if (passValidateProperty(compiler, prop, matToken[TOKEN_MAT_TEXTURE_FILE], VAL_STRING))
if (!prop->values.empty())
{
std::string val;
if(getString(*prop->values.front(), &val))

View File

@ -246,8 +246,7 @@ void PUParticle3DRendererTranslator::translate(PUScriptCompiler* compiler, PUAbs
}
}
}
if (type == "Entity"){
else if (type == "Entity"){
for(PUAbstractNodeList::iterator i = obj->children.begin(); i != obj->children.end(); ++i)
{
if((*i)->type == ANT_PROPERTY)
@ -271,11 +270,337 @@ void PUParticle3DRendererTranslator::translate(PUScriptCompiler* compiler, PUAbs
}
}
}
else if (type == "Box"){
if (material)
_renderer = PUParticle3DBoxRender::create(texFolder + material->textureFile);
else
_renderer = PUParticle3DBoxRender::create();
}
else if (type == "Sphere"){
if (material)
_renderer = PUParticle3DSphereRender::create(texFolder + material->textureFile);
else
_renderer = PUParticle3DSphereRender::create();
}
else if (type == "Beam"){
if (material)
_renderer = PUParticle3DBeamRender::create(texFolder + material->textureFile);
else
_renderer = PUParticle3DBeamRender::create();
for(PUAbstractNodeList::iterator i = obj->children.begin(); i != obj->children.end(); ++i)
{
if((*i)->type == ANT_PROPERTY)
{
PUPropertyAbstractNode* prop = reinterpret_cast<PUPropertyAbstractNode*>((*i));
if (prop->name == token[TOKEN_UPDATE_INTERVAL])
{
// Property: update_interval
if (passValidateProperty(compiler, prop, token[TOKEN_UPDATE_INTERVAL], VAL_REAL))
{
float val = 0.0f;
if(getFloat(*prop->values.front(), &val))
{
static_cast<PUParticle3DBeamRender *>(_renderer)->setUpdateInterval(val);
}
}
}
else if (prop->name == token[TOKEN_BEAMRENDERER_UPDATE_INTERVAL])
{
// Property: beam_update_interval (deprecated and replaced by 'update_interval')
if (passValidateProperty(compiler, prop, token[TOKEN_BEAMRENDERER_UPDATE_INTERVAL], VAL_REAL))
{
float val = 0.0f;
if(getFloat(*prop->values.front(), &val))
{
static_cast<PUParticle3DBeamRender *>(_renderer)->setUpdateInterval(val);
}
}
}
else if (prop->name == token[TOKEN_BEAMRENDERER_DEVIATION])
{
// Property: beam_deviation
if (passValidateProperty(compiler, prop, token[TOKEN_BEAMRENDERER_DEVIATION], VAL_REAL))
{
float val = 0.0f;
if(getFloat(*prop->values.front(), &val))
{
static_cast<PUParticle3DBeamRender *>(_renderer)->setDeviation(val);
}
}
}
else if (prop->name == token[TOKEN_NUMBER_OF_SEGMENTS])
{
// Property: number_of_segments
if (passValidateProperty(compiler, prop, token[TOKEN_NUMBER_OF_SEGMENTS], VAL_UINT))
{
unsigned int val = 0;
if(getUInt(*prop->values.front(), &val))
{
static_cast<PUParticle3DBeamRender *>(_renderer)->setNumberOfSegments(val);
}
}
}
else if (prop->name == token[TOKEN_BEAMRENDERER_NUMBER_OF_SEGMENTS])
{
// Property: beam_number_segments (deprecated and replaced by 'number_of_segments')
if (passValidateProperty(compiler, prop, token[TOKEN_BEAMRENDERER_NUMBER_OF_SEGMENTS], VAL_UINT))
{
unsigned int val = 0;
if(getUInt(*prop->values.front(), &val))
{
static_cast<PUParticle3DBeamRender *>(_renderer)->setNumberOfSegments(val);
}
}
}
else if (prop->name == token[TOKEN_BEAMRENDERER_JUMP])
{
// Property: beam_jump_segments
if (passValidateProperty(compiler, prop, token[TOKEN_BEAMRENDERER_JUMP], VAL_BOOL))
{
bool val;
if(getBoolean(*prop->values.front(), &val))
{
static_cast<PUParticle3DBeamRender *>(_renderer)->setJump(val);
}
}
}
else if (prop->name == token[TOKEN_BEAMRENDERER_TEXCOORD_DIRECTION])
{
// Property: beam_texcoord_direction
if (passValidateProperty(compiler, prop, token[TOKEN_BEAMRENDERER_TEXCOORD_DIRECTION], VAL_STRING))
{
std::string val;
if(getString(*prop->values.front(), &val))
{
if (val == token[TOKEN_BEAMRENDERER_TCD_U])
{
static_cast<PUParticle3DBeamRender *>(_renderer)->setTexCoordDirection(PUBillboardChain::TCD_U);
}
else if (val == token[TOKEN_BEAMRENDERER_TCD_V])
{
static_cast<PUParticle3DBeamRender *>(_renderer)->setTexCoordDirection(PUBillboardChain::TCD_V);
}
}
}
}
else if (prop->name == token[TOKEN_USE_VERTEX_COLOURS])
{
// Property: use_vertex_colours
if (passValidateProperty(compiler, prop, token[TOKEN_USE_VERTEX_COLOURS], VAL_BOOL))
{
bool val;
if(getBoolean(*prop->values.front(), &val))
{
static_cast<PUParticle3DBeamRender *>(_renderer)->setUseVertexColours(val);
}
}
}
else if (prop->name == token[TOKEN_BEAMRENDERER_VERTEX_COLOURS])
{
// Property: beam_vertex_colours (deprecated and replaced by 'use_vertex_colours')
if (passValidateProperty(compiler, prop, token[TOKEN_BEAMRENDERER_VERTEX_COLOURS], VAL_BOOL))
{
bool val;
if(getBoolean(*prop->values.front(), &val))
{
static_cast<PUParticle3DBeamRender *>(_renderer)->setUseVertexColours(val);
}
}
}
else if (prop->name == token[TOKEN_MAX_ELEMENTS])
{
// Property: max_elements
if (passValidateProperty(compiler, prop, token[TOKEN_MAX_ELEMENTS], VAL_UINT))
{
unsigned int val = 0;
if(getUInt(*prop->values.front(), &val))
{
static_cast<PUParticle3DBeamRender *>(_renderer)->setMaxChainElements(val);
}
}
}
else if (prop->name == token[TOKEN_BEAMRENDERER_MAX_ELEMENTS])
{
// Property: beam_max_elements (deprecated and replaced by 'max_elements')
if (passValidateProperty(compiler, prop, token[TOKEN_BEAMRENDERER_MAX_ELEMENTS], VAL_UINT))
{
unsigned int val = 0;
if(getUInt(*prop->values.front(), &val))
{
static_cast<PUParticle3DBeamRender *>(_renderer)->setMaxChainElements(val);
}
}
}
}
}
}
else if (type == "RibbonTrail"){
if (material)
_renderer = PUParticle3DRibbonTrailRender::create(texFolder + material->textureFile);
else
_renderer = PUParticle3DRibbonTrailRender::create();
for(PUAbstractNodeList::iterator i = obj->children.begin(); i != obj->children.end(); ++i)
{
if((*i)->type == ANT_PROPERTY)
{
PUPropertyAbstractNode* prop = reinterpret_cast<PUPropertyAbstractNode*>((*i));
if (prop->name == token[TOKEN_USE_VERTEX_COLOURS])
{
// Property: use_vertex_colours
if (passValidateProperty(compiler, prop, token[TOKEN_USE_VERTEX_COLOURS], VAL_BOOL))
{
bool val;
if(getBoolean(*prop->values.front(), &val))
{
static_cast<PUParticle3DRibbonTrailRender *>(_renderer)->setUseVertexColors(val);
}
}
}
else if (prop->name == token[TOKEN_RIBBONTRAIL_VERTEX_COLOURS])
{
// Property: ribbontrail_vertex_colours (deprecated and replaced by 'use_vertex_colours')
if (passValidateProperty(compiler, prop, token[TOKEN_RIBBONTRAIL_VERTEX_COLOURS], VAL_BOOL))
{
bool val;
if(getBoolean(*prop->values.front(), &val))
{
static_cast<PUParticle3DRibbonTrailRender *>(_renderer)->setUseVertexColors(val);
}
}
}
else if (prop->name == token[TOKEN_MAX_ELEMENTS])
{
// Property: max_elements
if (passValidateProperty(compiler, prop, token[TOKEN_MAX_ELEMENTS], VAL_UINT))
{
unsigned int val = 0;
if(getUInt(*prop->values.front(), &val))
{
static_cast<PUParticle3DRibbonTrailRender *>(_renderer)->setMaxChainElements(val);
}
}
}
else if (prop->name == token[TOKEN_RIBBONTRAIL_MAX_ELEMENTS])
{
// Property: ribbontrail_max_elements (deprecated and replaced by 'max_elements')
if (passValidateProperty(compiler, prop, token[TOKEN_RIBBONTRAIL_MAX_ELEMENTS], VAL_UINT))
{
unsigned int val = 0;
if(getUInt(*prop->values.front(), &val))
{
static_cast<PUParticle3DRibbonTrailRender *>(_renderer)->setMaxChainElements(val);
}
}
}
else if (prop->name == token[TOKEN_RIBBONTRAIL_LENGTH])
{
// Property: ribbontrail_length
if (passValidateProperty(compiler, prop, token[TOKEN_RIBBONTRAIL_MAX_ELEMENTS], VAL_REAL))
{
float val = 0;
if(getFloat(*prop->values.front(), &val))
{
static_cast<PUParticle3DRibbonTrailRender *>(_renderer)->setTrailLength(val);
}
}
}
else if (prop->name == token[TOKEN_RIBBONTRAIL_WIDTH])
{
// Property: ribbontrail_width
if (passValidateProperty(compiler, prop, token[TOKEN_RIBBONTRAIL_WIDTH], VAL_REAL))
{
float val = 0;
if(getFloat(*prop->values.front(), &val))
{
static_cast<PUParticle3DRibbonTrailRender *>(_renderer)->setTrailWidth(val);
}
}
}
else if (prop->name == token[TOKEN_RANDOM_INITIAL_COLOUR])
{
// Property: random_initial_colour
if (passValidateProperty(compiler, prop, token[TOKEN_RANDOM_INITIAL_COLOUR], VAL_BOOL))
{
bool val;
if(getBoolean(*prop->values.front(), &val))
{
static_cast<PUParticle3DRibbonTrailRender *>(_renderer)->setRandomInitialColor(val);
}
}
}
else if (prop->name == token[TOKEN_RIBBONTRAIL_RANDOM_INITIAL_COLOUR])
{
// Property: ribbontrail_random_initial_colour (deprecated and replaced by 'random_initial_colour'))
if (passValidateProperty(compiler, prop, token[TOKEN_RIBBONTRAIL_RANDOM_INITIAL_COLOUR], VAL_BOOL))
{
bool val;
if(getBoolean(*prop->values.front(), &val))
{
static_cast<PUParticle3DRibbonTrailRender *>(_renderer)->setRandomInitialColor(val);
}
}
}
else if (prop->name == token[TOKEN_INITIAL_COLOUR])
{
// Property: initial_colour
if (passValidateProperty(compiler, prop, token[TOKEN_INITIAL_COLOUR], VAL_COLOURVALUE))
{
Vec4 val;
if(getVector4(prop->values.begin(), prop->values.end(), &val))
{
static_cast<PUParticle3DRibbonTrailRender *>(_renderer)->setInitialColor(val);
}
}
}
else if (prop->name == token[TOKEN_RIBBONTRAIL_INITIAL_COLOUR])
{
// Property: ribbontrail_initial_colour (deprecated and replaced by 'initial_colour')
if (passValidateProperty(compiler, prop, token[TOKEN_RIBBONTRAIL_INITIAL_COLOUR], VAL_COLOURVALUE))
{
Vec4 val;
if(getVector4(prop->values.begin(), prop->values.end(), &val))
{
static_cast<PUParticle3DRibbonTrailRender *>(_renderer)->setInitialColor(val);
}
}
}
else if (prop->name == token[TOKEN_COLOUR_CHANGE])
{
// Property: colour_change
if (passValidateProperty(compiler, prop, token[TOKEN_COLOUR_CHANGE], VAL_COLOURVALUE))
{
Vec4 val;
if(getVector4(prop->values.begin(), prop->values.end(), &val))
{
static_cast<PUParticle3DRibbonTrailRender *>(_renderer)->setColorChange(val);
}
}
}
else if (prop->name == token[TOKEN_RIBBONTRAIL_COLOUR_CHANGE])
{
// Property: ribbontrail_colour_change (deprecated and replaced by 'colour_change')
if (passValidateProperty(compiler, prop, token[TOKEN_RIBBONTRAIL_COLOUR_CHANGE], VAL_COLOURVALUE))
{
Vec4 val;
if(getVector4(prop->values.begin(), prop->values.end(), &val))
{
static_cast<PUParticle3DRibbonTrailRender *>(_renderer)->setColorChange(val);
}
}
}
}
}
}
if (_renderer){
if (material){
_renderer->setDepthTest(material->depthTest);
_renderer->setDepthWrite(material->depthWrite);
static_cast<PUParticle3DRender *>(_renderer)->setRenderType(type);
}
system->setRender(_renderer);
}

View File

@ -27,6 +27,8 @@
#define __CC_PU_PARTICLE_3D_RENDERER_TRANSLATOR_H__
#include "extensions/Particle3D/ParticleUniverse/ParticleRenders/CCPUParticle3DRender.h"
#include "extensions/Particle3D/ParticleUniverse/ParticleRenders/CCPUParticle3DBeamRender.h"
#include "extensions/Particle3D/ParticleUniverse/ParticleRenders/CCPUParticle3DRibbonTrailRender.h"
#include "extensions/Particle3D/ParticleUniverse/CCPUParticle3DScriptTranslator.h"
#include "extensions/Particle3D/ParticleUniverse/CCPUParticle3DScriptCompiler.h"

View File

@ -236,12 +236,12 @@ const PUAbstractNodeList* PUScriptCompiler::compile(const std::string &file, boo
parser.parse(creteNodeList, tokenList);
bool state = compile(creteNodeList, file);
for (auto iter1 : creteNodeList){
delete iter1;
for (auto iter : creteNodeList){
delete iter;
}
for (auto iter2 : tokenList){
delete iter2;
for (auto iter : tokenList){
delete iter;
}
isFirstCompile = true;
@ -311,7 +311,7 @@ void PUScriptCompiler::visit(PUConcreteNode *node)
return;
}
PUObjectAbstractNode *impl = new (std::nothrow) PUObjectAbstractNode(_current);
PUObjectAbstractNode *impl = new (std::nothrow) PUObjectAbstractNode(_current);
impl->line = node->line;
impl->file = node->file;
impl->abstract = false;

View File

@ -22,7 +22,6 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCPUParticle3DScriptParser.h"
NS_CC_BEGIN
@ -49,7 +48,6 @@ void traceScriptParserCell(PUConcreteNodeList& nodes,int level)
}
}
//trace出scriptParser//
void traceScriptParser(PUConcreteNodeList& nodes)
{

View File

@ -22,7 +22,6 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCPUParticle3DScriptTranslator.h"
#include "extensions/Particle3D/ParticleUniverse/CCPUParticle3DTranslateManager.h"
@ -314,7 +313,7 @@ bool PUScriptTranslator::passValidatePropertyNoValues(PUScriptCompiler* compiler
{
if(prop->values.empty())
{
// compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, prop->file, prop->line, "PU Compiler: No values found for " + token + ".");
// compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, prop->file, prop->line, "PU Compiler: No values found for " + token2 + ".");
return false;
}
return true;
@ -327,10 +326,6 @@ bool PUScriptTranslator::passValidatePropertyNumberOfValues(PUScriptCompiler* co
{
if(prop->values.size() > numberOfValues)
{
// compiler->addError(ScriptCompiler::CE_FEWERPARAMETERSEXPECTED,
// prop->file,
// prop->line,
// "PU Compiler: " + token + " must have " + StringConverter::toString(numberOfValues) + " argument(s).");
return false;
}
return true;
@ -344,14 +339,6 @@ bool PUScriptTranslator::passValidatePropertyNumberOfValuesRange(PUScriptCompile
{
if(prop->values.size() < minNumberOfValues || prop->values.size() > maxNumberOfValues)
{
// compiler->addError(ScriptCompiler::CE_FEWERPARAMETERSEXPECTED,
// prop->file,
// prop->line,
// "PU Compiler: " + token + " must have between" +
// StringConverter::toString(minNumberOfValues) +
// " and " +
// StringConverter::toString(maxNumberOfValues) +
// " argument(s).");
return false;
}
return true;
@ -474,7 +461,7 @@ bool PUScriptTranslator::passValidatePropertyValidQuaternion(PUScriptCompiler* c
void PUScriptTranslator::errorUnexpectedToken(PUScriptCompiler* compiler,
PUAbstractNode* token2)
{
// CCLOGERROR("PU Compiler: token is not recognized tokenFile:%s tokenLine:%s",)
// CCLOGERROR("PU Compiler: token2 is not recognized tokenFile:%s tokenLine:%s",)
// printf()
// compiler->addError(ScriptCompiler::CE_UNEXPECTEDTOKEN, token.getPointer()->file, token.getPointer()->line,
// );

View File

@ -125,15 +125,15 @@ void PUParticle3DTechniqueTranslator::translate(PUScriptCompiler* compiler, PUAb
}
else if (prop->name == token[TOKEN_TECH_EMITTED_EMITTER_QUOTA])
{
//// Property: emitted_emitter_quota
//if (passValidateProperty(compiler, prop, token[TOKEN_TECH_EMITTED_EMITTER_QUOTA], VAL_UINT))
//{
// uint val = 0;
// if(getUInt(prop->values.front(), &val))
// {
// mTechnique->setEmittedEmitterQuota(val);
// }
//}
// Property: emitted_emitter_quota
if (passValidateProperty(compiler, prop, token[TOKEN_TECH_EMITTED_EMITTER_QUOTA], VAL_UINT))
{
unsigned int val = 0;
if(getUInt(*prop->values.front(), &val))
{
_system->setEmittedEmitterQuota(val);
}
}
}
else if (prop->name == token[TOKEN_TECH_EMITTED_AFFECTOR_QUOTA])
{
@ -149,15 +149,15 @@ void PUParticle3DTechniqueTranslator::translate(PUScriptCompiler* compiler, PUAb
}
else if (prop->name == token[TOKEN_TECH_EMITTED_TECHNIQUE_QUOTA])
{
//// Property: emitted_technique_quota
//if (passValidateProperty(compiler, prop, token[TOKEN_TECH_EMITTED_TECHNIQUE_QUOTA], VAL_UINT))
//{
// uint val = 0;
// if(getUInt(prop->values.front(), &val))
// {
// mTechnique->setEmittedTechniqueQuota(val);
// }
//}
// Property: emitted_technique_quota
if (passValidateProperty(compiler, prop, token[TOKEN_TECH_EMITTED_TECHNIQUE_QUOTA], VAL_UINT))
{
unsigned int val = 0;
if(getUInt(*prop->values.front(), &val))
{
_system->setEmittedSystemQuota(val);
}
}
}
else if (prop->name == token[TOKEN_TECH_EMITTED_SYSTEM_QUOTA])
{

View File

@ -85,21 +85,21 @@ PUScriptTranslator* PUParticle3DTranslateManager::getTranslator(PUAbstractNode *
// Parse Particle Affector
translator = &_affectorTranslator;
}
//else if(obj->cls == token[TOKEN_BEHAVIOUR] && parent && (parent->cls == token[TOKEN_TECHNIQUE] || parent->cls == token[TOKEN_ALIAS]))
//{
// // Parse Particle Behaviour
// translator = &mBehaviourTranslator;
//}
//else if(obj->cls == token[TOKEN_OBSERVER] && parent && (parent->cls == token[TOKEN_TECHNIQUE] || parent->cls == token[TOKEN_ALIAS]))
//{
// // Parse Particle Observer
// translator = &mObserverTranslator;
//}
//else if(obj->cls == token[TOKEN_HANDLER] && parent && (parent->cls == token[TOKEN_OBSERVER] || parent->cls == token[TOKEN_ALIAS]))
//{
// // Parse Particle Event Handler
// translator = &mParticleEventHandlerTranslator;
//}
else if(obj->cls == token[TOKEN_BEHAVIOUR] && parent && (parent->cls == token[TOKEN_TECHNIQUE] || parent->cls == token[TOKEN_ALIAS]))
{
// Parse Particle Behaviour
translator = &_behaviourTranslator;
}
else if(obj->cls == token[TOKEN_OBSERVER] && parent && (parent->cls == token[TOKEN_TECHNIQUE] || parent->cls == token[TOKEN_ALIAS]))
{
// Parse Particle Observer
translator = &_observerTranslator;
}
else if(obj->cls == token[TOKEN_HANDLER] && parent && (parent->cls == token[TOKEN_OBSERVER] || parent->cls == token[TOKEN_ALIAS]))
{
// Parse Particle Event Handler
translator = &_eventHandlerTranslator;
}
//else if(obj->cls == token[TOKEN_EXTERN] && parent && (parent->cls == token[TOKEN_TECHNIQUE] || parent->cls == token[TOKEN_ALIAS]))
//{
// // Parse Extern

View File

@ -27,15 +27,15 @@
#define __CC_PU_PARTICLE_3D_TRANSLATE_MANAGER_H__
#include "base/CCRef.h"
//#include "extensions/Particle3D/ParticleUniverse/Script/Translater/CCParticle3DSystemTranslator.h"
//#include "extensions/Particle3D/ParticleUniverse/Script/Translater/CCAliasTranslator.h"
//#include "extensions/Particle3D/ParticleUniverse/Script/Translater/CCParticle3DTechniqueTranslator.h"
#include "extensions/Particle3D/ParticleUniverse/CCPUParticleSystem3DTranslator.h"
#include "extensions/Particle3D/ParticleUniverse/CCPUParticle3DTechniqueTranslator.h"
#include "extensions/Particle3D/ParticleUniverse/CCPUParticle3DRendererTranslator.h"
#include "extensions/Particle3D/ParticleUniverse/CCPUParticle3DMaterialTranslator.h"
#include "extensions/Particle3D/ParticleUniverse/ParticleEmitters/CCPUParticle3DEmitterTranslator.h"
#include "extensions/Particle3D/ParticleUniverse/ParticleAffectors/CCPUParticle3DAffectorTranslator.h"
#include "extensions/Particle3D/ParticleUniverse/ParticleEventHandlers/CCPUParticle3DEventHandlerTranslator.h"
#include "extensions/Particle3D/ParticleUniverse/ParticleObservers/CCPUParticle3DObserverTranslator.h"
#include "extensions/Particle3D/ParticleUniverse/ParticleBehaviours/CCPUParticle3DBehaviourTranslator.h"
using namespace std;
NS_CC_BEGIN
@ -51,13 +51,15 @@ private:
PUParticle3DEmitterTranslator _emitterTranslator;
PUParticle3DAffectorTranslator _affectorTranslator;
PUParticle3DMaterialTranslator _materialTranslator;
PUParticle3DEventHandlerTranslator _eventHandlerTranslator;
PUParticle3DObserverTranslator _observerTranslator;
PUParticle3DBehaviourTranslator _behaviourTranslator;
//EmitterTranslator mEmitterTranslator;
//AffectorTranslator mAffectorTranslator;
//BehaviourTranslator mBehaviourTranslator;
//ObserverTranslator mObserverTranslator;
//ParticleEventHandlerTranslator mParticleEventHandlerTranslator;
//ExternTranslator mExternTranslator;
public:

File diff suppressed because it is too large Load Diff

View File

@ -38,16 +38,42 @@ NS_CC_BEGIN
/**
* 3d particle system
*/
class PUParticle3DListener;
class PUParticle3DObserver;
class PUParticle3DBehaviour;
class PUParticle3DEmitter;
class PUParticle3DAffector;
class Particle3DRender;
enum PUComponentType
{
CT_PARTICLE,
CT_SYSTEM,
CT_TECHNIQUE,
CT_EMITTER,
CT_AFFECTOR,
CT_OBSERVER
};
struct CC_DLL PUParticle3D : public Particle3D
{
static float DEFAULT_TTL;
static float DEFAULT_MASS;
PUParticle3D();
virtual ~PUParticle3D();
typedef std::vector<PUParticle3DBehaviour*> ParticleBehaviourList;
enum ParticleType
{
PT_VISUAL,
PT_TECHNIQUE,
PT_EMITTER,
PT_AFFECTOR,
PT_SYSTEM,
};
/** Enumeration which lists a number of reserved event flags. Although custom flags can be used to
indicate that a certain condition occurs, the first number of flags may not be used as custom flags.
*/
@ -58,10 +84,14 @@ struct CC_DLL PUParticle3D : public Particle3D
PEF_COLLIDED = 1<<2
};
Ref *particleEntityPtr;
PUParticle3DEmitter* parentEmitter;
Ref *visualData;
ParticleType particleType;
// Values that are assigned as soon as the particle is emitted (non-transformed)
Vec3 positionInWorld;
//Vec3 positionInWorld;
Vec3 originalPosition;
Vec3 latestPosition;
// Direction (and speed)
@ -82,7 +112,7 @@ struct CC_DLL PUParticle3D : public Particle3D
in 2D. */
float zRotationSpeed; //radian
Quaternion orientationInWorld;
//Quaternion orientationInWorld;
/*@remarks
The orientation of the particle is only visible if the Particle Renderer - such as the Box renderer -
supports orientation.
@ -98,6 +128,9 @@ struct CC_DLL PUParticle3D : public Particle3D
*/
float radius;
ParticleBehaviourList behaviours;
void copyBehaviours(const ParticleBehaviourList &list);
float calculateVelocity() const;
/** Set own dimensions
@ -106,6 +139,8 @@ struct CC_DLL PUParticle3D : public Particle3D
void calculateBoundingSphereRadius();
void initForEmission();
void initForExpiration(float timeElapsed);
void process(float timeElapsed);
/** Does this particle have it's own dimensions? */
bool ownDimensions;
@ -170,26 +205,34 @@ struct CC_DLL PUParticle3D : public Particle3D
float depthInView;//depth in camera view
float zRotation; //zRotation is used to rotate the particle in 2D (around the Z-axis) (radian)
float widthInWorld;
float heightInWorld;
float depthInWorld;
//float widthInWorld;
//float heightInWorld;
//float depthInWorld;
};
class CC_DLL PUParticleSystem3D : public ParticleSystem3D
{
public:
typedef std::map<std::string, ParticlePool> ParticlePoolMap;
static const float DEFAULT_WIDTH;
static const float DEFAULT_HEIGHT;
static const float DEFAULT_DEPTH;
static const unsigned short DEFAULT_PARTICLE_QUOTA;
static const unsigned int DEFAULT_PARTICLE_QUOTA;
static const unsigned int DEFAULT_EMITTED_EMITTER_QUOTA;
static const unsigned int DEFAULT_EMITTED_SYSTEM_QUOTA;
static const float DEFAULT_MAX_VELOCITY;
static PUParticleSystem3D* create();
static PUParticleSystem3D* create(const std::string &filePath);
static PUParticleSystem3D* create(const std::string &filePath, const std::string &materialPath);
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override;
virtual void update(float delta) override;
void forceUpdate(float delta);
/**
* particle system play control
@ -211,6 +254,8 @@ public:
*/
virtual void resumeParticleSystem() override;
virtual int getAliveParticleCount() const override;
/** Returns the velocity scale, defined in the particle system, but passed to the technique for convenience.
*/
float getParticleSystemScaleVelocity() const;
@ -255,12 +300,54 @@ public:
void setMaterialName(const std::string &name) { _matName = name; };
const std::string getMaterialName() const { return _matName; };
/** Forces emission of particles.
@remarks
The number of requested particles are the exact number that are emitted. No down-scalling is applied.
*/
void forceEmission(PUParticle3DEmitter* emitter, unsigned requested);
/**
* add particle affector
*/
void addEmitter(PUParticle3DEmitter* emitter);
virtual int getAliveParticleCount() const override;
PUParticle3DAffector* getAffector(const std::string &name);
PUParticle3DEmitter* getEmitter(const std::string &name);
void removeAllEmitter();
void addListener(PUParticle3DListener *listener);
void removeListener(PUParticle3DListener *listener);
void removeAllListener();
void addObserver(PUParticle3DObserver *observer);
PUParticle3DObserver* getObserver(const std::string &name);
void removerAllObserver();
void addBehaviourTemplate(PUParticle3DBehaviour *behaviour);
void removeAllBehaviourTemplate();
bool isMarkedForEmission() const {return _isMarkedForEmission;};
void setMarkedForEmission(bool isMarked) {_isMarkedForEmission = isMarked;};
void clearAllParticles();
unsigned int getEmittedEmitterQuota() const { return _emittedEmitterQuota; };
void setEmittedEmitterQuota(unsigned int quota) { _emittedEmitterQuota = quota; };
unsigned int getEmittedSystemQuota() const { return _emittedSystemQuota; };
void setEmittedSystemQuota(unsigned int quota) { _emittedSystemQuota = quota; };
PUParticleSystem3D* getParentParticleSystem()const { return _parentParticleSystem; };
const ParticlePoolMap& getEmittedEmitterParticlePool() const { return _emittedEmitterParticlePool; };
const ParticlePoolMap& getEmittedSystemParticlePool() const { return _emittedSystemParticlePool; };
bool makeParticleLocal(PUParticle3D* particle);
void calulateRotationOffset(void);
virtual PUParticleSystem3D* clone();
virtual void copyAttributesTo (PUParticleSystem3D* system);
CC_CONSTRUCTOR_ACCESS:
PUParticleSystem3D();
@ -274,6 +361,14 @@ protected:
void updator(float elapsedTime);
void postUpdator(float elapsedTime);
void emitParticles(float elapsedTime);
void executeEmitParticles(PUParticle3DEmitter* emitter, unsigned requested, float elapsedTime);
void emitParticles(ParticlePool &pool, PUParticle3DEmitter* emitter, unsigned requested, float elapsedTime);
void processParticle(ParticlePool &pool, bool &firstActiveParticle, bool &firstParticle, float elapsedTime);
void processMotion(PUParticle3D* particle, float timeElapsed, bool firstParticle);
void notifyRescaled(const Vec3 &scl);
void initParticleForEmission(PUParticle3D* particle);
void initParticleForExpiration(PUParticle3D* particle, float timeElapsed);
void forceStopParticleSystem();
inline bool isExpired(PUParticle3D* particle, float timeElapsed);
@ -283,8 +378,21 @@ protected:
protected:
std::vector<PUParticle3DEmitter*> _emitters;
std::vector<PUParticle3DObserver *> _observers;
ParticlePoolMap _emittedEmitterParticlePool;
ParticlePoolMap _emittedSystemParticlePool;
//EmitterPoolMap _emittedEmitters;
//SystemPoolMap _emittedSystems;
unsigned int _emittedEmitterQuota;
unsigned int _emittedSystemQuota;
//internal
PUParticle3D::ParticleBehaviourList _behaviourTemplates;
std::vector<PUParticle3DListener *> _listeners;
bool _prepared;
bool _poolPrepared;
float _particleSystemScaleVelocity;
float _timeElapsedSinceStart;
@ -315,6 +423,16 @@ protected:
bool _maxVelocitySet;
std::string _matName;
bool _isMarkedForEmission;
// Keep latest position
Vec3 _latestPositionDiff;
Vec3 _latestPosition;
Quaternion _latestOrientation;
PUParticleSystem3D *_parentParticleSystem;
};
NS_CC_END

View File

@ -39,7 +39,7 @@ public:
PUParticleSystem3DTranslator();
~PUParticleSystem3DTranslator();
void setParticleSystem3D(PUParticleSystem3D *pu) { _system = pu; };
void setParticleSystem3D(PUParticleSystem3D *pu) { _system = pu; };
virtual bool isParticleSystemTranslator() const override { return true; }

View File

@ -24,6 +24,7 @@
****************************************************************************/
#include "extensions/Particle3D/ParticleUniverse/ParticleAffectors/CCPUParticle3DAffector.h"
#include "extensions/Particle3D/ParticleUniverse/ParticleEmitters/CCPUParticle3DEmitter.h"
#include "extensions/Particle3D/ParticleUniverse/CCPUParticleSystem3D.h"
NS_CC_BEGIN
@ -41,11 +42,6 @@ PUParticle3DAffector::~PUParticle3DAffector()
_particleSystem = nullptr;
}
void PUParticle3DAffector::updateAffector(Particle3D *particle, float deltaTime)
{
updatePUAffector(static_cast<PUParticle3D*>(particle), deltaTime);
}
void PUParticle3DAffector::updatePUAffector(PUParticle3D* particle, float delta)
{
@ -61,9 +57,10 @@ const Vec3& PUParticle3DAffector::getDerivedPosition()
//_particleSystem->getNodeToWorldTransform().transformPoint(_position, &_derivedPosition);
}
else
_derivedPosition = Vec3::ZERO;
_derivedPosition = _position;
return _derivedPosition;
//if (mMarkedForEmission)
//{
// // Use the affector position, because it is emitted
@ -77,10 +74,6 @@ const Vec3& PUParticle3DAffector::getDerivedPosition()
// mParentTechnique->getParentSystem()->getDerivedOrientation() * (_mAffectorScale * position);
//}
//return _derivedPosition;
////incorrect result (FIXME)
//return _position;
}
float PUParticle3DAffector::calculateAffectSpecialisationFactor( const PUParticle3D* particle )
@ -191,4 +184,48 @@ float PUParticle3DAffector::getMass() const
return _mass;
}
void PUParticle3DAffector::copyAttributesTo( PUParticle3DAffector* affector )
{
affector->setName(_name);
affector->_isEnabled = _isEnabled;
affector->_particleSystem = _particleSystem;
affector->_affectorScale = _affectorScale;
affector->_affectSpecialisation = _affectSpecialisation;
}
void PUParticle3DAffector::addEmitterToExclude( const std::string& emitterName )
{
auto iter = std::find(_excludedEmitters.begin(), _excludedEmitters.end(), emitterName);
if (iter == _excludedEmitters.end()){
_excludedEmitters.push_back(emitterName);
}
}
void PUParticle3DAffector::removeEmitterToExclude( const std::string& emitterName )
{
auto iter = std::find(_excludedEmitters.begin(), _excludedEmitters.end(), emitterName);
if (iter != _excludedEmitters.end()){
_excludedEmitters.erase(iter);
}
}
void PUParticle3DAffector::process( PUParticle3D* particle, float delta, bool firstParticle )
{
if (firstParticle){
firstParticleUpdate(particle, delta);
}
if (!_excludedEmitters.empty() && particle->parentEmitter){
// Return if the emitter which emits this particle is part of the vector
std::string emitterName = particle->parentEmitter->getName();
auto iter = std::find(_excludedEmitters.begin(), _excludedEmitters.end(), emitterName);
if (iter != _excludedEmitters.end())
{
return;
}
}
updatePUAffector(particle, delta);
}
NS_CC_END

View File

@ -60,11 +60,11 @@ public:
virtual void prepare();
virtual void unPrepare();
virtual void preUpdateAffector(float deltaTime);
virtual void updateAffector(Particle3D *particle, float deltaTime);
virtual void updatePUAffector(PUParticle3D* particle, float delta);
virtual void postUpdateAffector(float deltaTime);
virtual void firstParticleUpdate(PUParticle3D *particle, float deltaTime);
virtual void initParticleForEmission(PUParticle3D* particle);
void process(PUParticle3D* particle, float delta, bool firstParticle);
void setLocalPosition(const Vec3 &pos) { _position = pos; };
const Vec3 getLocalPosition() const { return _position; };
@ -89,11 +89,22 @@ public:
const std::string& getAffectorType(void) const {return _affectorType;};
void setAffectorType(const std::string& affectorType) {_affectorType = affectorType;};
/** Add a ParticleEmitter name that excludes Particles emitted by this ParticleEmitter from being
affected.
*/
void addEmitterToExclude(const std::string& emitterName);
/** Remove a ParticleEmitter name that excludes Particles emitted by this ParticleEmitter.
*/
void removeEmitterToExclude(const std::string& emitterName);
/** Todo
*/
const std::string& getName(void) const {return _name;};
void setName(const std::string& name) {_name = name;};
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DAffector();
virtual ~PUParticle3DAffector();
@ -122,6 +133,8 @@ protected:
// Type of the affector
std::string _affectorType;
std::vector<std::string> _excludedEmitters;
// Name of the affector (optional)
std::string _name;

View File

@ -65,7 +65,8 @@ void PUParticle3DAffectorTranslator::translate(PUScriptCompiler* compiler, PUAbs
//}
_affector = PUParticle3DAffectorManager::Instance()->createAffector(type);
if (!_affector) return;
_affector->setAffectorType(type);
if (parent && parent->context)
{
PUParticleSystem3D* system = static_cast<PUParticleSystem3D*>(parent->context);
@ -150,22 +151,17 @@ void PUParticle3DAffectorTranslator::translate(PUScriptCompiler* compiler, PUAbs
}
else if (prop->name == token[TOKEN_AFFECTOR_EXCLUDE_EMITTER])
{
//if (passValidatePropertyNoValues(compiler, prop, token[TOKEN_AFFECTOR_EXCLUDE_EMITTER]))
//{
// for(AbstractNodeList::iterator j = prop->values.begin(); j != prop->values.end(); ++j)
// {
// String val;
// if(getString(*j, &val))
// {
// mAffector->addEmitterToExclude(val);
// }
// else
// {
// compiler->addError(ScriptCompiler::CE_NUMBEREXPECTED, prop->file, prop->line,
// "PU Compiler: Error in exclude_emitter arguments");
// }
// }
//}
if (passValidatePropertyNoValues(compiler, prop, token[TOKEN_AFFECTOR_EXCLUDE_EMITTER]))
{
for(PUAbstractNodeList::iterator j = prop->values.begin(); j != prop->values.end(); ++j)
{
std::string val;
if(getString(**j, &val))
{
_affector->addEmitterToExclude(val);
}
}
}
}
else if (particleAffectorTranlator->translateChildProperty(compiler, *i))
{

View File

@ -87,4 +87,12 @@ PUParticle3DAlignAffector* PUParticle3DAlignAffector::create()
return paa;
}
void PUParticle3DAlignAffector::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DAlignAffector* alignAffector = static_cast<PUParticle3DAlignAffector*>(affector);
alignAffector->_resize = _resize;
}
NS_CC_END

View File

@ -51,6 +51,8 @@ public:
*/
void setResize(bool resize);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DAlignAffector();
virtual ~PUParticle3DAlignAffector();

View File

@ -103,6 +103,9 @@ void PUParticle3DBaseCollider::populateAlignedBox( AABB& box, const Vec3& positi
void PUParticle3DBaseCollider::calculateRotationSpeedAfterCollision( PUParticle3D* particle )
{
if (particle->particleType != PUParticle3D::PT_VISUAL)
return;
float signedFriction = CCRANDOM_0_1() > 0.5 ? -(_friction - 1) : (_friction - 1);
particle->rotationSpeed *= signedFriction;
@ -115,4 +118,15 @@ void PUParticle3DBaseCollider::preUpdateAffector( float deltaTime )
_velocityScale = deltaTime * (static_cast<PUParticleSystem3D *>(_particleSystem))->getParticleSystemScaleVelocity();
}
void PUParticle3DBaseCollider::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DBaseCollider* baseCollider = static_cast<PUParticle3DBaseCollider*>(affector);
baseCollider->_bouncyness = _bouncyness;
baseCollider->_friction = _friction;
baseCollider->_intersectionType = _intersectionType;
baseCollider->_collisionType = _collisionType;
}
NS_CC_END

View File

@ -116,6 +116,8 @@ public:
*/
void calculateRotationSpeedAfterCollision(PUParticle3D* particle);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DBaseCollider();
virtual ~PUParticle3DBaseCollider();

View File

@ -65,4 +65,13 @@ void PUParticle3DBaseForceAffector::setForceApplication( ForceApplication forceA
_forceApplication = forceApplication;
}
void PUParticle3DBaseForceAffector::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DBaseForceAffector* baseForceAffector = static_cast<PUParticle3DBaseForceAffector*>(affector);
baseForceAffector->_forceVector = _forceVector;
baseForceAffector->_forceApplication = _forceApplication;
}
NS_CC_END

View File

@ -55,6 +55,8 @@ public:
ForceApplication getForceApplication() const;
void setForceApplication(ForceApplication forceApplication);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DBaseForceAffector();
virtual ~PUParticle3DBaseForceAffector();

View File

@ -245,6 +245,7 @@ void PUParticle3DBoxCollider::updatePUAffector( PUParticle3D *particle, float de
}
else
{
AABB box;
populateAlignedBox(box,
_predictedPosition,
particle->width,
@ -272,6 +273,7 @@ void PUParticle3DBoxCollider::updatePUAffector( PUParticle3D *particle, float de
void PUParticle3DBoxCollider::preUpdateAffector( float deltaTime )
{
PUParticle3DBaseCollider::preUpdateAffector(deltaTime);
// Calculate the affectors' center position in worldspace, set the box and calculate the bounds
// Applied scaling in V 1.3.1.
populateAlignedBox(_box, getDerivedPosition(), _affectorScale.x * _width, _affectorScale.y * _height, _affectorScale.z * _depth);
@ -285,4 +287,15 @@ PUParticle3DBoxCollider* PUParticle3DBoxCollider::create()
return pbc;
}
void PUParticle3DBoxCollider::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DBaseCollider::copyAttributesTo(affector);
PUParticle3DBoxCollider* boxCollider = static_cast<PUParticle3DBoxCollider*>(affector);
boxCollider->_width = _width;
boxCollider->_height = _height;
boxCollider->_depth = _depth;
boxCollider->_innerCollision = _innerCollision;
}
NS_CC_END

View File

@ -83,6 +83,8 @@ public:
*/
void calculateDirectionAfterCollision(PUParticle3D* particle);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DBoxCollider();
virtual ~PUParticle3DBoxCollider();

View File

@ -102,4 +102,11 @@ PUParticle3DCollisionAvoidanceAffector* PUParticle3DCollisionAvoidanceAffector::
return pcaa;
}
void PUParticle3DCollisionAvoidanceAffector::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DCollisionAvoidanceAffector* collisionAvoidanceAffector = static_cast<PUParticle3DCollisionAvoidanceAffector*>(affector);
collisionAvoidanceAffector->_radius = _radius;
}
NS_CC_END

View File

@ -49,6 +49,8 @@ public:
*/
void setRadius(float radius);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DCollisionAvoidanceAffector();
virtual ~PUParticle3DCollisionAvoidanceAffector();

View File

@ -132,4 +132,13 @@ PUParticle3DColorAffector* PUParticle3DColorAffector::create()
return pca;
}
void PUParticle3DColorAffector::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DColorAffector* colourAffector = static_cast<PUParticle3DColorAffector*>(affector);
colourAffector->_colorMap = _colorMap;
colourAffector->_colorOperation = _colorOperation;
}
NS_CC_END

View File

@ -70,6 +70,8 @@ public:
*/
void setColorOperation (const ColorOperation& colorOperation);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DColorAffector();
virtual ~PUParticle3DColorAffector();

View File

@ -73,4 +73,13 @@ PUParticle3DFlockCenteringAffector* PUParticle3DFlockCenteringAffector::create()
return pfca;
}
void PUParticle3DFlockCenteringAffector::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DFlockCenteringAffector* flockCenteringAffector = static_cast<PUParticle3DFlockCenteringAffector*>(affector);
flockCenteringAffector->_sum = _sum;
flockCenteringAffector->_average = _average;
flockCenteringAffector->_count = _count;
}
NS_CC_END

View File

@ -40,6 +40,8 @@ public:
virtual void preUpdateAffector(float deltaTime) override;
virtual void updatePUAffector(PUParticle3D *particle, float deltaTime) override;
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DFlockCenteringAffector();
virtual ~PUParticle3DFlockCenteringAffector();

View File

@ -322,4 +322,26 @@ PUParticle3DForceFieldAffector* PUParticle3DForceFieldAffector::create()
return pffa;
}
void PUParticle3DForceFieldAffector::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DForceFieldAffector* forceFieldAffector = static_cast<PUParticle3DForceFieldAffector*>(affector);
forceFieldAffector->_forceFieldType = _forceFieldType;
forceFieldAffector->_delta = _delta;
forceFieldAffector->_scaleForce = _scaleForce;
forceFieldAffector->_octaves = _octaves;
forceFieldAffector->_frequency = _frequency;
forceFieldAffector->_amplitude = _amplitude;
forceFieldAffector->_persistence = _persistence;
forceFieldAffector->_forceFieldSize = _forceFieldSize;
forceFieldAffector->_worldSize = _worldSize;
forceFieldAffector->_ignoreNegativeX = _ignoreNegativeX;
forceFieldAffector->_ignoreNegativeY = _ignoreNegativeY;
forceFieldAffector->_ignoreNegativeZ = _ignoreNegativeZ;
forceFieldAffector->_movementSet = _movementSet;
forceFieldAffector->_movementFrequency = _movementFrequency;
forceFieldAffector->_movement = _movement;
}
NS_CC_END

View File

@ -126,6 +126,8 @@ public:
*/
void suppressGeneration(bool suppress);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DForceFieldAffector();
~PUParticle3DForceFieldAffector();

View File

@ -170,6 +170,17 @@ PUParticle3DGeometryRotator* PUParticle3DGeometryRotator::create()
return pgr;
}
void PUParticle3DGeometryRotator::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DGeometryRotator* geometryRotator = static_cast<PUParticle3DGeometryRotator*>(affector);
geometryRotator->setRotationSpeed(getRotationSpeed()->clone());
geometryRotator->_useOwnRotationSpeed = _useOwnRotationSpeed;
geometryRotator->_rotationAxis = _rotationAxis;
geometryRotator->_rotationAxisSet = _rotationAxisSet;
}
//-----------------------------------------------------------------------
NS_CC_END

View File

@ -76,6 +76,8 @@ public:
*/
void resetRotationAxis(void);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DGeometryRotator();
virtual ~PUParticle3DGeometryRotator();

View File

@ -88,4 +88,12 @@ PUParticle3DGravityAffector* PUParticle3DGravityAffector::create()
return pga;
}
void PUParticle3DGravityAffector::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DGravityAffector* gravityAffector = static_cast<PUParticle3DGravityAffector*>(affector);
gravityAffector->_gravity = _gravity;
}
NS_CC_END

View File

@ -48,6 +48,8 @@ public:
float getGravity(void) const;
void setGravity(float gravity);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DGravityAffector(void);
virtual ~PUParticle3DGravityAffector(void);

View File

@ -175,4 +175,12 @@ PUParticle3DInterParticleCollider* PUParticle3DInterParticleCollider::create()
return pipc;
}
void PUParticle3DInterParticleCollider::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DBaseCollider::copyAttributesTo(affector);
PUParticle3DInterParticleCollider* interParticleCollider = static_cast<PUParticle3DInterParticleCollider*>(affector);
interParticleCollider->_adjustment = _adjustment;
interParticleCollider->_interParticleCollisionResponse = _interParticleCollisionResponse;
}
NS_CC_END

View File

@ -68,6 +68,8 @@ public:
*/
void setInterParticleCollisionResponse(InterParticleCollisionResponse interParticleCollisionResponse);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DInterParticleCollider(void);
virtual ~PUParticle3DInterParticleCollider(void);

View File

@ -82,4 +82,12 @@ PUParticle3DJetAffector* PUParticle3DJetAffector::create()
return pja;
}
void PUParticle3DJetAffector::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DJetAffector* jetAffector = static_cast<PUParticle3DJetAffector*>(affector);
jetAffector->setDynAcceleration(getDynAcceleration()->clone());
}
NS_CC_END

View File

@ -45,9 +45,11 @@ public:
/**
*/
//DynamicAttribute* getDynAcceleration(void) const {return _dynAcceleration;};
PUDynamicAttribute* getDynAcceleration(void) const {return _dynAcceleration;};
void setDynAcceleration(PUDynamicAttribute* dynAcceleration);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DJetAffector(void);
virtual ~PUParticle3DJetAffector(void);

View File

@ -103,7 +103,7 @@ void PUParticle3DLineAffector::notifyRescaled(const Vec3& scale)
//-----------------------------------------------------------------------
void PUParticle3DLineAffector::preUpdateAffector(float deltaTime)
{
if (/*technique->getNumberOfEmittedParticles()*/_particleSystem->getParticlePool().getActiveParticleList().size() > 0)
if (/*technique->getNumberOfEmittedParticles()*/static_cast<PUParticleSystem3D *>(_particleSystem)->getAliveParticleCount() > 0)
{
_timeSinceLastUpdate += deltaTime;
while (_timeSinceLastUpdate > _timeStep)
@ -164,4 +164,16 @@ PUParticle3DLineAffector* PUParticle3DLineAffector::create()
return pla;
}
void PUParticle3DLineAffector::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DLineAffector* lineAffector = static_cast<PUParticle3DLineAffector*>(affector);
lineAffector->setMaxDeviation(_maxDeviation);
lineAffector->_end = _end;
lineAffector->_timeStep = _timeStep;
lineAffector->_drift = _drift;
lineAffector->_oneMinusDrift = _oneMinusDrift;
}
NS_CC_END

View File

@ -70,6 +70,8 @@ public:
float getDrift(void) const;
void setDrift(float drift);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DLineAffector(void);
virtual ~PUParticle3DLineAffector(void);

View File

@ -62,4 +62,9 @@ PUParticle3DLinearForceAffector* PUParticle3DLinearForceAffector::create()
return plfa;
}
void PUParticle3DLinearForceAffector::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DBaseForceAffector::copyAttributesTo(affector);
}
NS_CC_END

View File

@ -41,6 +41,8 @@ public:
virtual void preUpdateAffector(float deltaTime) override;
virtual void updatePUAffector(PUParticle3D *particle, float deltaTime) override;
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DLinearForceAffector(void){};
virtual ~PUParticle3DLinearForceAffector(void){};

View File

@ -37,6 +37,9 @@ PUParticle3DLinearForceAffectorTranslator::PUParticle3DLinearForceAffectorTransl
//-------------------------------------------------------------------------
bool PUParticle3DLinearForceAffectorTranslator::translateChildProperty( PUScriptCompiler* compiler, PUAbstractNode *node )
{
PUPropertyAbstractNode* prop = reinterpret_cast<PUPropertyAbstractNode*>(node);
// PUParticle3DAffector* af = static_cast<PUParticle3DAffector*>(prop->parent->context);
// No own properties. Parse the BaseForceAffector
PUParticle3DBaseForceAffectorTranslator BaseForceAffectorTranslator;
return BaseForceAffectorTranslator.translateChildProperty(compiler, node);

View File

@ -104,4 +104,13 @@ PUParticle3DParticleFollower* PUParticle3DParticleFollower::create()
return ppf;
}
void PUParticle3DParticleFollower::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DParticleFollower* particleFollower = static_cast<PUParticle3DParticleFollower*>(affector);
particleFollower->_maxDistance = _maxDistance;
particleFollower->_minDistance = _minDistance;
}
NS_CC_END

View File

@ -54,6 +54,8 @@ public:
float getMinDistance(void) const;
void setMinDistance(float minDistance);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DParticleFollower(void);
virtual ~PUParticle3DParticleFollower(void);

View File

@ -75,4 +75,16 @@ PUParticle3DPathFollower* PUParticle3DPathFollower::create()
return ppf;
}
void PUParticle3DPathFollower::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DPathFollower* pathFollower = static_cast<PUParticle3DPathFollower*>(affector);
unsigned short numPoints = _spline.getNumPoints();
pathFollower->_spline.clear();
for (unsigned short i = 0; i < numPoints; ++i)
{
pathFollower->_spline.addPoint(_spline.getPoint(i));
}
}
NS_CC_END

View File

@ -56,6 +56,8 @@ public:
*/
const Vec3& getPoint(unsigned short index) const {return _spline.getPoint(index);};
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DPathFollower(void);
virtual ~PUParticle3DPathFollower(void);

View File

@ -22,7 +22,6 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCPUParticle3DPlaneCollider.h"
#include "extensions/Particle3D/ParticleUniverse/CCPUParticleSystem3D.h"
@ -174,4 +173,11 @@ PUParticle3DPlaneCollider* PUParticle3DPlaneCollider::create()
return ppc;
}
void PUParticle3DPlaneCollider::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DBaseCollider::copyAttributesTo(affector);
PUParticle3DPlaneCollider* planeCollider = static_cast<PUParticle3DPlaneCollider*>(affector);
planeCollider->setNormal(_normal);
}
NS_CC_END

View File

@ -39,7 +39,7 @@ public:
// Constants
static const Vec3 DEFAULT_NORMAL;
static PUParticle3DPlaneCollider* create();
static PUParticle3DPlaneCollider* create();
virtual void notifyRescaled(const Vec3& scale) override;
virtual void updatePUAffector(PUParticle3D *particle, float deltaTime) override;
@ -56,9 +56,11 @@ public:
*/
void calculateDirectionAfterCollision(PUParticle3D* particle, float timeElapsed);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DPlaneCollider(void);
virtual ~PUParticle3DPlaneCollider(void);
PUParticle3DPlaneCollider(void);
virtual ~PUParticle3DPlaneCollider(void);
protected:
Vec3 _normal;

View File

@ -103,7 +103,7 @@ void PUParticle3DRandomiser::setRandomDirection(bool randomDirection)
//-----------------------------------------------------------------------
void PUParticle3DRandomiser::preUpdateAffector(float deltaTime)
{
if (/*technique->getNumberOfEmittedParticles()*/_particleSystem->getParticlePool().getActiveParticleList().size() > 0)
if (/*technique->getNumberOfEmittedParticles()*/static_cast<PUParticleSystem3D *>(_particleSystem)->getAliveParticleCount() > 0)
{
_timeSinceLastUpdate += deltaTime;
if (_timeSinceLastUpdate > _timeStep)
@ -156,4 +156,16 @@ PUParticle3DRandomiser* PUParticle3DRandomiser::create()
return pr;
}
void PUParticle3DRandomiser::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DRandomiser* randomiser = static_cast<PUParticle3DRandomiser*>(affector);
randomiser->_maxDeviationX = _maxDeviationX;
randomiser->_maxDeviationY = _maxDeviationY;
randomiser->_maxDeviationZ = _maxDeviationZ;
randomiser->setTimeStep(_timeStep); // Also sets time since last update to appropriate value
randomiser->_randomDirection = _randomDirection;
}
NS_CC_END

View File

@ -70,6 +70,8 @@ public:
bool isRandomDirection(void) const;
void setRandomDirection(bool randomDirection);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DRandomiser(void);
virtual ~PUParticle3DRandomiser(void);

View File

@ -265,4 +265,20 @@ PUParticle3DScaleAffector* PUParticle3DScaleAffector::create()
return psa;
}
void PUParticle3DScaleAffector::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DScaleAffector* scaleAffector = static_cast<PUParticle3DScaleAffector*>(affector);
scaleAffector->setDynScaleX(getDynScaleX()->clone());
scaleAffector->setDynScaleY(getDynScaleY()->clone());
scaleAffector->setDynScaleZ(getDynScaleZ()->clone());
scaleAffector->setDynScaleXYZ(getDynScaleXYZ()->clone());
scaleAffector->_dynScaleXSet = _dynScaleXSet;
scaleAffector->_dynScaleYSet = _dynScaleYSet;
scaleAffector->_dynScaleZSet = _dynScaleZSet;
scaleAffector->_dynScaleXYZSet = _dynScaleXYZSet;
scaleAffector->_sinceStartSystem = _sinceStartSystem;
}
NS_CC_END

View File

@ -75,6 +75,8 @@ public:
bool isSinceStartSystem(void) const {return _sinceStartSystem;};
void setSinceStartSystem(bool sinceStartSystem){_sinceStartSystem = sinceStartSystem;};
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DScaleAffector(void);
virtual ~PUParticle3DScaleAffector(void);

View File

@ -111,4 +111,14 @@ PUParticle3DScaleVelocityAffector* PUParticle3DScaleVelocityAffector::create()
return psva;
}
void PUParticle3DScaleVelocityAffector::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DScaleVelocityAffector* scaleVelocityAffector = static_cast<PUParticle3DScaleVelocityAffector*>(affector);
scaleVelocityAffector->setDynScaleVelocity(getDynScaleVelocity()->clone());
scaleVelocityAffector->_sinceStartSystem = _sinceStartSystem;
scaleVelocityAffector->_stopAtFlip = _stopAtFlip;
}
NS_CC_END

View File

@ -59,6 +59,8 @@ public:
bool isStopAtFlip(void) const {return _stopAtFlip;};
void setStopAtFlip(bool stopAtFlip){_stopAtFlip = stopAtFlip;};
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DScaleVelocityAffector(void);
virtual ~PUParticle3DScaleVelocityAffector(void);

View File

@ -22,7 +22,6 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCPUParticle3DScaleVelocityAffectorTranslator.h"
#include "extensions/Particle3D/ParticleUniverse/CCPUParticleSystem3D.h"
#include "extensions/Particle3D/ParticleUniverse/CCPUParticle3DDynamicAttribute.h"

View File

@ -113,4 +113,15 @@ PUParticle3DSineForceAffector* PUParticle3DSineForceAffector::create()
return psfa;
}
void PUParticle3DSineForceAffector::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DSineForceAffector* sineForceAffector = static_cast<PUParticle3DSineForceAffector*>(affector);
sineForceAffector->_frequencyMin = _frequencyMin;
sineForceAffector->_frequencyMax = _frequencyMax;
sineForceAffector->_frequency = _frequency;
sineForceAffector->_angle = _angle;
}
NS_CC_END

View File

@ -54,6 +54,8 @@ public:
const float getFrequencyMax(void) const;
void setFrequencyMax(const float frequencyMax);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DSineForceAffector(void);
virtual ~PUParticle3DSineForceAffector(void);

View File

@ -199,4 +199,14 @@ PUParticle3DSphereCollider* PUParticle3DSphereCollider::create()
return psc;
}
void PUParticle3DSphereCollider::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DSphereCollider* sphereCollider = static_cast<PUParticle3DSphereCollider*>(affector);
sphereCollider->_radius = _radius;
sphereCollider->_sphere = _sphere;
sphereCollider->_innerCollision = _innerCollision;
}
NS_CC_END

View File

@ -68,6 +68,8 @@ public:
*/
void calculateDirectionAfterCollision(PUParticle3D* particle, Vec3 distance, float distanceLength);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DSphereCollider(void);
virtual ~PUParticle3DSphereCollider(void);

View File

@ -255,4 +255,16 @@ PUParticle3DTextureAnimator* PUParticle3DTextureAnimator::create()
return pta;
}
void PUParticle3DTextureAnimator::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DTextureAnimator* textureAnimator = static_cast<PUParticle3DTextureAnimator*>(affector);
textureAnimator->_animationTimeStep = _animationTimeStep;
textureAnimator->_animationTimeStepSet = _animationTimeStepSet;
textureAnimator->_textureAnimationType = _textureAnimationType;
textureAnimator->_textureCoordsStart = _textureCoordsStart;
textureAnimator->_textureCoordsEnd = _textureCoordsEnd;
textureAnimator->_startRandom = _startRandom;
}
NS_CC_END

View File

@ -85,6 +85,8 @@ public:
/** Todo */
void setStartRandom(bool startRandom);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DTextureAnimator(void);
virtual ~PUParticle3DTextureAnimator(void);

View File

@ -162,4 +162,14 @@ PUParticle3DTextureRotator* PUParticle3DTextureRotator::create()
return ptr;
}
void PUParticle3DTextureRotator::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DTextureRotator* textureRotator = static_cast<PUParticle3DTextureRotator*>(affector);
textureRotator->setRotation(getRotation()->clone());
textureRotator->setRotationSpeed(getRotationSpeed()->clone());
textureRotator->_useOwnRotationSpeed = _useOwnRotationSpeed;
}
NS_CC_END

View File

@ -81,6 +81,8 @@ public:
/** @copydoc ParticleAffector::_initParticleForEmission */
virtual void initParticleForEmission(PUParticle3D* particle);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DTextureRotator(void);
virtual ~PUParticle3DTextureRotator(void);

View File

@ -117,4 +117,11 @@ PUParticle3DVelocityMatchingAffector* PUParticle3DVelocityMatchingAffector::crea
return pvma;
}
void PUParticle3DVelocityMatchingAffector::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DVelocityMatchingAffector* velocityMatchingAffector = static_cast<PUParticle3DVelocityMatchingAffector*>(affector);
velocityMatchingAffector->_radius = _radius;
}
NS_CC_END

View File

@ -49,6 +49,8 @@ public:
*/
void setRadius(float radius);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
/** @copydoc ParticleAffector::_prepare */
//virtual void _prepare(ParticleTechnique* particleTechnique);

View File

@ -123,4 +123,14 @@ PUParticle3DVortexAffector* PUParticle3DVortexAffector::create()
return pvf;
}
void PUParticle3DVortexAffector::copyAttributesTo( PUParticle3DAffector* affector )
{
PUParticle3DAffector::copyAttributesTo(affector);
PUParticle3DVortexAffector* vortexAffector = static_cast<PUParticle3DVortexAffector*>(affector);
vortexAffector->_rotation = _rotation;
vortexAffector->_rotationVector = _rotationVector;
vortexAffector->setRotationSpeed(getRotationSpeed()->clone());
}
NS_CC_END

View File

@ -60,6 +60,8 @@ public:
*/
void setRotationSpeed(PUDynamicAttribute* dynRotationSpeed);
virtual void copyAttributesTo (PUParticle3DAffector* affector);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DVortexAffector(void);
virtual ~PUParticle3DVortexAffector(void);

View File

@ -0,0 +1,58 @@
/****************************************************************************
Copyright (C) 2013 Henry van Merode. All rights reserved.
Copyright (c) 2015 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "extensions/Particle3D/ParticleUniverse/ParticleBehaviours/CCPUParticle3DBehaviour.h"
#include "base/ccMacros.h"
NS_CC_BEGIN
PUParticle3DBehaviour::PUParticle3DBehaviour( void ):
_particleSystem(nullptr),
_behaviourScale(Vec3::ONE)
{
}
PUParticle3DBehaviour::~PUParticle3DBehaviour( void )
{
}
PUParticle3DBehaviour* PUParticle3DBehaviour::clone()
{
auto pb = new (std::nothrow) PUParticle3DBehaviour;
pb->autorelease();
copyAttributesTo(pb);
return pb;
}
void PUParticle3DBehaviour::copyAttributesTo( PUParticle3DBehaviour* behaviour )
{
behaviour->_particleSystem = _particleSystem;
behaviour->_behaviourType = _behaviourType;
behaviour->_behaviourScale = _behaviourScale;
}
NS_CC_END

View File

@ -0,0 +1,87 @@
/****************************************************************************
Copyright (C) 2013 Henry van Merode. All rights reserved.
Copyright (c) 2015 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __CC_PU_PARTICLE_3D_BEHAVIOUR_H__
#define __CC_PU_PARTICLE_3D_BEHAVIOUR_H__
#include "base/CCRef.h"
#include "math/CCMath.h"
#include "extensions/Particle3D/ParticleUniverse/CCPUParticleSystem3D.h"
#include <vector>
#include <string>
NS_CC_BEGIN
struct PUParticle3D;
class PUParticleSystem3D;
class CC_DLL PUParticle3DBehaviour : public Ref
{
friend class PUParticleSystem3D;
public:
/** Todo
*/
const std::string& getBehaviourType(void) const {return _behaviourType;};
void setBehaviourType(const std::string& behaviourType) {_behaviourType = behaviourType;};
/** Notify that the Behaviour is rescaled.
*/
virtual void notifyRescaled(const Vec3& scale){_behaviourScale = scale;};
virtual void prepare() {};
virtual void unPrepare() {};
virtual void updateBehaviour(PUParticle3D *particle, float deltaTime) {};
/** Perform initialising activities as soon as the particle with which the ParticleBehaviour is
associated, is emitted.
*/
virtual void initParticleForEmission(PUParticle3D* particle){/* No implementation */};
/** Perform some action if a particle expires.
*/
virtual void initParticleForExpiration(PUParticle3D* particle, float timeElapsed){/* No implementation */};
virtual PUParticle3DBehaviour* clone();
virtual void copyAttributesTo (PUParticle3DBehaviour* behaviour);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DBehaviour(void);
virtual ~PUParticle3DBehaviour(void);
protected:
PUParticleSystem3D* _particleSystem;
// Type of behaviour
std::string _behaviourType;
/** Although the scale is on a Particle System level, the behaviour can also be scaled.
*/
Vec3 _behaviourScale;
};
NS_CC_END
#endif

View File

@ -0,0 +1,62 @@
/****************************************************************************
Copyright (C) 2013 Henry van Merode. All rights reserved.
Copyright (c) 2015 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCPUParticle3DBehaviourManager.h"
#include "extensions/Particle3D/ParticleUniverse/ParticleBehaviours/CCPUParticle3DSlaveBehaviour.h"
NS_CC_BEGIN
PUParticle3DBehaviourManager::PUParticle3DBehaviourManager()
{
}
PUParticle3DBehaviourManager::~PUParticle3DBehaviourManager()
{
}
PUParticle3DBehaviourManager* PUParticle3DBehaviourManager::Instance()
{
static PUParticle3DBehaviourManager pam;
return &pam;
}
PUScriptTranslator* PUParticle3DBehaviourManager::getTranslator( const std::string &type )
{
if (type == "Slave"){
return &_slaveBehaviourTranslator;
}
return nullptr;
}
PUParticle3DBehaviour* PUParticle3DBehaviourManager::createBehaviour( const std::string &type )
{
if (type == "Slave"){
return PUParticle3DSlaveBehaviour::create();
}
return nullptr;
}
NS_CC_END

View File

@ -0,0 +1,61 @@
/****************************************************************************
Copyright (C) 2013 Henry van Merode. All rights reserved.
Copyright (c) 2015 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __CC_PU_PARTICLE_3D_BEHAVIOUR_MANAGER_H__
#define __CC_PU_PARTICLE_3D_BEHAVIOUR_MANAGER_H__
#include "base/CCRef.h"
#include "extensions/Particle3D/ParticleUniverse/CCPUParticle3DScriptTranslator.h"
#include "extensions/Particle3D/ParticleUniverse/ParticleBehaviours/CCPUParticle3DBehaviour.h"
#include "extensions/Particle3D/ParticleUniverse/ParticleBehaviours/CCPUParticle3DSlaveBehaviourTranslator.h"
using namespace std;
NS_CC_BEGIN
class PUParticle3DBehaviourManager
{
public:
static PUParticle3DBehaviourManager* Instance();
/**
*/
PUScriptTranslator* getTranslator(const std::string &type);
PUParticle3DBehaviour* createBehaviour(const std::string &type);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DBehaviourManager();
~PUParticle3DBehaviourManager();
protected:
PUParticle3DSlaveBehaviourTranslator _slaveBehaviourTranslator;
};
NS_CC_END
#endif

View File

@ -0,0 +1,123 @@
/****************************************************************************
Copyright (C) 2013 Henry van Merode. All rights reserved.
Copyright (c) 2015 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCPUParticle3DBehaviourTranslator.h"
#include "extensions/Particle3D/ParticleUniverse/CCPUParticleSystem3D.h"
#include "extensions/Particle3D/ParticleUniverse/ParticleBehaviours/CCPUParticle3DBehaviourManager.h"
NS_CC_BEGIN
PUParticle3DBehaviourTranslator::PUParticle3DBehaviourTranslator()
:_behaviour(nullptr)
{
}
//-------------------------------------------------------------------------
void PUParticle3DBehaviourTranslator::translate(PUScriptCompiler* compiler, PUAbstractNode *node)
{
PUObjectAbstractNode* obj = reinterpret_cast<PUObjectAbstractNode*>(node);
PUObjectAbstractNode* parent = obj->parent ? reinterpret_cast<PUObjectAbstractNode*>(obj->parent) : 0;
// The name of the obj is the type of the Behaviour
std::string type;
if(!obj->name.empty())
{
type = obj->name;
}
else
{
//compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, obj->file, obj->line);
return;
}
//// Get the factory
//ParticleBehaviourFactory* behaviourFactory = ParticleSystemManager::getSingletonPtr()->getBehaviourFactory(type);
//if (!behaviourFactory)
//{
// //compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, obj->file, obj->line);
// return;
//}
PUScriptTranslator *particleBehaviourTranlator = PUParticle3DBehaviourManager::Instance()->getTranslator(type);
if (!particleBehaviourTranlator) return;
// Create the Behaviour
_behaviour = PUParticle3DBehaviourManager::Instance()->createBehaviour(type);
if (!_behaviour)
{
//compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, obj->file, obj->line);
return;
}
_behaviour->setBehaviourType(type);
if (parent && parent->context)
{
PUParticleSystem3D* system = static_cast<PUParticleSystem3D*>(parent->context);
system->addBehaviourTemplate(_behaviour);
}
else
{
//// It is an alias
//_behaviour->setAliasName(parent->name);
//ParticleSystemManager::getSingletonPtr()->addAlias(mBehaviour);
}
// Set it in the context
obj->context = _behaviour;
// Run through properties
for(PUAbstractNodeList::iterator i = obj->children.begin(); i != obj->children.end(); ++i)
{
// No properties of its own
if((*i)->type == ANT_PROPERTY)
{
PUPropertyAbstractNode* prop = reinterpret_cast<PUPropertyAbstractNode*>((*i));
if (particleBehaviourTranlator->translateChildProperty(compiler, *i))
{
// Parsed the property by another translator; do nothing
}
else
{
errorUnexpectedProperty(compiler, prop);
}
}
else if((*i)->type == ANT_OBJECT)
{
if (particleBehaviourTranlator->translateChildObject(compiler, *i))
{
// Parsed the object by another translator; do nothing
}
else
{
processNode(compiler, *i);
}
}
else
{
errorUnexpectedToken(compiler, *i);
}
}
}
NS_CC_END

View File

@ -0,0 +1,49 @@
/****************************************************************************
Copyright (C) 2013 Henry van Merode. All rights reserved.
Copyright (c) 2015 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __CC_PU_PARTICLE_3D_BEHAVIOUR_TRANSLATOR_H__
#define __CC_PU_PARTICLE_3D_BEHAVIOUR_TRANSLATOR_H__
#include "extensions/Particle3D/ParticleUniverse/CCPUParticle3DScriptTranslator.h"
#include "extensions/Particle3D/ParticleUniverse/CCPUParticle3DScriptCompiler.h"
#include "extensions/Particle3D/ParticleUniverse/ParticleBehaviours/CCPUParticle3DBehaviour.h"
NS_CC_BEGIN
class PUParticle3DBehaviourTranslator : public PUScriptTranslator
{
protected:
PUParticle3DBehaviour* _behaviour;
public:
PUParticle3DBehaviourTranslator();
virtual ~PUParticle3DBehaviourTranslator(){};
virtual void translate(PUScriptCompiler* compiler, PUAbstractNode *node);
};
NS_CC_END
#endif /* defined(__cocos2d_libs__CCParticle3DAffectorTranslator__) */

View File

@ -0,0 +1,70 @@
/****************************************************************************
Copyright (C) 2013 Henry van Merode. All rights reserved.
Copyright (c) 2015 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "extensions/Particle3D/ParticleUniverse/ParticleBehaviours/CCPUParticle3DSlaveBehaviour.h"
#include "base/ccMacros.h"
NS_CC_BEGIN
PUParticle3DSlaveBehaviour::PUParticle3DSlaveBehaviour()
: masterParticle(nullptr)
{
}
PUParticle3DSlaveBehaviour::~PUParticle3DSlaveBehaviour()
{
}
void PUParticle3DSlaveBehaviour::updateBehaviour( PUParticle3D *particle, float deltaTime )
{
if (masterParticle && !masterParticle->hasEventFlags(PUParticle3D::PEF_EXPIRED))
{
particle->position = masterParticle->position;
particle->direction = masterParticle->direction;
}
}
PUParticle3DSlaveBehaviour* PUParticle3DSlaveBehaviour::clone()
{
auto pb = PUParticle3DSlaveBehaviour::create();
copyAttributesTo(pb);
return pb;
}
PUParticle3DSlaveBehaviour* PUParticle3DSlaveBehaviour::create()
{
auto pb = new PUParticle3DSlaveBehaviour();
pb->autorelease();
return pb;
}
void PUParticle3DSlaveBehaviour::copyAttributesTo( PUParticle3DBehaviour* behaviour )
{
PUParticle3DBehaviour::copyAttributesTo(behaviour);
}
NS_CC_END

View File

@ -0,0 +1,63 @@
/****************************************************************************
Copyright (C) 2013 Henry van Merode. All rights reserved.
Copyright (c) 2015 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __CC_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_H__
#define __CC_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_H__
#include "base/CCRef.h"
#include "math/CCMath.h"
#include "extensions/Particle3D/ParticleUniverse/CCPUParticleSystem3D.h"
#include "extensions/Particle3D/ParticleUniverse/ParticleBehaviours/CCPUParticle3DBehaviour.h"
#include <vector>
#include <string>
NS_CC_BEGIN
struct PUParticle3D;
class PUParticleSystem3D;
class CC_DLL PUParticle3DSlaveBehaviour : public PUParticle3DBehaviour
{
public:
static PUParticle3DSlaveBehaviour* create();
PUParticle3D* masterParticle;
/** See ParticleBehaviour.
*/
virtual void updateBehaviour(PUParticle3D *particle, float deltaTime);
virtual PUParticle3DSlaveBehaviour* clone() override;
virtual void copyAttributesTo (PUParticle3DBehaviour* behaviour);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DSlaveBehaviour();
virtual ~PUParticle3DSlaveBehaviour();
};
NS_CC_END
#endif

View File

@ -0,0 +1,45 @@
/****************************************************************************
Copyright (C) 2013 Henry van Merode. All rights reserved.
Copyright (c) 2015 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCPUParticle3DSlaveBehaviourTranslator.h"
#include "extensions/Particle3D/ParticleUniverse/CCPUParticleSystem3D.h"
#include "extensions/Particle3D/ParticleUniverse/ParticleBehaviours/CCPUParticle3DBehaviourManager.h"
NS_CC_BEGIN
PUParticle3DSlaveBehaviourTranslator::PUParticle3DSlaveBehaviourTranslator()
{
}
bool PUParticle3DSlaveBehaviourTranslator::translateChildProperty( PUScriptCompiler* compiler, PUAbstractNode *node )
{
return false;
}
bool PUParticle3DSlaveBehaviourTranslator::translateChildObject( PUScriptCompiler* compiler, PUAbstractNode *node )
{
return false;
}
NS_CC_END

View File

@ -0,0 +1,47 @@
/****************************************************************************
Copyright (C) 2013 Henry van Merode. All rights reserved.
Copyright (c) 2015 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __CC_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_TRANSLATOR_H__
#define __CC_PU_PARTICLE_3D_SLAVE_BEHAVIOUR_TRANSLATOR_H__
#include "extensions/Particle3D/ParticleUniverse/CCPUParticle3DScriptTranslator.h"
#include "extensions/Particle3D/ParticleUniverse/CCPUParticle3DScriptCompiler.h"
#include "extensions/Particle3D/ParticleUniverse/ParticleBehaviours/CCPUParticle3DSlaveBehaviour.h"
NS_CC_BEGIN
class PUParticle3DSlaveBehaviourTranslator : public PUScriptTranslator
{
public:
PUParticle3DSlaveBehaviourTranslator();
virtual ~PUParticle3DSlaveBehaviourTranslator(){};
virtual bool translateChildProperty(PUScriptCompiler* compiler, PUAbstractNode *node);
virtual bool translateChildObject(PUScriptCompiler* compiler, PUAbstractNode *node);
};
NS_CC_END
#endif /* defined(__cocos2d_libs__CCParticle3DAffectorTranslator__) */

View File

@ -112,4 +112,24 @@ PUParticle3DBoxEmitter* PUParticle3DBoxEmitter::create()
return pe;
}
void PUParticle3DBoxEmitter::copyAttributesTo( PUParticle3DEmitter* emitter )
{
PUParticle3DEmitter::copyAttributesTo(emitter);
PUParticle3DBoxEmitter* boxEmitter = static_cast<PUParticle3DBoxEmitter*>(emitter);
boxEmitter->_height = _height;
boxEmitter->_width = _width;
boxEmitter->_depth = _depth;
boxEmitter->_xRange = _xRange;
boxEmitter->_yRange = _yRange;
boxEmitter->_zRange = _zRange;
}
PUParticle3DBoxEmitter* PUParticle3DBoxEmitter::clone()
{
auto be = PUParticle3DBoxEmitter::create();
copyAttributesTo(be);
return be;
}
NS_CC_END

View File

@ -56,6 +56,9 @@ public:
const float getDepth(void) const;
void setDepth(const float depth);
virtual PUParticle3DBoxEmitter* clone();
virtual void copyAttributesTo (PUParticle3DEmitter* emitter);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DBoxEmitter(void);
virtual ~PUParticle3DBoxEmitter(void) {};

View File

@ -1,6 +1,6 @@
/****************************************************************************
Copyright (C) 2013 Henry van Merode. All rights reserved.
Copyright (c) 2014 Chukong Technologies Inc.
Copyright (c) 2015 Chukong Technologies Inc.
http://www.cocos2d-x.org

View File

@ -247,4 +247,25 @@ cocos2d::Quaternion PUParticle3DCircleEmitter::getRotationTo( const Vec3 &src, c
return q;
}
void PUParticle3DCircleEmitter::copyAttributesTo( PUParticle3DEmitter* emitter )
{
PUParticle3DEmitter::copyAttributesTo(emitter);
PUParticle3DCircleEmitter* circleEmitter = static_cast<PUParticle3DCircleEmitter*>(emitter);
circleEmitter->_radius = _radius;
circleEmitter->_circleAngle = _circleAngle;
circleEmitter->_originalCircleAngle = _originalCircleAngle;
circleEmitter->_step = _step;
circleEmitter->_random = _random;
circleEmitter->_normal = _normal;
circleEmitter->_orientation = _orientation;
}
PUParticle3DCircleEmitter* PUParticle3DCircleEmitter::clone()
{
auto be = PUParticle3DCircleEmitter::create();
copyAttributesTo(be);
return be;
}
NS_CC_END

View File

@ -73,6 +73,9 @@ public:
*/
virtual void notifyStart(void) override;
virtual PUParticle3DCircleEmitter* clone();
virtual void copyAttributesTo (PUParticle3DEmitter* emitter);
CC_CONSTRUCTOR_ACCESS:
PUParticle3DCircleEmitter(void);
virtual ~PUParticle3DCircleEmitter(void) {};

Some files were not shown because too many files have changed in this diff Show More