Tutorial 3 Help

terrachild

04-10-2006 23:57:05

I got tutorials 1, and 2 to work in VB.NET using 2005 Express.

But, I can't get tutorial 3 to work. How do you set scene manager to SceneType.ExteriorClose. I keep getting errors.


The tutorial contains this line:
mSceneManager = mRoot.CreateSceneManager((ushort)SceneType.ExteriorClose);

VB.NET doesn't like this, so I changed it to:
mSceneManager = mRoot.CreateSceneManager("SceneType.ExteriorClose")

But this causes an error.

//
16:14:01: An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 7
Function: SceneManagerEnumerator::createSceneManager
Description: No factory found for scene manager of type 'SceneType.ExteriorClose'.
File: ..\src\OgreSceneManagerEnumerator.cpp
Line: 173
Stack unwinding: <<beginning of stack>>
//



The plugins config looks fine:

//
# Defines plugins to load

# Define plugin folder
PluginFolder=.

# Define plugins
Plugin=RenderSystem_Direct3D9
Plugin=RenderSystem_GL
Plugin=Plugin_ParticleFX
Plugin=Plugin_BSPSceneManager
Plugin=Plugin_OctreeSceneManager
Plugin=Plugin_CgProgramManager
//


Any help would be appreciated.

Chris

Thellis

14-10-2006 07:27:49

I tried to fix that several ways without any success...
Firstly, the original C# code is
(UShort)SceneType.ExteriorClose

to which the VB equiv. is
DirectCast(SceneType.ExteriorClose, UShort)

so..
Dim mSceneManager As SceneManager=mRoot.CreateSceneManager(DirectCast(SceneType.ExteriorClose, UShort))

still didnt work... then i tried something that i didnt think would work (and i was right)
console.Write(":::" & SceneType.ExteriorClose & ":::")

returns
:::2:::

so i tried
Dim mSceneManager As SceneManager=mRoot.CreateSceneManager("2")

which, as i said (predictably) didnt work :P... i get the same error as you, so obviously we are missing something quite important... i dont think we can just put it in ""... might go looking for a function or something :)

*EDITED:
Found this in the Ogre SDK Source that might help?

/** Classification of a scene to allow a decision of what type of
SceenManager to provide back to the application.
*/
enum SceneType
{
ST_GENERIC = 1,
ST_EXTERIOR_CLOSE = 2,
ST_EXTERIOR_FAR = 4,
ST_EXTERIOR_REAL_FAR = 8,
ST_INTERIOR = 16
};


And in case you are wondering,
Dim mSceneManager As SceneManager=mRoot.CreateSceneManager("ST_EXTERIOR_CLOSE")

still produces
Description: No factory found for scene manager of type 'ST_EXTERIOR_CLOSE'.

*EDITED:
Dim mSceneManager As SceneManager=mRoot.CreateSceneManager(SceneType.ExteriorClose.ToString())

Just produces
Description: No factory found for scene manager of type 'ExteriorClose'.

Thellis

14-10-2006 08:15:29

BOOM! Fixed...
Dim mSceneManager As SceneManager=mRoot.CreateSceneManager(Convert.ToUInt16(SceneType.ExteriorClose))