Rectangle2D setMaterial crash

Kodachi_Garou

27-06-2006 20:26:50

I was exploring OgreDotNet features for background image rendering and I thought I had it with these lines:

Rectangle2D sprite = new Rectangle2D(true);
sprite.setCorners(-1.0f, 1.0f, 1.0f, -1.0f);
sprite.setBoundingBox(new AxisAlignedBox(-100000.0f * Vector3.UnitScale, 100000.0f * Vector3.UnitScale));
sprite.setMaterial("Plane/Background"); *BROKEN*
sprite.SetRenderQueueGroup(0);
mSceneManager.RootSceneNode.AttachObject(sprite);


However, it crashes and stepping through the code reveals it to be on the setMaterial line. The material is properly loaded, I've tried to apply it to other entities with success, but it fails on Rectangle2D. Anyone has any hint as to what's going on?

Thanks,