Original Post
I have run into a problem with my code. In peticular the code for my particle engine. I have a class for the particle, a class for a particle ID (a way to keep track of the different particle effects that are going on all at once), and a class with member functions that control the particle effects. Here is the class for the particle:
Here is the class for the particle ID:
And last but not least, the class for the particle management:
Now the problem is that I can''t get things to compile. I want to have a pointer passed to the CreateParticleEffect() functions and the DestroyParticleEffect() functions so that they can allocate and de-allocate memory using new and delete. I seem to be getting 1 error message:
I am really having trouble figuring this out. Can someone lend me a hand?
//the particle class that makes up a particle
class PARTICLE
{
public:
D3DXVECTOR3 current_position; //current position of the particle
D3DXVECTOR3 previous_position; //last position of the particle - useful for stretching
//the particle for rain-like effects
D3DXVECTOR3 velocity; //velocity of the particle
float size; //width/height when the particles are square
int type; //the type of the particle - smoke, rain, dust, etc
int energy; //the energy of the particle - between 0 and 100
};
|
//the particle effect ID class. it is used to identify which
//particle effect to update or destroy
class ParticleEffectID
{
public:
PARTICLE *array; //pointer to an array of particles - number determined when
//CreateParticleEffect is use
int NumberOfParticles; //number of particles in the array
int ParticleType; //the particle type - rain, sparks, etc
float Position; //the position of the starting point
};
|
//the particle manager class that keeps track of arrays of particle for effects
//and updates them depending on what type of effect it is.
class ParticleManager
{
public:
static bool CreateParticleEffect(ParticleEffectID Id, int NumOfParticles,
int ParticleEffectType, float EffectPosition);
static bool UpdateParticleEffect(ParticleEffectID Id);
static bool DestroyParticleEffect(ParticleEffectID Id);
};
|
error C2664: ''__thiscall PARTICLE::PARTICLE(const class PARTICLE &)'' : cannot convert parameter 1 from ''int'' to ''const class PARTICLE &'' |