Cumber Syntax in Irrlicht.NET

Irrlicht.Net is no longer developed or supported, Irrlicht.Net Cross Platform is a much more complete wrapper. Please ask your C# related questions on their forums first.
Locked
thomascheah
Posts: 77
Joined: Sat Jul 08, 2006 5:55 am
Location: Cyberjaya, Malaysia

Cumber Syntax in Irrlicht.NET

Post by thomascheah »

I noticed that Irrlicht.NET uses structure extensively for some lightwight data structure like lights, material, matrix, vector, etc., which is good, but there are place that makes it very cumbersome. A good example will be when one attempt to modify the object's material.

Let's say I wish to modify merely the EmissiveColor of an object. I have to do the following,

Material mat = myObject.GetMaterial(0);
mat.EmissiveColor = new Color(255, 255, 0, 0);
myObject.SetMaterial(0, mat);

Things would be much simpler if Material was made into a class. Then one can achieve the same thing above via,

myObject.GetMaterial(0).Color(255, 255, 0, 0);

Any comments on that?
Cube3
Posts: 30
Joined: Wed Mar 15, 2006 7:42 pm
Location: http://cube3.helpmy.net

Post by Cube3 »

You will find you will need to wrap not only the structures.
Platform 3D Engine using Irrlicht.NET
http://cube3.helpmy.net
Firgor
Posts: 5
Joined: Mon Jan 02, 2006 8:31 pm
Location: Germany :)
Contact:

Post by Firgor »

I think

myObject.GetMaterial(0).Color(255, 255, 0, 0);

is very difficult to read, better is

myObject.SetMaterialEmissiveColor (0, new Color(255,255,0));

In the above case you can capsulate the complete code and everybody knows what you want do do (hopefully) :)
Locked