[Alt Approach] ResourceManager LocType(s)

GregH

25-01-2006 13:21:15

Hi Folks,

Can anyone please provide a list of the natively supported LocType strings for the ResourceManager (eg: "FileSystem" is one of them).

The reason I ask is that I've used my OgreRoot object to create a Plane ("NewPlane") and the Entity I'm trying to create (based on the plane) can't find the plane in the resource pool...the OGRE.Log is grumbling about not being able to find the plane ("NewPlane") and I think it's because I don't know what LocType to specify.

It would be useful to know the supported Loctypes at any rate...

Cheers,

G.

rastaman

25-01-2006 14:27:24

LocType is for ResourceGroupManager.addResourceLocation when you load the resources.cfg. The only ones that I am aware of in ogre are "FileSystem" and "Zip". It does not have anything to do with objects you create in code.


I've used my OgreRoot object to create a Plane ("NewPlane")
Don’t you mean MeshManager.CreatePlane? The first argument is name, pass that as the second argument to CreateEntity. The second argument is groupName, make that ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME or "General".
It is case sensitive so make sure it is exactly the same.

GregH

26-01-2006 01:06:53

Hi RastaMan,

Thanks for the reply, and yes I know plane objects are created with MeshManager. I have created planes in my main module successfully, but rather than clutter it I've created a SceneObjectManager class that creates and maintains scene objects in a collection. It also contains methods that can manipulate the objects (like "Shake" for camera objects and "Die" for meshes). This means the main module can manipulate scene objects (including meshes, camera, viewports etc) via a string name or by their item number (good for incremental processing).

I've since decided that as I can add file-based meshes to my collection without trouble, I'll just create a simple mesh (using Max), export as Plane.Mesh and then add a material, scale and rotate it into place in OGRE.

BTW...this is the error that CreateEntity was throwing as per Ogre.Log:

-----------------------------------
Details:
-----------------------------------
Error #: 7
Function: ArchiveManager::load
Description: Cannot find an archive factory to deal with archive of type General.
File: c:\softwaredevelopment\c++\ogresdk\ogrenew\ogremain\src\ogrearchivemanager.cpp
Line: 62

...for what it's worth. Thanks for trying to help anyway.

Cheers,

G.

GregH

26-01-2006 11:30:45

Hi Folks,

Following on from previous posts...I ended up creating a simple mesh named SurfaceUV1by1.mesh that I can add to my SceneObjectManager collection. When I add it, I specify position, scale, rotation and a material.

It is also assigned a name and a group number (used for selection operations).

Just a thought: Am I correct in thinking that material scripts don't provide a way to tile the texture X by Y many times (ie: tiling can only be controlled by the UV mapping on the mesh) ? I see there's a Scale modifier, but the Ogre manual says it's only good for greater than zero ops (ie: you can stretch a texture but you can't shrink to cause tiling).

Please let me know either way....

Cheers,

G.

rastaman

26-01-2006 15:01:54

Just a thought: Am I correct in thinking that material scripts don't provide a way to tile the texture X by Y many times (ie: tiling can only be controlled by the UV mapping on the mesh) ? I see there's a Scale modifier, but the Ogre manual says it's only good for greater than zero ops (ie: you can stretch a texture but you can't shrink to cause tiling).

Yes, the scale modifier will work. The x,y value must be greater than zero because it multiplies the UVs by that value. A value of 0.5 would shrink it by half.

GregH

26-01-2006 21:04:58

Hi Rastaman,

Excellent !! That means I can use one generic plane mesh with UV 1 by 1 mapping and then use the scale modifier on a material to apply to it...and that solves my issues. Yay ! I'll try it this afternoon (Oz time).

Cheers,

G.