Crystal Space
Welcome, Guest. Please login or register.
September 03, 2014, 07:17:27 am

Login with username, password and session length
Search:     Advanced search
9009 Posts in 2043 Topics by 8380 Members
Latest Member: Acr2oajme1
* Home Help Search Login Register
  Show Posts
Pages: [1]
1  Crystal Space Development / Support / Re: Dynamic MeshFactory Creation and Static Class Created Me on: April 07, 2005, 05:46:55 pm
Quote from: Valcar

1) Can I use dynamically created mesh factories (loaded from the library file) to create meshes in static/compiled code?  


I found a solution for this one.

iEngine has a function that returns a list of mesh factories (type iMeshFactoryList).  With this list you can invoke a "FindByName()" function call with the name "ball_factory".

This makes it easier (especially for a simple project), because you can later use a single factory for all meshes of that particular type, with little/to no coding overhead for adding in a new or changing a mesh type.

I'm still looking for answers to 2 and 3.  2 seems to be allowed, but for some reason during my attempts it couldn't find the library file by another name.
2  Crystal Space Development / Support / Dynamic MeshFactory Creation and Static Class Created Meshes on: April 07, 2005, 04:25:09 pm
First of all this is my first post.  I would like to say so far the CS Community seems very helpful.  I've spent the last day or so working with the CS engine and I'm trying to create a simple project for myself to get things going.

I've realized the ease of use by dynamically loading from my library a mesh factory.  But this has lead me to three problems.
1) Can I use dynamically created mesh factories (loaded from the library file) to create meshes in static/compiled code?  For example, I have a need to build ball meshes, in my program.  Instead of creating a hard coded ball factory, can I add:
Code:
   <meshfact name="ball_factory">
        <plugin>crystalspace.mesh.loader.factory.ball</plugin>
        <params/>
    </meshfact>

to a library file, load it in, and some how create my mesh using "ball_factory"?  like:
Code:
 csRef<iMeshWrapper> BBall = engine->CreateMeshWrapper ("ball_factory", "bouncy_ball", room, csVector3 (sx, sy, sz));


2) Can I create multiple library files by different names and load them all as needed?  I had difficulties doing this and I had to resort to using library and library.bak

3) Are the .bak files required or is the extentionless XML file enough?

Thanks in advance for all the clarification.  Believe me I wouldn't of asked it if I was able to locate it in the manuals/tutorials/articles.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 3.172 seconds with 17 queries.