User Tools

Site Tools


formats:modules:derigxml:xml_rig_file_.rig.xml

This is an old revision of the document!


Rig File format

The rig file format is recognized by the Rig XML Module. The file is an XML file with a simple structure to define a rig to be used for a component. Rigs are used for two different purpose. First they are used to deform a model using bone weighted vertices. Second they are used to define physics properties for a rig or component collider. The bones in the rig file are connected to each other forming a skeleton starting at one or more root bones. Usually only one root bone is used but depenging on the use of the rig more than one root bone can be specified. The bones are stored in the rig file in their relaxed position hence the position where they have no translation, rotation and no scaling relative to the origin of the entire rig. Physics properties can be specified for the entire rig and/or individual bones. Shapes define the individual enclosing shape for the entire rig and/or each individual bone. Shapes can be simple ( one shape ) or complex ( multiple shapes ) in which case the union of the shapes becomes the final shape.

Structure

TODO: Replace with a grafik of some kind instead.

  • must, once: rig
    • optional, once: author
    • optional, multiple: bone
      • optional, once: position
      • optional, once: rotation
      • optional, once: centralMassPoint
      • optional, multiple: box
        • optional, once: center
        • optional, once: halfSize
      • optional, once: mass
      • optional, once: dynamic
rigDefines the properties of the entire rig.
authorCan be used to store the author of the rig or any other kind of comments.
boneDefines a bone in the rig. Order is not important since the engine determines the correct links between the rig bones. Just do never produce loops as this is going to make the file fail upon loading. Each bone has an attribute “name” with the unique name of the bone. Loading fails if two bones have the same name or an empty name.
positionDefines the position of a bone. Requires three attributes “x”, “y” and “z” for the respective coordinate axis.
rotationDefines the rotation of a bone. Requires three attribures “x”, “y” and “z” for the respective coordinate axis. Rotation is counter clockwise for all axes and is measured in degrees.
centralMassPointDefines the location of the central mass point of the the rig or bone. Requires three attributes “x”, “y” and “z” for the respective coordinate axis.
massDefines the mass in kg of the entire rig or a bone.
dynamicDefines if the rig or bone is kinematic or dynamic. If dynamic it is subject to physics simulation. If kinematic it is driven by user specified linear and angular velocities. Kinematic is best used for rigs which have animations applied. Value is “true” if dynamic behavior is required or “false” otherwise.
boxDefines a box shape.
box.centerDefines the center of a box shape. If not specified (0,0,0) is assumed. Requires three attributes “x”, “y” and “z” for the respective coordinate axis.
box.halfSizeDefines the extends of a box shape. If not specified (1,1,1) is assumed. Requires three attributes “x”, “y” and “z” for the respective coordinate axis. This is not the entire size of the box but the extends from the center to the border ( hence half the size ).

Sample file

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE rig SYSTEM "DragengineRig.dtd">
<rig>
 
	<author>RPTD (roland@rptd.ch)</author>
 
	<bone name="origin">
		<position x="0.0" y="0.0" z="0.0"/>
		<rotation x="0.0" y="0.0" z="0.0"/>
		<centralMassPoint x="0.0" y="0.2" z="0.0"/>
		<box>
			<center x="0.0" y="0.0" z="0.0"/>
			<halfSize x="0.2" y="0.4" z="0.1"/>
		</box>
		<mass>5.5</mass>
		<dynamic>true</dynamic>
	</bone>
 
	<bone name="head">
		<position x="0.0" y="0.6" z="0.0"/>
		<rotation x="0.0" y="0.0" z="0.0"/>
		<parent>origin</parent>
		<centralMassPoint x="0.0" y="0.75" z="0.0"/>
		<box>
			<center x="0.0" y="0.0" z="0.0"/>
			<halfSize x="0.1" y="0.15" z="0.08"/>
		</box>
		<mass>2.5</mass>
		<dynamic>true</dynamic>
	</bone>
 
</rig>

Links

You could leave a comment if you were logged in.
formats/modules/derigxml/xml_rig_file_.rig.xml.1205288507.txt.gz · Last modified: 2008/03/12 02:21 by dragonlord