<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "http://www.web3d.org/specifications/x3d-3.0.dtd" "file:///www.web3d.org/TaskGroups/x3d/translation/x3d-3.0.dtd">
<X3D profile='Immersive' noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-3.0.xsd'>
<head>
<meta name='filename' content='SelectMasterGhostPrototype.x3d'/>
<meta name='description' content='Selector for switching DIS EspduTransforms between Master (write PDUs) and Ghost (read PDUs).'/>
<meta name='author' content='Curt Blais, Don Brutzman, Doug Horner'/>
<meta name='created' content='23 July 2001'/>
<meta name='revised' content='27 December 2002'/>
<meta name='warning' content='under development'/>
<meta name='keywords' content='DIS'/>
<meta name='url' content='http://www.web3d.org/TaskGroups/x3d/translation/examples/DistributedInteractiveSimulation//SelectMasterGhostPrototype.x3d'/>
<meta name='generator' content='X3D-Edit, http://www.web3d.org/TaskGroups/x3d/translation/README.X3D-Edit.html'/>
</head>
<!--

Index for ProtoDeclare: SelectMasterGhost
Index for DEF node: SelectionScript
-->
<Scene>
<ProtoDeclare name='SelectMasterGhost'>
<ProtoInterface>
<field name='makeMaster' type='SFBool' accessType='inputOnly' appInfo='Set makeMaster true in order to make the associated DIS entity a Master.'/>
<field name='makeGhost' type='SFBool' accessType='inputOnly' appInfo='Set makeGhost true in order to make the associated DIS entity a Ghost.'/>
<field name='makeLocal' type='SFBool' accessType='inputOnly' appInfo='Set makeLocal true in order to make the associated DIS entity locally controlled (no networking).'/>
<field name='isMaster' type='SFBool' accessType='outputOnly'/>
<field name='isGhost' type='SFBool' accessType='outputOnly'/>
<field name='isLocal' type='SFBool' accessType='outputOnly'/>
<field name='defaultWriteInterval' type='SFFloat' value='1.0' accessType='initializeOnly'/>
<!-- add other fields here -->
</ProtoInterface>
<ProtoBody>
<Script DEF='SelectionScript'>
<field name='makeMaster' type='SFBool' accessType='inputOnly'/>
<field name='makeGhost' type='SFBool' accessType='inputOnly'/>
<field name='makeLocal' type='SFBool' accessType='inputOnly'/>
<field name='isMaster' type='SFBool' accessType='outputOnly'/>
<field name='isGhost' type='SFBool' accessType='outputOnly'/>
<field name='isLocal' type='SFBool' accessType='outputOnly'/>
<field name='defaultWriteInterval' type='SFFloat' accessType='initializeOnly'/>
<IS>
<connect nodeField='makeMaster' protoField='makeMaster'/>
<connect nodeField='makeGhost' protoField='makeGhost'/>
<connect nodeField='makeLocal' protoField='makeLocal'/>
<connect nodeField='isMaster' protoField='isMaster'/>
<connect nodeField='isGhost' protoField='isGhost'/>
<connect nodeField='isLocal' protoField='isLocal'/>
<connect nodeField='defaultWriteInterval' protoField='defaultWriteInterval'/>
</IS>
<!-- add other fields here -->
<![CDATA[
javascript:

function initialize (timestamp)
{
}

function makeMaster (value, timestamp)
{
  if (value == true)
  {
	// set state and send eventOut values
	isMaster = true;
	isLocal  = false;
	isGhost  = false;
	// other stuff goes here
  }
}
]]>
</Script>
</ProtoBody>
</ProtoDeclare>
</Scene>
</X3D>
<!--

Index for ProtoDeclare: SelectMasterGhost
Index for DEF node: SelectionScript
-->

<!-- Tag color codes: <Node DEF='NodeName' attribute='value'/> <Prototype name='ProtoName'> <field name='fieldName'/> </Prototype> -->