Clone wiki

PE.2.0 / xml-specifications

POLYMORPH XML

Here below you will find the list recognised tags and their structure (see bottom of the page). A DTD will be produced when the format will be stabilised. Expect changes in the following months, the engine being actively developped (07/04/2017).

Tag-list

Some tags are used in different contexts and have different attributes. Check the sructure description for more details.

b

  • bullet | no attribute
  • pnode/bullet | attributes: type, shape

c

  • plight/color | attributes: diffuse, specular
  • workspace/colors/color | attributes: name, value, node, pass, index
  • workspace/colors | no attribute
  • compositor | no attribute
  • bullet/config | attributes: gravity, maxsubsteps, verbose
  • plight/config | attributes: type, shadows, range
  • pnode/bullet/config | attributes: density, friction, restitution, restless
  • scene/config | attributes: gravity, persistent

d

  • data | attributes: density, friction, restitution, restless
  • pnode/bullet/damping | attributes: linear, angular

e

  • edition | no attribute

g

  • group | attributes: name

m

  • material | attributes: group, name
  • mesh | attributes: group, file

n

  • network | no attribute
  • node | attributes: pos, dir, size

o

  • osc | no attribute
  • output | attributes: channels, sample_rate, samples, audio_driver

p

  • plight | attributes: name, parent, visible, debug
  • pnode | attributes: name, parent, visible, debug
  • pobjects | no attribute
  • polymorph | attributes: version, date
  • puredata | attributes: edit_mode
  • primitive | attributes: type

r

  • receivers | no attribute
  • receiver | attributes: autostart, port, max_queue_size
  • repeat | attributes: count, offset_pos, offset_dir, offset_scale
  • resource | attributes: path, type, recursive, readonly
  • resources | no attribute

s

  • scene | attributes: id, name
  • scenes | no attribute
  • script | attributes: group, workspace
  • searchpaths
  • searchpath | attributes: value
  • sender | attributes: autostart, ip, port, max_32bits
  • senders | no attribute
  • spring | attributes: stiffness_linear, stiffness_angular, damping_linear, damping_angular, stop_cfm, stop_erp, enableEquilibrium, limit_linear_min, limit_linear_max, limit_angular_min, limit_angular_max

v

  • variable | attributes: name, value, node, pass, index
  • variables | no attribute

w

  • workspace | attributes: name

XML-structure

The text between [] indicate if:

  • the tag is mandatory or optional and the corresponding C++ object, when prefix by a ~, the tag has no direct object representation, when class name is suffixed by Data, the objet is not active at runtime;
  • the attribute is mandatory or optional, its type once decompress and its default value if not specified; a fourth argument culd specified the accepted values or mention the limitation of usage.
<?xml version="1.0" encoding="UTF-8"?>
<polymorph [mandatory, ~PProjectData] 
    version="0.1" [float, mandatory, no default] 
    date="20161124" [int, optional, no default] >

    <scenes [optional, ~PProjectData]>

        <scene [optional, PSceneData] 
            id="0" [unsigned int, optional, 0]
            name="first scene" [string, optional, empty by default]
            >

            <bullet [optional, PBullet]>

                <config [optional, PBulletData]
                    gravity="0,-20,0" [Vector3, optional, Vector3(0,-10,0)] 
                    persistent="0" [bool, optional, false]
                    />

            </bullet>

            <pobjects [optional, ~PProjectData]>

                <plight [optional, PLight] 
                    name="floor" [string, optional, 'pobject_{OgreID}']
                    visible="1" [bool, optional, true]
                    debug="0" [bool, optional, false] >

                    <origin [optional, Ogre::SceneNode]  
                        pos="0,-30,0" [Vector3, optional, Vector3(0,0,0)]
                        dir="0,0,0" [Euler, optional, Euler(0,0,0)]
                        size="600,5,600" [Vector3, optional, Vector3(1,1,1)] />

                    <node [optional, Ogre::SceneNode]  
                        pos="0,-30,0" [Vector3, optional, Vector3(0,0,0)]
                        dir="0,0,0" [Euler, optional, Euler(0,0,0)]
                        size="600,5,600" [Vector3, optional, Vector3(1,1,1)] />

                    <color [optional, ~PLight]  
                        diffuse="0.8,0.8,0.8" [Ogre::ColourValue, optional, ColourValue(1,1,1,1)]
                        specular="0.5,0.5,0.5" [Ogre::ColourValue, optional, ColourValue(1,1,1,1)]
                        />

                    <config [mandatory, ~PLight]  
                        type="sun" [Ogre::LightTypes, mandatory, sun|spot|point]
                        shadows="1" [bool, optional, false]
                        />

                </plight>

                <pnode [optional, PNode] 
                    name="floor" [string, optional, 'pobject_{OgreID}']
                    visible="1" [bool, optional, default: true]
                    debug="0" [bool, optional, default: false] >

                    <origin [optional, Ogre::SceneNode]  
                        pos="0,-30,0" [Vector3, optional, Vector3(0,0,0)]
                        dir="0,0,0" [Euler, optional, Euler(0,0,0)]
                        size="600,5,600" [Vector3, optional, Vector3(1,1,1)] />

                    <node [optional, Ogre::SceneNode]  
                        pos="0,-30,0" [Vector3, optional, Vector3(0,0,0)]
                        dir="0,0,0" [Euler, optional, Euler(0,0,0)]
                        size="600,5,600" [Vector3, optional, Vector3(1,1,1)] />

                    <!-- primitive OR mesh must be specified to validate PNode creation -->

                    <primitive [mandatory, Ogre::Entity, overloaded by mesh tag]  
                        type="cube" [enum, mandatory, no default, cube|sphere|plane|empty] />

                    <mesh [mandatory, Ogre::Entity]  
                        group="General" [string, mandatory, no default] 
                        file="obj.mesh" [string, mandatory, no default] 
                        />

                    <bullet [optional, btRigidBody, no default]
                        type="dynamic" [~BT_Type, mandatory, no default, dynamic|static|ghost]
                        shape="compound" [~BT_Type, mandatory, no default, box|sphere|compound|convex|concave]
                        >

                        <!-- mash tag is only parsed if type is dynamic and shape is compound -->

                        <mesh [optional, Ogre::Mesh]
                            group="General" [string, mandatory, no default] 
                            file="obj.mesh" [string, mandatory, no default] 
                            />

                        <config [optional, ~btRigidBody]
                            density="1" [float, optional, 1.0] 
                            friction="0.5" [float, optional, 0.5] 
                            restitution="0" [float, optional, 0.0] 
                            restless="1" [bool, optional, false] 
                            />

                        <damping [optional, ~btRigidBody]
                            linear="0.3" [float, optional, 0] 
                            angular="0.5" [float, optional, 0]
                            />

                        <data [optional, not yet implemented] />

                    </bullet>

                </pnode>

            </pobjects>

        </scene>

    </scenes>

    <!-- compositor configuration is not fully implemented -->

    <compositor [optional, ~PProjectData]>

        <workspace [optional, PCompositorWSData]
            name="custom_workspace" [string, mandatory, no default] 
            >

            <script [optional, PCompositorWSData]
                group="General" [string, mandatory, no default] 
                workspace="compositor_workspace" [string, mandatory, no default] />

            <colors [optional, ~PCompositorWSData]>

                <color [optional, PCompositorWSValue<Ogre::ColourValue>]
                    name="background" [string, mandatory, no default]
                    value="0.8,0.8,0.8" [Ogre::ColourValue, mandatory, no default]
                    node="0" [uint, mandatory if script tag is present ]
                    pass="0" [uint, mandatory if script tag is present ]
                    index="0" [uint, mandatory if script tag is present ]
                    />

            </colors>

            <variables [optional, ~PCompositorWSData]>

                <variable [optional, PCompositorWSValue<float>]
                    name="background" [string, mandatory, no default]
                    value="0" [float, mandatory, no default]
                    node="0" [uint, mandatory if script tag is present ]
                    pass="0" [uint, mandatory if script tag is present ]
                    index="0" [uint, mandatory if script tag is present ]
                    />

            </variables>

        </workspace>

    </compositor>

    <bullet [optional, PBullet]>

        <config [optional, PBulletData]
            gravity="0,-20,0" [btVector3, optional, btVector3(0,-10,0)] 
            maxsubsteps="60" [unsigned int, optional, 10] 
            verbose="0" [bool, optional, false] 
            />

    </bullet>

    <puredata [optional, Puredata]
        edit_mode="0" [bool, optional, false]
        >

        <output [mandatory, ~Puredata] 
            channels="2" [unsigned int, optional, 2]
            sample_rate="44100" [unsigned int, optional, 44100]
            samples="128" [unsigned int, optional, 128]
            audio_driver="pulseaudio" [string, optional, 'pusleaudio' on linux]
            />

        <searchpaths [optional, vector<string>]>

            <searchpath [optional, s```
tring]
                value="../media/sounds" [string, mandatory, no default]
                />

        </searchpaths>

        <edition [optional, ~Puredata]>

            <senders [optional, POscSenderList]>

                <sender [optional, POscSender]
                    ip="192.168.3.67" [string, mandatory, no default]
                    port="25000" [unsigned int, mandatory, no default]
                    max_32bits="1" [bool, optional, false]
                    />

            </senders>

            <receivers [optional, POscRcvrList]>

                <sender [optional, POscReceiver]
                    port="25000" [unsigned int, mandatory, no default]
                    max_queue_size="100" [unsigned int, optional, 30]
                    />

            </receivers>

        </edition>

    </puredata>

    <resources [optional, ~PProjectData]>

        <group [optional, ~PProjectData]
            name="Essential" [string, mandatory, no default]
            >

            <resource [optional, ~PResourceData]
                path="../media/packs/PolymorphTrays.zip" [string, mandatory, no default]
                type="Zip" [string, mandatory, Zip|FileSystem]
                recursive="1" [bool, optional, false, only active with type FileSystem]
                readonly="0" [bool, optional, true]
                />

        </group>

    </resources>

</polymorph>

Free-tags

<spring [optional & not defined location, PBulletSpringData]
    stiffness_linear="0" [float, optional, 0]
    damping_linear="1" [float, optional, 1]
    stiffness_angular="0" [float, optional, 0]
    damping_angular="1" [float, optional, 1]
    enableEquilibrium="false" [bool, optional, false]
    stop_cfm="1.e-5" [float, optional, 0.00001]
    stop_erp="1.e-5" [float, optional, 0.00001]
    limit_linear_min="0,0,0" [btVector3, not defined by default, requires limit_linear_max to be applied]
    limit_linear_max="0,0,0" [btVector3, not defined by default, requires limit_linear_min to be applied]
    limit_angular_min="0,0,0" [btVector3, not defined by default, requires limit_angular_max to be applied]
    limit_angular_max="0,0,0" [btVector3, not defined by default, requires limit_angular_min to be applied]
    />

Updated