Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Maybe it is just a brain fart, however the highlighted line of my code produces and index out of range error... can anyone spot the problem?

 

 

		public void AddParticle()
	{
		Array.Resize(ref Particlestemp, Particlestemp.Length);
		Array.Copy(Particles, Particlestemp, Particles.Length);
		Array.Resize(ref Particles, Particles.Length);
		Array.Copy(Particlestemp, Particles, Particles.Length);
		Array.Resize(ref ParticleMeshtemp, ParticleMesh.Length);
		Array.Copy(ParticleMesh, ParticleMeshtemp,ParticleMesh.Length);
		Array.Resize(ref ParticleMesh, ParticleMesh.Length);
		[color="Red"]ParticleMesh[ParticleMesh.Length-1] = Mesh.Sphere(device, 4, 64, 64 );[/color]
		ParticleMaterial[Particles.Length-1].Ambient = Color.Green;
		ParticleMaterial[Particles.Length-1].Diffuse = Color.Green;
		ParticleMaterial[Particles.Length-1].Specular = Color.Green;
		ParticleMaterial[Particles.Length-1].SpecularSharpness = 100;
		VelocityX.Add(1);
		VelocityY.Add(1);
		VelocityZ.Add(1);
		PositionX.Add(1);
		PositionY.Add(1);
		PositionZ.Add(1);
	}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...