Mesh

Uses XML Tag mm:mesh and contains…

Tag Type Description
name string A name is required.
[center] float[3] Local center position. If not supplied, it will be calculated.
[minmax] float[6] Local min/max boundaries. If not supplied, it will be calculated.
[cullradius] float Radius for culling purposes. If not supplied, it will be calculated.
[position] float[3] World position. If not supplied, it will be located at the world’s origin.
[rotation] float[3] World rotation. If not supplied, it will be aligned to the world’s axes.
[scale] float[3] Local scale. Default is [1,1,1], if not supplied.
[surfaces] mm:surface[?] List of attached surfaces. If not supplied, mesh will be invisible.
[materials] mm:material[?] List of attached materials. Material count must be equal to or greater than the surface count.

In the example below, the material refers to an existing source and modifies its default textures.

Example:

<mm:mesh>
   <name>MyMesh</name>
   <minmax>-30.00,-30.02,0.00,30.00,30.00,7.14</minmax>
   <surfaces>
      <mm:surface>[...]</mm:surface>
   </surfaces>
   <materials>
      <mm:material src_proto=“Mana::Material/ExistingMaterial”>
         <textures>
            <mm:texture uri=“Mana::Textures:SubTexA.tga”/>
            <mm:texture uri=“Mana::Textures:SubTexB.tga”/>
         </textures>
      </mm:material>
   </materials>
</mm:mesh>

Model

Uses XML Tag mm:model and contains…

Tag Type Description
[src_proto] attribute Specify a path to a prototype. If not supplied, model is unique.
[class] string Class extension. This is required if no source prototype was supplied
name string A name is required.
[center] float[3] Local center position. If not supplied, it will be calculated based on attached meshes.
[minmax] float[6] Local min/max boundaries. If not supplied, it will be calculated based on attached meshes.
[cullradius] float Radius for culling purposes. If not supplied, it will be calculated based on attached meshes.
[castshadows] integer Shadow casting property. If not supplied, model will not cast shadows.
[position] float[3] World position. If not supplied, it will be located at the world’s origin.
[rotation] float[3] World rotation. If not supplied, it will be aligned to the world’s axes.
[scale] float[3] Local scale. Default is [1,1,1], if not supplied.
[meshes] mm:mesh[?] List of attached meshes. If not supplied, model will be invisible.

Example:

<mm:model>
   <class>MyModel</class>
   <name>MyModel</name>
   <center>0.00,-0.01,3.57</center>
   <minmax>-30.00,-30.02,0.00,30.00,30.00,7.14</minmax>
   <cullradius>46.84</cullradius>
   <castshadows>1</castshadows>
   <position>0.00,0.00,0.00</position>
   <rotation>0.00,0.00,0.00</rotation>
   <scale>1.00,1.00,1.00</scale>
   <meshes>
      <mm:mesh>[...]</mm:mesh>
      <mm:mesh>[...]</mm:mesh>
   </meshes>
</mm:model>

Surface

Uses XML Tag mm:surface and contains…

Tag Type Description
name string A name is required.
faces base64 | integer[3][?] Formatted triangle data.
vertexdata mm:vertexdatafull[1+] List of attached vertex data. Must have at least one.

Example:

<mm:surface>
   <name>surf1</name>
   <faces encode=“b64iv3″>AAAAAAEA[...]</faces>
   <vertexdata>
      <mm:vertexdatafull>[...]</mm:vertexdatafull>
      <mm:vertexdatafull>[...]</mm:vertexdatafull>
   </vertexdata>
</mm:surface>

Vertex data full uses XML Tag mm:vertexdatafull and contains…

Tag Type Description
nverts integer Vertex count is required.
verts base64 | float[3][?] Formatted vertex coordinates.
norms base64 | float[3][?] Formatted vertex normals.
tangs base64 | float[3][?] Formatted vertex tangents.
uv1s base64 | float[3][?] Formatted vertex map channel 1 coordinates.
uv2s base64 | float[3][?] Formatted vertex map channel 2 coordinates.
colors base64 | float[4][?] Formatted vertex colors.

Example:

<mm:vertexdatafull>
   <nverts>4</nverts>
   <verts encode=“b64f”>AADwQQAA[...]</verts>
   <norms encode=“b64f”>AAAAAAAA[...]</norms>
   <tangs encode=“b64f”>/OeqNAAA[...]</tangs>
   <uv1s encode=“b64f”>AINEO3Ln[...]</uv1s>
   <uv2s encode=“b64f”>AAIDOkLf[...]</uv2s>
   <colors encode=“b64f”>gYAAP4GA[...]</colors>
</mm:vertexdatafull>

Material

Uses XML Tag mm:material and contains…

Tag Type Description
[class] string Class extension. This is required if no source prototype was supplied
name string A name is required.
textures mm:texture[?] List of textures.
brushes mm:brush[1+] List of brushes. Must have at least one.
technique mm:technique[1+] List of techniques. Must have at least one.

Example:

<mm:material>
   <class>MyMaterial</class>
   <name>MyMaterial</name>
   <textures>
      <mm:texture uri=“*/Textures:grid.tga”/>
      <mm:texture uri=“*/Textures:flat.tga”/>
   </textures>
   <brushes>
      <mm:brush>[...]</mm:brush>
   </brushes>
   <techniques>
      <mm:technique>[...]</mm:technique>
      <mm:technique>[...]</mm:technique>
   </techniques>
</mm:material>

Brush uses XML Tag mm:brush and contains…

Tag Type Description
[name] string A name is required only when the brush is not parented.
[specular] float Specular highlight value. If not supplied, the default is 0.5.
[shininess] float Shininess value. If not supplied, the default is 10.0.
[stages] mm:texturestage[?] List of texture stages (described below). Must match the number of textures in brush’s parent material.
[shader] mm:shader Companion shader for this brush. Defaults to simple shader or fixed function pipeline.

Example:

<mm:brush>
   <specular>0.75</specular>
   <shininess>15.0</shininess>
   <stages>
      <mm:texturestage>[...]</mm:texturestage>
      <mm:texturestage>[...]</mm:texturestage>
   </stages>
   <mm:shader>
      <name>MyShader</name>
      <nshadows>2</nshadows>
      <vshaders>
         <mm:vertexshader uri=“*/Shaders:MyVS.vert”/>
      </vshaders>
      <fshaders>
         <mm:fragmentshader uri=“*/Shaders:Common.frag”/>
         <mm:fragmentshader uri=“*/Shaders:MyFS.frag”/>
      </fshaders>
   </mm:shader>
</mm:brush>

TextureStage uses XML Tag mm:texturestage and contains…

Tag Type Description
texid integer Id that matches this stage to a texture in the parent material.
[flags] integer Flags describing the texture application.
[coords] integer Mapping coordinate set to use in this stage.
[blend] integer Blend value determines how this texture blends with the previous layer (if any).
[wrapu] integer Horizontal wrapping method (in U).
[wrapv] integer Vertical wrapping method (in V).
[matrixfn] integer Matrix function index. Used for animation, lighting, etc.

Example:

<mm:texturestage>
   <texid>0</texid>
   <flags>9</flags>
   <coords>0</coords>
   <blend>2</blend>
   <wrapu>0</wrapu>
   <wrapv>0</wrapv>
   <matrixfn>0</matrixfn>
</mm:texturestage>

Technique uses XML Tag mm:technique and contains…

Tag Type Description
[name] integer A name is optional.
[brushes] integer[?] Brush index used in each pass.
[blends] integer[?] Blend function used in each pass.
[options] integer[?] Additional options used in each pass.

Example:

<mm:technique>
   <name>Opaque</name>
   <brushes>0</brushes>
   <blends>0</blends>
   <options>0</options>
</mm:technique>

Quick Start

There are different approaches to making software using Mana and they require different levels of knowledge. Here is the place to learn about them and how to use this documentation for best results.

Continue reading Quick Start

Vector3

Description goes here.

Continue reading Vector3

Objects

Mana is object-oriented by design. Creating software in Mana is accomplished by arranging virtual “objects” into a sequence and then pressing the “play” button.

So what the heck is a virtual object?

In Mana, a virtual object is simply a name with some data attached to it. The data can represent an image, a model…your Aunt Irma’s oatmeal cookie recipe…anything! Objects are usually composed of other objects and can be very simple or very complex.

Every object has an update method, or a set of instructions that tells it what to do. When you call Update() on the first object, it automatically calls the same routine on all of its child objects, and they each call it on their child objects, etc. This “cascade effect” is how the application progresses and usually it happens over and over again in a loop until some condition is met (e.g. the user closes the app).

What do you mean by “child” objects?

Typically, objects are organized in one of two ways. The Mana interface provides a directory, like folders on your hard drive, where objects can be browsed just like files. In addition, there are some objects that can have others linked to them in a parent-child hierarchy.

All objects have a class (ification) that defines common features. Only objects belonging to certain classes can have child objects because they share that feature. Objects that can have children are derived from Mana’s Linkable class, which is an abstract. Abstract objects are explained in the next article.

Almost all objects can be children. However, it is up to each class to decide restrictions. If you had an object of class “person” and another of class “car,” you might want to restrict objects of class “foot” and class “tire” so that they attach appropriately and you don’t end up with a person’s tire and a car’s foot!

Add

Vector3 Add( v3 )

Description goes here.

Continue reading Add

GetXmlNodeName

string GetXmlNodeName()

Description goes here.

Continue reading GetXmlNodeName

Abstracts

All objects in Mana are derived from a handful of abstract objects. As in other object-oriented systems, abstract objects cannot be instanced (created). They exist only as templates from which other class objects are derived.

Continue reading Abstracts