SleepingTroll Posted March 8, 2012 Posted March 8, 2012 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); } Quote
SleepingTroll Posted March 8, 2012 Author Posted March 8, 2012 Yep, brain fart... I had created no values for the last member... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.