WATER (no hillplanemesh :( )

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
Thorben Linneweber

WATER (no hillplanemesh :( )

Post by Thorben Linneweber »

Hi,

Again a problem with the .net wrapper. It seems that "addHillPlaneMesh" (which I wanted to create a watersurfacenode) is not implemented yet.

Do you have any idea for another method to get a mesh at runtime? (or any other solution for my problem?)

In c++ the code looks like this:


Code: Select all



	mesh = smgr->addHillPlaneMesh("myHill",
		core::dimension2d<f32>(20,20),
		core::dimension2d<s32>(40,40), 0, 0,
		core::dimension2d<f32>(0,0),
		core::dimension2d<f32>(10,10));

	node = smgr->addWaterSurfaceSceneNode(mesh->getMesh(0), 3.0f, 300.0f, 30.0f);


Thorben
Duncan Mac Leod
Posts: 64
Joined: Sun May 22, 2005 3:06 pm
Location: Germany
Contact:

Re: WATER (no hillplanemesh :( )

Post by Duncan Mac Leod »

Thorben Linneweber wrote:Hi,

Again a problem with the .net wrapper. It seems that "addHillPlaneMesh" (which I wanted to create a watersurfacenode) is not implemented yet.

Do you have any idea for another method to get a mesh at runtime? (or any other solution for my problem?)

In c++ the code looks like this:


Code: Select all



	mesh = smgr->addHillPlaneMesh("myHill",
		core::dimension2d<f32>(20,20),
		core::dimension2d<s32>(40,40), 0, 0,
		core::dimension2d<f32>(0,0),
		core::dimension2d<f32>(10,10));

	node = smgr->addWaterSurfaceSceneNode(mesh->getMesh(0), 3.0f, 300.0f, 30.0f);


Thorben
Why not add this 'feature' for .NET yourself ;) ??

Add in Irrlicht.NET/ISceneManager.h the following code (after Niko's placeholder):

Code: Select all

		//IAnimatedMesh* addHillPlaneMesh( c8* name,
		//	 core::dimension2d<float>& tileSize,  core::dimension2d<int>& tileCount,
		//	video::SMaterial* material = 0,	float hillHeight = 0.0f, 
		//	 core::dimension2d<float>& countHills = core::dimension2d<float>(0.0f, 0.0f),
		//	 core::dimension2d<float>& textureRepeatCount = core::dimension2d<float>(1.0f, 1.0f)) = 0;
		IAnimatedMesh* AddHillPlaneMesh(System::String* name,
			Core::Dimension2Df tileSize, Core::Dimension2D tileCount,
			Video::Material material, float hillHeight, 
			Core::Dimension2Df countHills,
			Core::Dimension2Df textureRepeatCount);
and in Irrlicht.NET/ISceneManager.cpp (after the function ISceneNode* ISceneManager::AddEmptySceneNode(ISceneNode* parent, int id){.......} the following code:

Code: Select all

	IAnimatedMesh* ISceneManager::AddHillPlaneMesh(System::String* name,
			Core::Dimension2Df tileSize, Core::Dimension2D tileCount,
			Video::Material material, float hillHeight, 
			Core::Dimension2Df countHills,
			Core::Dimension2Df textureRepeatCount)
	{
		char* strName = (char*)(void*)
			System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(name);
		irr::scene::IAnimatedMesh* a =
			Manager->addHillPlaneMesh(strName, irr::NativeConverter::getNativeDim(tileSize),
			irr::NativeConverter::getNativeDim(tileCount), &irr::NativeConverter::getNativeMaterial(material),
			hillHeight, irr::NativeConverter::getNativeDim(countHills),
			irr::NativeConverter::getNativeDim(textureRepeatCount));
		if (!a)
			return 0;
		return new IAnimatedMesh(a);
	}
Tested only on Irrlicht-0.10.0 (!!) - so plz don't flame me ;) if it doesn't work on 0.11.0, cause we have abandoned our .NET code in favor of using our own mixed mode (managed/unmanaged) Dll for .NET integration in our Project...

HTH,
Duncan
--
Tucan Entertainment
Thorben Linneweber

Post by Thorben Linneweber »

Thank You ! It works! :D

This feauture should be implemented in the next Version of the wrapper-dll by default.

Thorben
Duncan Mac Leod
Posts: 64
Joined: Sun May 22, 2005 3:06 pm
Location: Germany
Contact:

Post by Duncan Mac Leod »

Thorben Linneweber wrote:Thank You ! It works! :D

This feauture should be implemented in the next Version of the wrapper-dll by default.

Thorben
You are welcome :D !
keke

Re: WATER (no hillplanemesh :( )

Post by keke »

in C#
device.SceneManager.AddHillPlaneMesh
instead of device.SceneManager.addHillPlaneMesh

not see the difference...? look carrefully Add vs add (uppercase vs lowercase)

work well for me

and more function begin lower case in c++ but uppercase in c#...
Thorben Linneweber

Post by Thorben Linneweber »

...

yes, there was no hillplanemesh in 1.0 ...

in the actual version there is a hillplanemesh

...
Locked