2015-02-11 18:14:22 +08:00
|
|
|
/****************************************************************************
|
2015-02-25 18:05:41 +08:00
|
|
|
Copyright (C) 2013 Henry van Merode. All rights reserved.
|
2018-01-29 16:25:32 +08:00
|
|
|
Copyright (c) 2015-2016 Chukong Technologies Inc.
|
|
|
|
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2022-07-09 22:23:34 +08:00
|
|
|
https://axis-project.github.io/
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2015-02-11 18:14:22 +08:00
|
|
|
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:
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2015-02-11 18:14:22 +08:00
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2015-02-11 18:14:22 +08:00
|
|
|
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.
|
|
|
|
****************************************************************************/
|
|
|
|
|
2022-07-15 19:17:01 +08:00
|
|
|
#ifndef __AX_PU_PARTICLE_3D_VERTEX_EMITTER_H__
|
|
|
|
#define __AX_PU_PARTICLE_3D_VERTEX_EMITTER_H__
|
2015-02-11 18:14:22 +08:00
|
|
|
|
2015-03-05 13:24:06 +08:00
|
|
|
#include "extensions/Particle3D/PU/CCPUEmitter.h"
|
2015-02-11 18:14:22 +08:00
|
|
|
#include <list>
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
// Particle3DVertexEmitter NOT SUPPORT YET
|
2022-07-11 17:50:21 +08:00
|
|
|
NS_AX_BEGIN
|
2015-02-11 18:14:22 +08:00
|
|
|
//
|
2021-12-25 10:04:45 +08:00
|
|
|
// class Particle3DVertexEmitter : public PUEmitter
|
2015-02-11 18:14:22 +08:00
|
|
|
//{
|
2021-12-25 10:04:45 +08:00
|
|
|
// protected:
|
2015-02-11 18:14:22 +08:00
|
|
|
//
|
|
|
|
// std::list<Vec3> mSpawnPositionList;
|
|
|
|
// const Ogre::VertexElement* mPositionElement;
|
|
|
|
// Ogre::VertexData* mVertexData;
|
|
|
|
// Ogre::HardwareVertexBufferSharedPtr mBuffer;
|
|
|
|
// unsigned char* mVertexBuffer;
|
|
|
|
// Ogre::Mesh* mMesh;
|
|
|
|
// Ogre::SubMesh* mSubMesh;
|
|
|
|
// bool mMeshProcessed;
|
|
|
|
// size_t mVertexSize;
|
|
|
|
// size_t mMaxVertexCount;
|
|
|
|
// size_t mVertexCount;
|
|
|
|
// unsigned short mSubMeshNumber;
|
|
|
|
// bool mAllVerticesProcessed;
|
|
|
|
//
|
|
|
|
// /** Determines the size of the steps that are used to traverse through the vertices.
|
|
|
|
// */
|
|
|
|
// unsigned short mStep;
|
2021-12-25 10:04:45 +08:00
|
|
|
//
|
2015-02-11 18:14:22 +08:00
|
|
|
// /** Determines in how many segments an edge is divided. This results in spawn points.
|
|
|
|
// */
|
|
|
|
// unsigned short mSegments;
|
|
|
|
//
|
|
|
|
// /** Defines the speed of generating spawnpoints. In each Particle Technique update
|
|
|
|
// 'mIterations' vertices are traversed.
|
|
|
|
// @remarks
|
2015-12-11 23:37:58 +08:00
|
|
|
// Setting this attribute to a higher value is needed if the emission rate of the emitter
|
2021-12-25 10:04:45 +08:00
|
|
|
// is high. On slower computers, emitting the particles may exceed generating the
|
2015-12-11 23:37:58 +08:00
|
|
|
// spawnpoints (because this is not done at once, but per Particle Technique update).
|
2015-02-11 18:14:22 +08:00
|
|
|
// */
|
|
|
|
// unsigned short mIterations;
|
|
|
|
//
|
|
|
|
// /** Determines the name of the mesh of which the vertices are used.
|
|
|
|
// */
|
|
|
|
// std::string mMeshName;
|
|
|
|
//
|
|
|
|
// /** The _preProcessParticles() function is used to generate some spawn points in every update.
|
|
|
|
// */
|
|
|
|
// virtual void _preProcessParticles(ParticleTechnique* technique, float timeElapsed);
|
|
|
|
//
|
2021-12-25 10:04:45 +08:00
|
|
|
// /**
|
2015-02-11 18:14:22 +08:00
|
|
|
// */
|
2019-07-22 09:38:46 +08:00
|
|
|
// void _setDefaults();
|
2015-02-11 18:14:22 +08:00
|
|
|
//
|
2021-12-25 10:04:45 +08:00
|
|
|
// /**
|
2015-02-11 18:14:22 +08:00
|
|
|
// */
|
2019-07-22 09:38:46 +08:00
|
|
|
// void _loadMesh ();
|
2015-02-11 18:14:22 +08:00
|
|
|
//
|
|
|
|
// /** Generate spawn points from a mesh. The points will not be generated all at once, but
|
|
|
|
// gradually. In each call, the points on an edge are generated, until all vertices
|
2021-12-25 10:04:45 +08:00
|
|
|
// have been processed. In that case, mAllVerticesProcessed is set to true and this
|
2015-02-11 18:14:22 +08:00
|
|
|
// function stops further processing.
|
|
|
|
// */
|
2019-07-22 09:38:46 +08:00
|
|
|
// void _generatePoints ();
|
2021-12-25 10:04:45 +08:00
|
|
|
//
|
|
|
|
// /**
|
2015-02-11 18:14:22 +08:00
|
|
|
// */
|
2019-07-22 09:38:46 +08:00
|
|
|
// void _generatePointsFromMesh ();
|
2015-02-11 18:14:22 +08:00
|
|
|
//
|
2021-12-25 10:04:45 +08:00
|
|
|
// /**
|
2015-02-11 18:14:22 +08:00
|
|
|
// */
|
2019-07-22 09:38:46 +08:00
|
|
|
// void _generatePointsFromSubMesh ();
|
2015-02-11 18:14:22 +08:00
|
|
|
//
|
2021-12-25 10:04:45 +08:00
|
|
|
// /**
|
2015-02-11 18:14:22 +08:00
|
|
|
// */
|
2019-07-22 09:38:46 +08:00
|
|
|
// void _fillVertexBuffer();
|
2015-02-11 18:14:22 +08:00
|
|
|
//
|
2021-12-25 10:04:45 +08:00
|
|
|
// /**
|
2015-02-11 18:14:22 +08:00
|
|
|
// */
|
2019-07-22 09:38:46 +08:00
|
|
|
// void _generatePointsFromVertexBuffer();
|
2015-02-11 18:14:22 +08:00
|
|
|
//
|
2021-12-25 10:04:45 +08:00
|
|
|
// /**
|
2015-02-11 18:14:22 +08:00
|
|
|
// */
|
2021-12-25 10:04:45 +08:00
|
|
|
// void _generatePoints (const Vec3& startVector,
|
2015-02-11 18:14:22 +08:00
|
|
|
// const Vec3& endVector,
|
|
|
|
// float lengthIncrement = 0.0f);
|
|
|
|
//
|
2021-12-25 10:04:45 +08:00
|
|
|
// public:
|
2015-02-11 18:14:22 +08:00
|
|
|
// // Constants
|
|
|
|
// static const unsigned short DEFAULT_STEP;
|
|
|
|
// static const unsigned short DEFAULT_SEGMENTS;
|
|
|
|
// static const unsigned short DEFAULT_ITERATIONS;
|
|
|
|
//
|
2019-07-22 09:38:46 +08:00
|
|
|
// Particle3DVertexEmitter();
|
|
|
|
// virtual ~Particle3DVertexEmitter() {};
|
2015-02-11 18:14:22 +08:00
|
|
|
//
|
2021-12-25 10:04:45 +08:00
|
|
|
// /**
|
2015-02-11 18:14:22 +08:00
|
|
|
// */
|
2019-07-22 09:38:46 +08:00
|
|
|
// unsigned short getIterations() const;
|
2015-02-11 18:14:22 +08:00
|
|
|
//
|
2021-12-25 10:04:45 +08:00
|
|
|
// /**
|
2015-02-11 18:14:22 +08:00
|
|
|
// */
|
|
|
|
// void setIterations(unsigned short iterations);
|
2021-12-25 10:04:45 +08:00
|
|
|
//
|
|
|
|
// /**
|
2015-02-11 18:14:22 +08:00
|
|
|
// */
|
2019-07-22 09:38:46 +08:00
|
|
|
// unsigned short getSegments() const;
|
2015-02-11 18:14:22 +08:00
|
|
|
//
|
2021-12-25 10:04:45 +08:00
|
|
|
// /**
|
2015-02-11 18:14:22 +08:00
|
|
|
// */
|
|
|
|
// void setSegments(unsigned short segments);
|
|
|
|
//
|
2021-12-25 10:04:45 +08:00
|
|
|
// /**
|
2015-02-11 18:14:22 +08:00
|
|
|
// */
|
2019-07-22 09:38:46 +08:00
|
|
|
// unsigned short getStep() const;
|
2015-02-11 18:14:22 +08:00
|
|
|
//
|
2021-12-25 10:04:45 +08:00
|
|
|
// /**
|
2015-02-11 18:14:22 +08:00
|
|
|
// */
|
|
|
|
// void setStep(unsigned short step);
|
|
|
|
//
|
2021-12-25 10:04:45 +08:00
|
|
|
// /**
|
2015-02-11 18:14:22 +08:00
|
|
|
// */
|
2021-12-26 23:26:34 +08:00
|
|
|
// std::string_view getMeshName() const;
|
2015-02-11 18:14:22 +08:00
|
|
|
//
|
2021-12-25 10:04:45 +08:00
|
|
|
// /**
|
2015-02-11 18:14:22 +08:00
|
|
|
// */
|
2019-07-22 09:38:46 +08:00
|
|
|
// virtual void _notifyStart ();
|
2021-12-25 10:04:45 +08:00
|
|
|
//
|
|
|
|
// /**
|
2015-02-11 18:14:22 +08:00
|
|
|
// */
|
2021-12-26 23:26:34 +08:00
|
|
|
// void setMeshName(std::string_view meshName);
|
2015-02-11 18:14:22 +08:00
|
|
|
//
|
2021-12-25 10:04:45 +08:00
|
|
|
// /**
|
2015-02-11 18:14:22 +08:00
|
|
|
// */
|
|
|
|
// virtual void _initParticlePosition(Particle* particle);
|
|
|
|
//
|
2021-12-25 10:04:45 +08:00
|
|
|
// /**
|
2015-02-11 18:14:22 +08:00
|
|
|
// */
|
|
|
|
// unsigned short _calculateRequestedParticles(float timeElapsed);
|
|
|
|
//};
|
2022-07-11 17:50:21 +08:00
|
|
|
NS_AX_END
|
2015-02-11 18:14:22 +08:00
|
|
|
|
|
|
|
#endif
|