Irrlicht Lime is a .NET wrapper for Irrlicht Engine

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
almondega
Posts: 37
Joined: Sat Jun 21, 2008 2:14 am

Post by almondega »

I found a link error at the IrrlichtLime C++ project.
cannot open input file ';..\irrlicht\lib\Win32-visualstudio\Irrlicht.lib'
Since the .sln is at the root folder, removing that "..\" could resolve the problem.

Same error for others paths, like includes..
:wink:
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

No.
The sln (Solution File) file contains links to vcproj (Visual C++ Project) and csproj (C# Project) files only. Path ..\irrlicht\lib\Win32-visualstudio\Irrlicht.lib used only in \source\IrrlichtLime.vcproj and it is correct (at least when you using folder structure defined by Lime). If you change it -- paths to includes, Irrlicht.lib (and Irrlicht.dll) should be updated properly.

You should use sln file to build Irrlicht Lime and examples.
almondega
Posts: 37
Joined: Sat Jun 21, 2008 2:14 am

Post by almondega »

I am using the .sln to load the entire project (samples + lime).
But since I'm using VS 2010, the IDE converted the .sln 9 to .sln 10, and just pressing F6 (build solution) shows those linkers errors.

Maybe in VS 2010 the path is relative to the .sln, not the .csproj..

Anyway, I need to change this paths in order to compile lime (downloading, openning and pressing F6 fails).
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

Maybe.
Haven't checked it with VS2010.
I like Irrlicht way -- providing couple of sln files (so you open which VS you have). I will try to provide sln (and *proj) files for VS2010 in future, when i get that VS.
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

Version 0.5 has been released.

New examples are available: 09.Meshviewer and 11.PerPixelLighting.
I skipped 10.Shaders example (for now) because shaders functionality not implemented yet.

Release Notes

~
Changes in typing:

Next classes has been renamed:
Coloru => Color (also property "Color" renamed to "ARGB"; in Colorf: method "ToColoru" renamed to "ToColor")
Matrix4f => Matrix
AABBox3Df => AABBox

Also class Dimension2Du has been removed and its "i" brother used instead. This will descreas number of type casting in C# user code.

Changed index types from "unsigned int" to "int". This is done, because C# requires (C++ doesn't) explicit casting from int to uint each time. For example, we have 2 members in GUIContextMenu:

Code: Select all

int SelectedIndex { int get(); } // it returns -1 if no item selected, that is correct, so cannot use uint here
void SetItemChecked(unsigned int index, bool isChecked); // it takes uint as index, this is correct, since -1 is not valid index and uint is fine here
But after this, when you need write a simple thing, like:
menu.SetItemChecked((uint)menu.SelectedIndex, true); // compiler requires you to cast index to uint
This is annoying thing, and it brings more type-castings when you use it in loops, for example:

Code: Select all

for (int i = 0; i < menu.ItemCount; i++)
	menu.SetItemChecked(i, true);
This will not compile, because ItemCount is uint; so you must: OR cast menu.ItemCount to int, OR use uint for i.
I looked to .NET Framework into List<T>, and see that they also uses int for List<T>.Count even if "count" cannot be negative.
So the same done in Lime for GUI elements; this will decrease number of annoying type-castings.
Note: additional asserts added, so int now checks not to be negative each time where it is true.
Note: this change was made in a lot of methods and properties (of different classes) where "unsigned int" value has meaning of "index" or "count".

~
IVideoDriver::setFog() and getFog() operates with 7 arguments: set() gets from 0 up to 7, and get() gets all 7 args, each one for output. In Lime there is a special class called Fog which holds all the data about fog, so you can use it next:

Code: Select all

// when you need set fog quickly
driver.Fog = new Fog(new Color(255, 220, 220), FogType::Linear, 200, 1000, 0.1f); // also set of contructor' overloads available here, from 0 arguments up to full list - 7 items.
// when you need to read and modify just 1 value (for example End)
Fog f = driver.Fog;
f.End = 500;
driver.Fog = f;
Note: Do not write "driver.Fog.End = 500;" since this will not do the change.

~
SceneManager.AddSkyBoxSceneNode() has special overloading that allows you to call it with string arguments instead of Video.Texture, like:

Code: Select all

skybox = smgr.AddSkyBoxSceneNode(
	"irrlicht2_up.jpg", "irrlicht2_dn.jpg",
	"irrlicht2_lf.jpg", "irrlicht2_rt.jpg",
	"irrlicht2_ft.jpg", "irrlicht2_bk.jpg");
It will load all textures automatically using ISceneManager::getVideoDriver()'s getTexture().

~
Changed type of argument timeForWay in method SceneManager.CreateFlyStraightAnimator() to float (was unsigned int). Please not that this change will not break the compilation, so be careful twice: if you use it, changed value for timeForWay to float, for example if it was "3500", now it should be "3.5f".

~
Added special class TexturePainter which allows you to access pixels in locked texture. This class doesn't wrap any Irrlicht analog, its just a helper wrapper for void* returned by video::ITexture::lock(). It can be used in next way:

Code: Select all

// this example shows how to make pixel at 10,10 to be red

TexturePainter p = texture.GetTexturePainter();
if (p.Lock())
{
	p.SetPixel(10, 10, new Color(255, 0, 0));
	p.Unlock(true); // "true" here means also to call texture->regenerateMipMapLevels()
}
Please note, Texture class has no Lock and Unlock methods, they both implemented in TexturePainter.
This class provides some useful functionality (which in native Irrlicht you have to calculate by your self, like mipmap level size or mipmap level count). You don't need to recreate TexturePainter each time you want to access mipmap level of Texture;

TexturePainter currently has next functionality:

Code: Select all

	Color^ GetPixel(int x, int y);
	
	bool Lock(bool readOnly, int mipmapLevel);
	bool Lock(bool readOnly);
	bool Lock();

	void SetPixel(int x, int y, Color^ color);

	void Unlock(bool alsoRegenerateMipMapLevels);
	void Unlock();

	property bool Locked { bool get(); }
	property int MipMapLevel { int get(); }
	property int MipMapLevelCount { int get(); }
	property int MipMapLevelHeight { int get(); }
	property int MipMapLevelWidth { int get(); }
	property bool ReadOnly { bool get(); }
	property Video::Texture^ Texture { Video::Texture^ get(); }
Note: almost all functionality from this class usable only when you locked the texture. For example, if you didn't called Lock(), you cannot check MipMapLevelWidth or ReadOnly -- you will get assertion check failed.

~
User data that you able to store in some GUI elements has int type (in comparision to native c++ version, it is void*). You cannot store pointer to your managed Object directly. This issue related to classes GUITreeViewNode and GUITable.

~
09.Meshviewer has been ported. However, next call is not ported:

Code: Select all

smgr->getParameters()->setAttribute(scene::COLLADA_CREATE_SCENE_INSTANCES, true);
since io::IAttributes is not ported yet.

~
Wrapped all Irrlicht's scene nodes and GUI elements.

Full list of changes:
http://irrlichtlime.svn.sourceforge.net ... f_format=h
almondega
Posts: 37
Joined: Sat Jun 21, 2008 2:14 am

Post by almondega »

The LINK problem I said after converting to vs10 was a flag indicating to not inherit that .lib path, so the path came from .sln and not .csproj.

I removed that flag and then compiled perfectly.

Thanks for the update!
:wink:
almondega
Posts: 37
Joined: Sat Jun 21, 2008 2:14 am

Post by almondega »

Hi greenya

It is possible in Lime to enable anti alias?

at this post he says to use a SIrrlichtCreationParameters struct to enable anti alias and create the device using createDeviceEx.

Lime doesn't have this feature for now right?

Thanks.
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

Yes.
Currently SIrrlichtCreationParameters is not wrapped and createDeviceEx not available either. I believe this functionality will be present in next release.
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

Version 0.6 has been released.

New examples are available: 12.TerrainRendering, 13.RenderToTexture, 15.LoadIrrFile, 18.SplitScreen, L01.TexturePainting and L02.WinFormsWindow. As you see 2 last examples are not ports of native Irrlicht', so it good reason to finally post screenshots :) .

Release Notes

~
Added example L01.TexturePainting which shows how to draw on the texture in simple way. Also this example show configuration window and renders all gui using Burnings Video driver: user may select video driver and resolution to use, use fullscreen or not (very similar to Irrlicht' native example called "Demo").

Sceenshot:
Image

~
Added example L02.WinFormsWindow which serves as replacement of original 14.Win32Window Irrlich' example. It demonstarates some features:
- rendering in different thread (using .NET Framework's BackgroundWorker component);
- recreating device on the fly with different settings;
- rendering inside WinForms' control OR using separate window;
- creating device using IrrlichtCreationParameters (specifying Win32 Handle and enabling antialiasing);

Sceenshot:
Image

~
Added class IrrlichtCreationParameters which you can use to setup advanced settings for device creation.
For example creation of Direct3D9/1280x800x32bpp device with 4x antialiasing enabled may look like:

Code: Select all

IrrlichtCreationParameters p = new IrrlichtCreationParameters();
p.DriverType = DriverType.Direct3D9;
p.WindowSize = new Dimension2Di(1280, 800);
p.BitsPerPixel = 32;
p.AntiAliasing = 4;
IrrlichtDevice device = IrrlichtDevice.CreateDevice(p);
if (device == null)
{
	// failed
}
// succeeded
~
Ported scene::IGeometryCreator class which allows you to generate meshes of simple objects like arrow, cone, cube, cylinder, sphere, plane or hill plane.

~
Ported scene::IMeshCache class. Now you can do mesh cache cleaning, foe example:

Code: Select all

device.SceneManager.MeshCache.Clear(); // will remove all meshes
// or
device.SceneManager.MeshCache.Clear(true); // will remove unused meshes only
Full list of changes:
http://irrlichtlime.svn.sourceforge.net ... athrev=151
gbox
Posts: 37
Joined: Mon May 01, 2006 3:41 am
Location: jeonju, korea
Contact:

Post by gbox »

very coool~!!!
thanks
http://cafe.naver.com/jcga

professor of Jelabukdo Game Engine Academy
Jesterstear
Posts: 18
Joined: Mon Jan 19, 2009 9:14 pm

Post by Jesterstear »

Hey, just checking back here and I wanted to leave some feedback after I actually got around to using IrrlichtLime.

Everything is working fine here, but I'm having a problem rotating nodes:

Code: Select all

cam.Rotation = new Vector3Df(cam.Target.X - (prevX - e.X), cam.Target.Y, cam.Target.Z);
Doesn't work. I also can't rotate SceneNodes, is this not implemented yet?

EDIT:
I spent some time messing around with position and rotation, and I found that position isn't working for me either, but if I modify a node, the camera moves instead of the object.

Code: Select all

for (int i = 0; i < GameObjects.Count; i++)
                {
                    GameObjects[i].Node.Rotation += .1f;
                    GameObjects[i].Update();
                }
GameObjects.Rotation += 1.f; should do the same thing, but it isn't working for some reason.

GameObject is the base class for my CubeObject class, and here is how I set the SceneNode for the Cube:

Code: Select all

public CubeObject(String newName, float newSize, Vector3Df newPos, Vector3Df rotation)
        {
            indexAmount++;
            Index = indexAmount;
            smgr = device.SceneManager;
            MeshNode = smgr.AddCubeSceneNode(newSize, smgr.RootNode, indexAmount, newPos, rotation);
            MeshNode.Name = newName;
            Node = MeshNode;
        }
But somehow it seems that the camera is being modified instead of the objects... Maybe I should remove the root scene node? That is the only cause that I can think of :?
Last edited by Jesterstear on Wed Sep 08, 2010 12:27 am, edited 1 time in total.
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

i think you have to use the setter functions
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Jesterstear
Posts: 18
Joined: Mon Jan 19, 2009 9:14 pm

Post by Jesterstear »

Check my edit, it is working... somewhat... Probably a logic error on my part, but it has me stumped.

EDIT: Set isn't working either.

EDIT2: I hit build, and now device is always equal to "null". Maybe I have a corrupt project file; everything was working fine until I uncommented
cam = smgr.AddCameraSceneNode(smgr.RootNode, new Vector3Df(10, 100, 10));

Time to restart computer.

EDIT3: Ok, restarting my computer fixed the null problem.
But I read my propertygrid, and it turns out that the cube is actually rotating, and when I make a sphere, it rotates as well. But... the camera is rotating with it (and it seems as the the grid that I draw is as well). The Camera isn't a GameObject, so I have to look a bit more.
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

Jesterstear wrote: GameObjects.Rotation += 1.f; should do the same thing, but it isn't working for some reason.


This should work and it works, i just checked.

If you want to rotate node on the same value about each axis, you can write:

Code: Select all

cube1.Rotation += 0.05f;
And, for example, if you want to rotate node only about X axis, you have to write:

Code: Select all

Vector3Df r = cube1.Rotation;
r.X += 0.05f;
cube1.Rotation = r;

// OR

cube1.Rotation = new Vector3Df(cube1.Rotation.X + 0.05f, cube1.Rotation.Y, cube1.Rotation.Z);
Its a pity, but when you write next, you will not get error or warning, but just rotation will not be applied:
so, never write next:

Code: Select all

cube1.Rotation.X += 0.05f;
Jesterstear wrote: I hit build, and now device is always equal to "null". Maybe I have a corrupt project file;
Its a pity, but as far as i know, there is no ability to get error code or some other error identifier from Irrlicht. Its native method createDevice() may return only null in case of error, also it may write something to console. If it returns null, IrrlichtLime' CreateDevice() also return null, so you have to check return value.

For example, when i try to create fullscreen Direct3D8 device with resolution 800, 599, i get null returned and console output saying:
Was not able to create Direct3D8 device.
Was not able to create Direct3D8 device.
Could not create DIRECT3D8 Driver.
Jesterstear
Posts: 18
Joined: Mon Jan 19, 2009 9:14 pm

Post by Jesterstear »

Yeah, Visual Studio messed up for a bit, the device is now working.

But cube.Rotation is defined like this:

Code: Select all

public Vector3Df Rotation
{
get
{
return Node.Rotation;
}
set
{
Node.Rotation = Rotation;
}
}
Maybe I'm not allowed to do that, because directly modifying the node rotates the camera (which I will try to figure out what is going on while I'm in class).
Post Reply