Machines Simulator Editor Help

  • Upload
    jose

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

  • 8/19/2019 Machines Simulator Editor Help

    1/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    inseparably

    Machines Simulator Editor v. 2 . x

    What is Machines Simulator Editor

    and how it works?

      Minimum Requirements

      Keyboard Layout

      Program Interace

      !"tions

      #om"onent Editor Mode

      Machines Editor Mode  #om"onents Selection Mode

      World !b$ect

      #om"onents Library

      WorkParts  Media Library

      Windows %esigner

      Ruler  Programming Reerence

      Installations

      &ser%eined#om"onents  Physics

      'ools  E(am"les

       )""endi(

      More 

    C o n t e n t s

    The Complete Simulation Tool for Automatism Practice, Training and Simulation.

    Machines Simulator Editor Guide

  • 8/19/2019 Machines Simulator Editor Help

    2/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    What is Machines Simulator Editor and how it works? 

    Machines Simulation Editor is a part of the EasyPLC Software Suite. This suite is designed to make, simulate, practice and learn

    logic programs to control automatism.Machines Simulator offers a virtual ! world with real time graphics, sounds and physics where the PLC programs can "e tested.

    These programs can "e done with EasyPLC or with any other PLC system.

    #ith the $egistered version, you can create with the Editor module your own installations with the machines and%or

    components availa"le in the Editor li"rary or you can create your own devices with the component Editor availa"le inside the

    Machines Simulator Editor.

    Machines Simulator Editor, hereinafter Machines Editor, is a easy to use tool, where you can create easy, medium or comple&

    mechanical systems, with mechanical, electrical, electronic components assem"led on it, to later "e programmed with EasyPLC

    and check your a"ility in the PLC programming.

    'lso you can replicate physical real systems to "e programmed in a virtual way and avoid to damage the real system, or your can

    start programming and verifying your program (E)*$E the system will "e fa"ricated.

    )or this and much more reasons Machines Simulator + EasyPLC are a tool not only useful for students or "eginners in PLC

    programming and automation, for the professionals can "e a very appreciate tool.#ith Machines Editor you can create a machine or a collection of machines or devices ready to work together or in a separately

    way, for this reason we call an -nstallation a system created "y Machines Editor, composed "y different types of components.

    Machines Simulator has two different work modes, !esign Mode and $un Mode. -n !esign Mode, all the components are fi&ed

    on the screen placed in the position where the user has located it, the user can move the components with the /eypad

    numeric%cursor /eys and the physics engine of Machines Editor is stopped, you must use this mode to create your installation. -n

    $un Mode, the physics system is running and the components will respond to gravity, and you can force the PLC outputs and see

    the PLC inputs to check the machine components "ehavior, in this mode it is not allowed to change the position or properties of

    the components. 0se this mode to check the operation of your installation.

    Minimum Requirements

    Processor: Pentium -1 or 'M! /2

    RAM: 342 M".

    Disk Space: 56 M" of free disk space.

    Graphics card: !irect7 8.6 compati"le with a minimum of 9:M( of memory and verte&%pi&el shader 3.3

    Operative System: #indows 7P service Pack 4, #indows 1ista, #indows ; or #indows 2.

    ' Sound card installed is necessary.

  • 8/19/2019 Machines Simulator Editor Help

    3/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    Keyboard Layout

    /ey"oard usage<

    = /ey #< move camera forward

    = /ey S< move camera "ackward= /ey '< move camera to left

    = /ey !< move camera to right

    = /ey >< move camera up

    = /ey E< move camera down

    = /ey C< rotate camera to right

    = /ey ?< rotate camera to left

    = @umeric keys< -n stop Mode A6 to 9B activates the components movement + rotation mode. -n $un Mode A6 to 8B automatic

    camera movement to predefined camera positions Adefined in the EditorB. #ith 6 /ey, automatic camera trip over the

    predefined camera positions Adefined in the EditorB.

    @umeric Pad /eys<

    : Move selected component to left. 9 Move selected component to right.

    2 Move selected component to up.

    4 Move selected component to down.

    8 Move selected component to forward.

    3 Move selected component to "ackward.

    5 $otate selected component in anticlockwise.

    ; $otate selected component in clockwise.

    = !elete /ey< deletes the selected component.

    )unction /eys<

    = )4< toggle the free%step mode selected component movement.

    = ) to );< Moves camera to 0pper, )ront, (ack, Left and $ight positions.= )8< -n Edit mode, shows the installation programming code Afor machines and 0ser !efined ComponentsB.

    = )34< -n $un mode save a screen shoot a"out the installation.

    0se the mouse to move free for the ! word, pressing the right "utton, you will move the camera to leftright, updown and

    com"ining with the #,S,',! keys you will "e a"le to move in a fly style camera. Pressing the Space /ey, the camera speed will

    increase 5 times, with Left Shift will increase 36 times, and pressing left alt will decrease 36 times Afor accuracy positioningB.

    #hen the -nstallation is in $0@ Mode, press Left mouse "utton to take the #orkParts, and move mouse wheel to "ring + move

    away the picked o"Dects Apress left control to "lock parts in air, then rotations are not allowedB.

    -n Edit Mode use mouse to select elements, when click over a component this will "e selected, press SC'PE key to deselect it

    and continue searching for new components.

  • 8/19/2019 Machines Simulator Editor Help

    4/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    Machines Editor Program Interface

    The Machines Editor Program -nterface has the following components<=  Menu (ar< where are availa"le the main program options.

    =  Tool (ar< where you find the most used functions.

    =  -nstallation Components Tree< used to choose one "y one of the components of your installation.

    =  Property rid< used to customiFe the components.

    =  Components Li"rary + 0tilities< Gere you will find the components li"rary used to create your installations and some

    useful utilities.

    =  ! #indow #ord< The main component, here is the world where you "uild your installations.

    =  Status (ar< Gere you find some important information a"out the program features and status.

  • 8/19/2019 Machines Simulator Editor Help

    5/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    Menu Bar

    The following items are availa"le<

    = )ile

    = *ptions

    = Tools

    = Gelp

    *ile Menu

    = @ew< creates a new installation.

    = *pen< open a created installation.

    = Save< saves the current installation

    = E&it< e&it from Machines Editor.

    !"tions Menu

    = Copy Selected -tem< copies the current selected component.

    = Paste -tem< pastes the previous copied component.

    = Sounds Li"rary< here are listed all the availa"le sounds for yours components.

    = Change Editor $esolution< use it to change the screen resolution.

    = Preferences< use this option to customiFe the Machines Simulator environment.

    'ools Menu

    = -%* $eport< use this tool to see the analogic%digital inputs%outputs used in your installations, using this tool you are saved to

    repeat used signals.

    = #indows !esigner< tool to design 4! windows in the installations.

    = Show $uler< ena"ling this option a ruler is shower to make distances measurements.

    Gelp Menu<= Gelp< access to this guide.

    = '"out< information a"out your Machines Simulator Editor version.

    Note: Files types accepted y Machines Simulator

    -n the menu )ile H *pen menu option, you can choose "etween two kind file types, maq+ and m,"+ files. The maq+ files are the

    default option, and allow opening your created installations, that uses the media content, Models and Te&tures availa"le in your

    Machines Simulator #ontent folder. The m,"+ files are installations that contains their own media content, that could not "e

    present on your #ontent folder, then when you open one of this files, automatically, the installation maq+ file is copied in your

    MyMachines folder and all the media content used "y these installations in copied on the respective folders.

    The same actions occur for the Components Editor mode, you can open the cm"+ file that contains the component using youravaila"le media content, or you can open the c,"+ file that will copy the component and the media content in their respective

    folders.

    Iou can o"tain the m,"+ and c,"+ files from the www.nirtec.com we" site download section, or you can create your owns files

    Asee the 'ppendi& sectionB.

  • 8/19/2019 Machines Simulator Editor Help

    6/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    !oolBar

    'vaila"le commands<•  Create @ew Machine

    •  *pen Machine

    •  Save Machine

    •  Gide Left Panel

    •  1iew installation Aor 0ser !efined ComponentsB script code.

    •  Tool(ar Components Movements + $otation Controls.

    •  Start Testing -nstallation

    •  Stop Testing -nstallation

    •  Change to Machines Editor Mode.

    •  Change to 0ser !efined Components Mode.

    •  )or )or 0ser !efined Components Mode<

    o  Create new 0ser !efined Component.o  *pen 0ser !efined Component.

    o  Save 0ser !efined Component.

    o  'dd new component in 0ser !efined Component.

    o  !elete component in 0ser !efined Component.

    •  E&it Program

    !oolBar "omponents Movement # Rotation "ontrols

    )rom version 3.2 is possi"le to use new Tool(ar controls to move and rotate components.

    *nce a component is created or selected, the availa"le moving + rotating options are ena"led in the tool"ar

  • 8/19/2019 Machines Simulator Editor Help

    7/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    The options are<

    = Move component in I a&is A0p + !ownB, press 3 key to fast activation.

    = Move component in 7 a&is ALeft + $ightB, press 4 key to fast activation.

    = Move component in ? a&is A)ront + (ackB, press key to fast activation.

    = $otate component in I a&is, press : key to fast activation.

    = $otate component in 7 a&is, press 5 key to fast activation.

    = $otate component in ? a&is, press 9 key to fast activation.

    To move or rotate a component, click on the desired tool"ar "utton and press left mouse "utton, then move 0p !own or Left J

    $ight the mouse and the selected component will "e moved or rotated according the selected option.

    'lso is possi"le to use the keypad arrow keys to move with more precision.

    "omponents $irary # %tilities:

    Gere you find different ta"s with the availa"le Components Li"rary and some tools.

    Lets see the availa"le ta"s<

    = Components< there are two different sections, the Components that are the predefined

    components packed with Machines Editor and the 0ser!efined Components, this are the

    components made with the Components Editor, totally programma"le and customiFa"le "y

    the users.

    = #orkParts< The #orkPart concept is important to "e understood, "ecause is one of the

    main o"Dects in the installation. #e use a workpart to define a component that always is

    mova"le Aaffected "y the gravityB, and the installation % machines uses it to different

    porpoises, for e&ample a "ottle in a packing machine, a "o& in a transportation system,

    etc.. 0sually the workpart is the element managed "y the installation and the operations

    and%or works done on it are the cause of the installation. The -nstallation usually uses a lot

    of workparts, for this reasons the workparts must to "e created and destroyed along the life

    of the system. To do this works are designed the #orkParts Management components,with this components you will "e a"le to create, modify or destroy the workparts availa"le

    in your installation.

    = Cameras< -n our installation could "e useful to place cameras in some hot points to

    access Kuickly to it, with this utility we can do it very easy, when you are in the desired

    point seeing the desired o"Dective press over the Position grid to save the camera position

    and target. Later in $un Mode you can access to this positions pressing the

    3,4,,:,5,9,;,2,8 keys, you can save until 8 positions. 'lso are a auto trip function,

    when you are in $un Mode, and press the 6 /ey, the system will travel automatically "y

    the defined points seKuentially, this way all the installation can "e saw without use the

    key"oard.

  • 8/19/2019 Machines Simulator Editor Help

    8/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    Options

    -n *ptions menu is possi"le to configure<

    &ditor

    Move elements fi& to grid if selected the components will "e moved very slowly, useful to place the components with accuracy

    in the final position. Iou can toggle this mode on%off pressing the )4 key while working in the Editor. -s possi"le to change the

    grid step and rotate step Kuantity.

    PLC Simulator< here are configured the num"er of analogic%digital -nputs%*utputs to "e read%write from EasyPLC. -s

    recommended to use the minimum reKuired num"er in order to o"tain the ma&imum communication speed.

    Logic Program< if E&ecute in safe mode is ena"led, the program will inform a"out the script code errors made "y the users, if not,

    when an error appears the program will crash. -f this option is not selected, the installations consume fewer resources.

    Sound Effects< ena"les%disa"les the sound.

    Ena"le ! Sound< ena"led%disa"les the ! Sound, if this option is ena"led the sound will have a positional effect, this means

    that will "e changed the volume and the "alance Afor two, four, five or seven speakersB in function where the camera will "e

    positioned regarding the sound source.

    Miscellaneous< here is possi"le to change the camera movement speed and the collisions. -f collisions are ena"led the camera

    will hit with the physical elements and will not advance, if is not selected, the camera can pass across the physical elements.

    "omponents editor

    Gere is possi"le to change the "ackground color of the Components Editor module.

  • 8/19/2019 Machines Simulator Editor Help

    9/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    Component Editor Mode

    -ts very difficult to provide all the machines, components, systems, devices needed to cover the entire user reKuirements, for

    e&ample in each type of industry are used different types of components, we would need thousands of components to "e a"le

    to create all the possi"le installations.(ut the solution its the Components Editor, where the users can create their own components and give the desired "ehavior to

    interact with the installation. These are the 0ser !efined Components.

    'll the created components can "e shared with all the users. 1isit often the www.nirtec.com we" site to download new

    components.

    "omponent &ditor 'nter(ace

    To go to the Component Editor select Components Editor Mode form the *ptions Menu or make click on the Components Editor

    Tool"ar icon

  • 8/19/2019 Machines Simulator Editor Help

    10/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    #hen the Component Editor mode is active, the "ackground is "lue, in the -nstallations Components Tree the elements

    components are listed and can "e selected, the Property rid is referred to the selected component element and the

    Components Li"rary and 0tilities ta"s are disa"led.

    To create new components click the Create @ew Component -con from the Tool"ar<

    Then a (lue "o& will "e created in the center of the world. The 0ser !efined Components are a set of one o more "o&es, each

    one could have their own properties and can have a special "ehavior. Then a created component will "e a group of "o&es, that

    they were related among them and with the rest of the e&istent components in the installation, in function of their propertiesand the component e&ecution code. *"viously, these "o&es can "e customiFed in order to take the correct appearance for the

    point of view of the users, using the model, te&ture and scale properties Aand much otherB.

    To add new "o&es to the component click on the 'dd Element icon from the Tool"ar<

    To remove an e&isting component "o&, click on the $emove Element icon from the Tool"ar.

  • 8/19/2019 Machines Simulator Editor Help

    11/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    "omponents element Properties:

    Each "o& element has some specific properties, and others common for the all component elements. 'll the properties down

    the (o& Properties category are specific for the "o& element the Common Properties and PLC categories are common for all the

    component "o&es, the System Light are also specific for each "o& element. Lets see the all availa"le properties<

    Box Properties

    = (o& -nde&< *nly read property, this is an identifier num"er used to select this element in

    the all component elements.

    = (o& !escription< The description name for this particular "o& element.

    = (o& Scale< the scale for this particular "o& element.

    = Collisiona"le< selects if this "o& element will "e integrated in the Collision Physics System, in order to have a "ody that can

    collide with other collisiona"le o"Dects.

    = -mmova"le< T$0E if no gravity is applied to this "o& element, then will "e fi&ed in the designed position, if is )'LSE this "o&

    element will respond to e&ternal forces and gravity.

    = -nvisi"le< -f true this "o& element will "e not visi"le "ut will "e collisiona"le.

    = Mass< float precision value to set the "o& element mass.

    = Material properties< Three values are set on this property, the elasticity A7 valueB, the static roughness AI valueB and the

    dynamic roughness A? valueB.

    = Model< 0se this property to set a model from the models li"rary to this "o& element, "y default the model is a "lue cu"e.

    = Model Position< used to change the model position a"out the "o& position.

    = Model Scale< use this property to adDust the applied model scale to the element desired scale.

    = Position< sets the "o& element position.

    = $otate< sets the rotation on I a&is.

    = $otation 7< sets the rotation on 7 a&is.

    = $otation ?< sets the rotation on F a&is.

    = Shape< sets the element shape A(o&, Sphere, Cylinder, CapsuleB.

    = $adius< sets the shape radius Aonly if the shape property is set to Sphere, Cylinder or CapsuleB.= Length< sets the shape length Aonly if the shape property is set to Cylinder or CapsuleB.

    = StaticModel< if true this "o& component has the collision skin of the selected Model instead of a "o& shape. Conditions<

    -mmova"le false and #orkPart false.

    = Te&ture< sets a new te&ture for this element form the te&ture li"rary.

    = Transparent< if true this element will "e transparent like the glass. To use this property "efore you must set a model to the

    model property.

    = 1iew (o&< if T$0E a cu"e shows the "o& element siFe, only applica"le in development mode, in order to help to "uild your

    component.

    = 1isi"le< only used in development mode, if )'LSE, this element "o& is hiding, useful to check the assem"ly "etween elements.

    Common Properties

    = Category< Gere you can select a category where this Component appears in the Components Li"rary Tree.

    = Code< Gere is programmed the component "ehavior. -n the Code are four methods<

    -nitAB, MainAameTime gameTimeB, !rawAameTime gameTimeB and )inishAB. The -nit method only is e&ecuted once, when the

    Machines Editor starts in $un Mode, A-n Machines Simulator when a Machine is loadedB, the Main and !raw methods are

    e&ecuted cyclically while the Machines Editor is in $un Mode, and finally the )inish method is e&ecuted once when the

    Machines Editor finish the $un Mode. To know more a"out the Machines Editor Programming see the Programming $eference

    section.

  • 8/19/2019 Machines Simulator Editor Help

    12/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    = Component @ame< Gere you can write the component name that appears in the Components Li"rary Tree.

    = E&ecute Code< if this property is T$0E this component code will "e e&ecuted, if is )'LSE will "e not e&ecuted.

    = E&ternal $eferences< List with the e&ternal li"raries used "y this component AoptionalB.

    = -nfo< -nformation te&t useful for all the persons who are going to use this component.

    = oint List< 0se this property to link elements "etween them, a oint is an invisi"le union "etween two elements. To create aoint make click on this property and press the 'dd "utton on the oint Collection #indow

  • 8/19/2019 Machines Simulator Editor Help

    13/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    )oints Properties:

    (ody'ttached< the "o& element inde& that is linked to the main "o& element.

    (ody*rigin< the main "o& element inde&.

    '&is< where will "e set the link if is horiFontal left to right will "e 7 a&is A366B if is 1ertical will "e I a&is A636B and if is

    horiFontal "ack to front will "e ? a&is A663B.

    Ena"led< must "e to T$0E to ena"le the oint.

    Position< its the oint position related to the main "o& element.

    = Parameters< your components can have different parameters to "e used in the component code, for e&ample, speed, siFe,

    width, etcN the parameters are a set of a string description and a numeric AfloatB value. The string description is the key to

    access to this parameter in the component code. ACommon for all elementsB.

    = Scale< Sets the lo"al component scale. This scale will multiply all the component "o&es scales.

    = #orkPart< used to indicate if this component will "e a #orkPart.

    P$" Properties

    = PLC 'nalogic -nput List< -s a collection with the analogic inputs used "y this component.

    = PLC 'nalogic *utput List< -s a collection with the analogic outputs used "y this component.

    = PLC -nput List< -s a collection with the inputs used "y this component.

    = PLC *utput List< -s a collection with the outputs used "y this component.

    System $i*ht +Material properties,

    0se these properties to customiFe the appearance of the component. Setting these properties correctly you will

    create the materials desired.

    = 'm"ientLightColor< !efines the colour of the am"ient light, which illuminates all sides of all o"Dects eKually. 'm"ient light is a

    "ackground light that has no source. The am"ience is created "y light "ouncing off surrounding o"Dects in all directions.

    = !iffuseColor< !efines the colour of the am"ient light, which illuminates all sides of all o"Dects eKually.!iffuse light defines how a source light colours and "rightens materials in its path. !iffuse light increases as the angle "etween

    the light and surface normal decreases.

  • 8/19/2019 Machines Simulator Editor Help

    14/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    = EmissiveColor< ets or sets the emissive colour for a material, the range of colour values is from 6 to 3. Emissive light is light

    that is coming from the surface itself.

    = Shadow< Ena"les%disa"les the shadow for this component, Athe general shadow ena"le must "e done in the world elementB.

    = SpecularColor< The specular light defines a materials shininess, gloss, or highlights. Specular light reflected from a surface

    depends on the viewers angle to the surface and the lights angle to the surface. lass, water, metal, and some plastics have

    high specular levels. Earth, concrete, and dull colored materials have lower specular levels. Gere are some points to keep in

    mind< Specular light is like a highlight that makes an o"Dect shiny. Specular light is used for simulating shiny, plastic, glossy,

    or metallic o"Dects.

    = SpecularPower< ets or sets the specular power of this effect material. Controls the focus of the specular highlight. Smaller

    values produce a softer, more "lurred highlight, while higher settings give a smaller and tighter glint.

    #ith Machines Editor are availa"le some 0ser !efined Components, you can open with the Component Editor to investigate

    how are configured and programmed, here you have a "ase to see some of the multiple possi"ilities.

    *nce you have created and saved a 0ser !efined Component, this will "e availa"le in the Machines Editor, in the Components

    Li"rary, in the 0ser!efined Components section<

    The 0ser !efined Components are located in a file with cmp e&tension all the availa"le user defined components are located

    in the folder Components of the Machines Simulator Main )older. -f you wan to share your user defined components or want

    to install new ones you can copy%paste the files from this folder.

  • 8/19/2019 Machines Simulator Editor Help

    15/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    Machines Editor Mode

    (y default when Machines Editor starts, the Machines Editor mode is active. #hen the program is in the Components Editor

    mode you can toggle to Machine Editor clicking in the Machines Editor tool"ar icon<

    #e call an installation a system where is located your machine%s, this installation resides in a file with maK e&tension located in

    the MyMachines folder, you can share or add more machines copy%paste maK files from%in this folder.

    -n the following e&ample, the installation is called $o"otiFed Line and is the root of a tree composed for all the components

    availa"le for this machine<

    'n installation could not "e only a simple machine, could "e a comple& system of multiple machines or can "e a uniKue machine.

    The system is fle&i"le for your needs.

    'n -nstallation has some particular properties, there are<

    = 'uthor< -nformation field, here the author installation can "e set.

    = Characteristics< used to descri"e some installation features, like the components elements.

    = !escription here you can type some useful information for the persons who will use your

    machine, like the machine o"Dective, the difficult level, etcN

    = E&ternal $eferences< List with the e&ternal li"raries used "y this installation AoptionalB.

    !ifficulty Level< here you can classify your machine in three levels< Easy, Medium or Gard.

    -mage Preview< -n run mode of you press )34 /ey a screen shoot a"out the machine will "e saved, and can "e preview in

    Machines Simulator program.= -nstallation name< this property will name your machine and the maK file name.

    = Logic Program< here you can program particular "ehaviour of your installation, this function only must "e used when you want

    to set a special "ehavior. To know more a"out the programmings see the Programming $eference section.

    'll the information fields will "e showed on the Machines Simulator program, in the machines selection page.

  • 8/19/2019 Machines Simulator Editor Help

    16/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    To add components to your installation you must make dou"le click on the li"rary components, you can choose from the

    predefined ones or form the used defined components<

    #hen a new component is added to the installation, its added to the installations components tree and is selected. #hen acomponent is selected a red wire frame is on the component and this means that their properties can "e changed. To change

    their properties you must use the Property rid<

    #hen a new installation is created, a special component also is created, the world. This component is the landscape showed in

    your installation and can "e an outer landscape or a inner room. This component has properties to choose form a set of

    different landscapes, and also can "e customiFed with your favourite te&tures.

    #hen a component is selected you can use the cursor%numeric key pad keys to move around the world. 0se : and 9 to move ii

    in the 7 a&is, 2 and 4 to move it in the I a&is and 8 and 3 to move it in the ? a&is. 0se 5 and ; to rotate in anti clock wise or

    clockwise senses.

    Press )4 key to toggle "etween free and step movement mode, use free mode to move Kuickly and step mode to "e more

    precise.

    #ith delete key a selected component can "e removed from the installation.

    To select an e&isting component you must make dou"le click on the -nstallations Components Tree, then the component will "e

    ready to modify or delete.

  • 8/19/2019 Machines Simulator Editor Help

    17/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    #hen you want to test your installation, press the $un Machine tool "ar icon, then the !esign Mode will "e leaved and the $un

    Mode will "e activated, in this mode the physics engine will "e active and you can test your machines "ehaviour. -n this mode

    its not allowed to change the components properties, and in the property grid will appear a grid with the availa"le digital

    outputs ready to "e simulated "y the user pressing over the desired one with the mouse<

    -n the "ottom side, we can see the status of the analogic%digital PLC inputs, useful to see if a photocell is "eing activated, an

    inductive switch is *n, etcN 'lso we can see and modify the analogic outputs simulating the analogical connection "etween the

    PLC and the machine to e&change numeric values

    'MPOR!AN!: in the Machines &ditor there are not communication et-een the installation and the &asyP$".

    Press Stop Machine tool "ar icon to leave the $un Mode and return to design mode.

  • 8/19/2019 Machines Simulator Editor Help

    18/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    &ditor Selection Mode:

    (y default, in Editor Mode, the mouse is in searching components mode, seeing a magnifying glass icon in the "ottom status "ar<

    This means, that when the mouse pass over components these are highlighted in red color.

    -f users make left click over the component when are highlighted, then are automatically selected<

    Then the component properties are showed in the left grid, and the component is also selected in the @ode tree.

    The component name appears in the "ottom left side and in the status "ar<

    Then, now the system is not searching components due is one selected, and passing the mouse over other components are not

    highlighted.

    -n order to star again to search components the user must to press ESC'PE key.

  • 8/19/2019 Machines Simulator Editor Help

    19/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    World Object

    #hen an installation is created a special o"Dect is created automatically< the world o"Dect. This element will

    show the environment of our installation, and could "e fully customiFe in order to create our desired

    installation "ackground.@ow are e&plained all the properties of the world o"Dect<

    /orld General Properties:

    = '&is< only in editing mode, used to show the 7 AredB, I AyellowB , ? A"lueB a&is in ! space. The color

    intensity shows the sign of the coordinates Adarker color positive, lighter negativeB.

    = rid< only in editing mode, shows a grid in the floor.

    = $oom< if true the world "ecomes a room with one floor, four walls and one roof, if false is an open

    place.

    = $oom Geight< only useful is $oom is true, defines the room height.

    = $oom #idth< only useful is $oom is true, defines the room width.

    = Sky(o& Type< only used is $oom is false, defines the world te&tures.= Tile round< defines the times to repeat the te&ture of the floor.

    = Tile $oof< defines the times to repeat the te&ture of the roof Aonly for $oomB.

    = 1isi"le< if false the world o"Dect is not visi"le.

    /orld "ustomi0e:

    -f a room is defined or an open place, the world te&tures can "e defined in order to create our customiFed

    environment.

    = (ack Te&ture< define the te&ture showed in the south position.

    = )loor Te&ture< define the te&ture showed in the floor.

    = )ront Te&ture< define the te&ture showed in the north position.

    = Left Te&ture< define the te&ture showed in the west position.= $ight Te&ture< define the te&ture showed in the east position.

    = Sky Te&ture< define the te&ture showed in the sky or roof.

    /orld &((ect:

    0sing this properties special effects can "e added to our world.

    = (loom Effect< The effect produces fringes Aor feathersB of light around very "right o"Dects in an image,

    o"scuring fine details

    = )og Color< defines the color of the fog Aif ena"ledB.

    = )og Effect< ena"les%disa"les a fog effect.

    = )og End< used to customiFe the fog effect, this value is where the fog ends.

    = )og Start< used to customiFe the fog effect, this value is where the fog starts.

    = round Length< defines the length of the floor.

    /orld $i*ht:

    These properties are used to give light to the ground, then is possi"le to customiFe the ground material

    type.

    = 'm"ientLightColor< !efines the colour of the am"ient light, which illuminates all sides of all o"Dects

    eKually. 'm"ient light is a "ackground light that has no source. The am"ience is created "y light "ouncing

    off surrounding o"Dects in all directions.

    = !iffuseColor< !efines the colour of the am"ient light, which illuminates all sides of all o"Dects eKually.

    !iffuse light defines how a source light colours and "rightens materials in its path. !iffuse light increases

    as the angle "etween the light and surface normal decreases.

    = EmissiveColor< ets or sets the emissive colour for a material, the range of colour values is from 6 to 3.

    Emissive light is light that is coming from the surface itself

  • 8/19/2019 Machines Simulator Editor Help

    20/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    /orld $i*ht +cont.,:

    = SpecularColor< The specular light defines a materials shininess, gloss, or highlights. Specular light reflected from a surface

    depends on the viewers angle to the surface and the lights angle to the surface. lass, water, metal, and some plastics have

    high specular levels. Earth, concrete, and dullcolored materials have lower specular levels. Gere are some points to keep in

    mind<

    Specular light is like a highlight that makes an o"Dect shiny. Specular light is used for simulating shiny, plastic, glossy, or metallic

    o"Dects.

    = SpecularPower< ets or sets the specular power of this effect material. Controls the focus of the specular highlight. Smaller

    values produce a softer, more "lurred highlight, while higher settings give a smaller and tighter glint.

    /orld $imits:

    #ith these properties is possi"le to limit the camera navigation in our installation.

    = Camera (ack< defines the south limit position of the camera.

    = Camera !own< defines the lower limit position of the camera.

    = Camera )orward< defines the north limit position of the camera.

    = Camera Left< defines the west limit position of the camera.

    = Camera $ight< defines the east limit position of the camera.

    = Camera 0p< defines the upper limit position of the camera.

    /orld Shado-s:

    0sing these properties is possi"le to add shadows effects in our installations. The shadows can "e used with most components,

    and only affects to the ground Anot with others elementsB.

    = Ena"le Shadows< if false no shadow is showed for all components, if true is showed the shadow of the components with

    shadow property to true.

    = Shadow Light !irection< defines the shadow direction for all components, using this property you can define the position of the

    light that generates the shadow.

  • 8/19/2019 Machines Simulator Editor Help

    21/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    Components Library

    #ith your Machines Editor program are packed a set of components ready to use. Some of them are very specific and others are

    more general and can "e used for a lot of possi"ilities "ecause are a lot of customiFa"le.

    )ollowing a description of each one of the components is e&plained and the more general components are e&plained moredetailed.

    These categories are availa"le, inside of them are one or more components, lets see all of them<

    = Inductive Switches

    3. 'nductive S-itch< -s used to detect #orkParts, uses one PLC input that will "e active when a #orkPart is

    detected on the inductive detection field. The detection field can "e customiFa"le.

    = Sensors

    3. "apacitive S-itch< -s used to detect #orkParts whose type matches with the programmed values types, uses one

    PLC input that will "e active when a #orkPart is detected on the inductive detection field and their type matches with

    the programmed ones, in this way can simulate different #orkPats materials. The detection field can "e customiFa"le.

    = Light Indicators

    3. Beacon $i*ht< can "e used to inform the user a"out the status of the machine like the work status Amanual,

    automaticB or some error status, uses three PLC outputs.

    4. Siren< used to show some kind of errors. 0ses one PLC output.

  • 8/19/2019 Machines Simulator Editor Help

    22/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    = Mechanical Elements 

    -n this category all the components are consider special "ecause can "e used for a multiple uses, using correctly their

    properties give you many possi"ilities to "uild your machine<

    3. Plane< is a plane that could "e used for a multiple uses, could "e collisiona"le or not, you can change their te&ture to

    customiFe to your needs Apng files with transparencies are admittedB.

    4. Plane Movin* !e1ture< Plane component with a customiFa"le te&ture that could "e moved "y a PLC input%output.

    0seful to make "elts, or moving elements.

    . Dynamic &lement< is a component that is affected "y the gravity, can "e moved "y others elements or forces and

    can "e Doined to others dynamic elements or static elements.

    :. Static &lement< is element that is not affected "y gravity or "y the action of e&ternal forces, always is collisiona"le

    with other components. Can "e Doined with dynamic elements.

    5. Static Model< the static model can "e a simple model form the models li"rary used to "e simple decoration or can "e

    a comple& collisiona"le model used to interact with the mova"le components. -f is colisiona"le means that can not "e

    moved during the $un Mode.

    = Mechanical Switches 

    3.  Pro1imity S-itch< it is used to detect #orkParts, uses one PLC input that will "e active when a #orkPart touch onthe sensor.

    = Cameras 

    3. "amera< it is used to detect the #orkPart type that is present on the camera target, uses one PLC output that is the

    command to start to work and one PLC data stack where will "e written the workpart type detected "y the camera. The

    detection field can "e customiFa"le.

    = Photocells 

    3. Photocell< it is used to detect #orkParts, uses one PLC input that will "e active when a #orkPart is detected on the

    photocell detection field. The detection field can "e customiFa"le.

    4. Photocell Barrier< used also to detect #orkParts, uses one PLC input that will "e active when a #orkPart is detected

    on the photocell "arrier. The "arrier height + width can "e customiFa"le.

    = Robots

    3. 2 A1is Gantry< it is used to transport #orkParts with micrometric precision, uses nine PLC data stack elements to set

    a&is coordinates, two PLC inputs to read some signals and seven PLC outputs to give orders. The gantry height and

    width can "e customiFa"le.

  • 8/19/2019 Machines Simulator Editor Help

    23/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    4. Articulated Root< it is used to move #orkParts with micrometric precision uses thirteen PLC data stack elements to

    set a&is coordinates and speed, one PLC input and one PLC output. The speed and detection distance can "e

    customiFa"le.

    = Transporters<

    1. Conveyor Belt: it is used to transport WorkParts, uses one PLC output to active the conveyor.

    4. 4. "onveyor< it is used to transport #orkParts, uses two PLC output to move the conveyor in two

    different senses.

    .  "onveyor Stop< used to stop #orkParts moved "y the conveyor, uses one PLC output.

    :. &levator< used to lift and move #orkParts, uses three PLC inputs and si& PLC outputs.

    5. )oin !ale< used to move #orkParts in two senses, uses four PLC input to detect theworkparts and eight PLC outputs to move the stops and the rollers.

    9. !urn !ale< used to move #orkParts with micrometric precision, uses one PLC data stack element, two PLC inputs

    and seven PLC outputs.

  • 8/19/2019 Machines Simulator Editor Help

    24/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    = Special Eects.

    -n this category we can select a variety of components useful to add special effects to our installations.

    3. SmokeF3< this effect is used to create smoke.

    4. FireF3< effect used to create fire.

    . /aterF3< effect used to create water in movement.

    :. &1plosionF3< effect used to create e&plosions.

    5. /ater< effect used to create water Alike sea, deposit, ...B

    9. Billoard< draws a te&ture that always is facing the camera.

    )rom version 3.9 you can use the External Components. These components are files with e&tension .dll that are placed in the

    root folder of Machines Simulator.

    This utility allows to give more e&tensi"ility to the software due can "e added special components with the desired "ehavior to

    our installations, only coping the e&ternal component li"rary in the main folder of Machines Simulator.

    Check periodically the www.nirtec.com we" site in order to download new e&ternal components, or suggest the component

    youd like to use in Machines Simulator.

    #ith machines Simulator 3.9.4 is distri"uted the following e&ternal components<

    = $oute Editor Alocated in the Miscellaneous categoryB< allows to create special paths for our components Aor modelsB creating

    the needed position points with the associated control points in order to create the paths following the rules of the (eFier

    curves.

    = @ormal Mapping Alocated in the Shaders categoryB< allows to create planes or other kind of models using a graphic techniKue

    called normal mapping, which also greatly improve the realism of many ! o"Dects, especially if they have a lot of structure on

    the surface and many little details, riffs, tu"es, ca"les, and so on that would cost many million of polygons to display all those

    details correctly.

    = $eflections Alocated in the Shaders categoryB< allows creating models with a reflection effect like where made of a "rilliant

    metal or glass. The users can choose a sky "o& map to "e reflected on the model.

    = Cu"eSky(o& Alocated in the Environment categoryB< allows to add new Sky "o&es to our installations using the !irect7 dds files

    containing sky"o&es.

    = *cean Alocated in the Environment categoryB< creates an ocean effect to simulate water.

  • 8/19/2019 Machines Simulator Editor Help

    25/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    WorkParts

    The #orkParts will "e the elements to "e managed in your installations and used "y your machines, always will "e affected "y

    the gravity and "y forces applied "y the others components. -n one installation you can have as many #orkParts as you need

    and as types as you need. The #orkParts uses resources of your system "y this reason you must to manage them in order to not

    overload your system and slow your installation. To manage them you have four specially components, the #orkPart Creator,the #orkPart !estructor, the #orkPart Modifier and the #orkPart Translator.

    The #orkPart Creator component will create the #orkParts in the position that you define and when the PLC output or input

    that you select will "e on. The #orkPart !estructor will destroy the #orkParts when they collide with it, releasing the workpart

    resources. The #orkPart Modifier will destroy the selected type workpart if collide with it and will create the selected type

    workpart, finally the #orkPart Translator is composed "y two elements the emitter and the receiver, when a workpart will

    touch the receiver automatically will "e send to the emitter location, without create or destroy any workpart Auseful for 0ser

    !efined workparts that have a high cost in loading task, then no delay is happenB.

    #ith the Component Editor you can design also your own #orkParts, this can "e more ela"orated, and they can "e made up of

    different united elements "y means oints. To do it you need to set the 0ser !efined Component #orkPart property to true.

    )ollowing lets see the #orkParts properties<

    = -dentifier< its an only reada"le property used to know the id num"er of this element in the

    installation.

    = Check Precedence< if true the #orkPart will stop when collides with a previously created #orkPart,

    if false will push them.

    = !escription< component name description.

    = Load< if you want that this #orkPart will "e loaded when the Machines Simulator start this installation Aor the Editor pass to

    $un ModeB set this property to T$0E. -f is )alse only the #orkParts Creator component can create this kind of workpart.

    = Mass< sets the #orkPart mass.

    = Material Properties< Three values are set on this property, the elasticity A7 valueB, the static roughness AI valueB and the

    dynamic roughness A? valueB.

    = Model< 0se this property to set a model from the models li"rary to this #orkPart, "y default the model is a yellow cu"e.

    = Model Scale< use this property to adDust the applied model scale to the #orkPart scale.

    = Position< sets the #orkPart start position.

    = $otate< rotates the #orkPart in the I a&is position.

    = $otate 7< rotates the #orkPart in the 7 a&is position.

    = $otate ?< rotates the #orkPart in the ? a&is position.

    = Scale< sets the #orkPart scale.

    = Shape< sets the element shape A(o&, Sphere, Cylinder, CapsuleB.

    = $adius< sets the shape radius Aonly if the shape property is set to Sphere, Cylinder or CapsuleB.

    = Length< sets the shape length Aonly if the shape property is set to Cylinder or CapsuleB.

    = Te&ture< sets the #orkPart te&ture.

    = Type< this property is used to identify this kind of #orkPart in your installation, for instance, the camera component reads the

    #orkParts type and send it to the PLC, the #orkParts Modifier component changes "etween two different types of #orkParts,etc.

    = 1iew(o&< only used in design mode, used to view the shape of your #orkPart.

    = System Light category< defines the material characteristics and shadow.

  • 8/19/2019 Machines Simulator Editor Help

    26/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    /orkPart "reator "omponent:

    = -dentifier< its an only reada"le property used to know the id num"er of this element in the

    installation.

    = PLC -nput Create #orkPart< PLC input num"er used to create a new #orkPart, when this input will

    "e on ATrigger to onB, a new #orkPart will "e created.

    = PLC *utput Create #orkPart< PLC output num"er used to create a new #orkPart, when this PLC

    output will "e on ATrigger to onB, a new #orkPart will "e created.

    = Creation Mode< Choose $andom to create randomly a #orkPart form the #orkPart Creator

    collection, choose SeKuential to create a #orkPart seKuentially from the collection.

    = !escription< component name description.

    = Position< sets the #orkPart Creator component start position, which will "e the point where the

    #orkParts will "e created.

    = #orkParts to enerate< is a collection of the installation availa"le #orkParts, here you can select

    the #orkPart that this component will create when the PLC output will "e on.

    = #orkPart Supply -nterval< if is 6 only a #orkPart will "e created on the positive trigger of the PLC

    *utput num"er selected, if a num"er grater than Fero is set, every this num"er seconds the

    #orkPart will "e created always that the PLC output will "e on.

    /orkPart Destructor "omponent:

    = -dentifier< its an only reada"le property used to know the id num"er of this element in the

    installation.

    = PLC *utput !estroy #orkPart< PLC output num"er used to destroy the #orkPart, if this PLC

    output is 6 when a workpart collide with it will "e destroyed, if is assigned the workpart will "e

    destroyed if collides and the output is on.

    = Position< #orkPart !estructor position.

    = Scale< #orkPart !estructor scale.

    /orkPart Modi(ier "omponent:

    = -dentifier< id num"er of this element in the installation.

    = PLC -nput Modify #orkPart< PLC input num"er used to modify the #orkPart, if this PLC input is on

    the workpart that collide with this component will "e changed.

    = PLC *utput Modify #orkPart< PLC output num"er used to modify the #orkPart, if this PLC output

    is 6 the component always is active. -f not will "e active when the PLC output will "e on.

    = Position< #orkPart Modifier position.

    = $adius< #orkPart Modifier siFe.

    = Source #orkPart< #orkPart type that will "e destroyed when the component will "e active and theworkpart collides with it.

    = Transform #orkPart< workpart type that will "e created when the source workpart will "e

    destroyed.

    /orkPart !ranslator "omponent:

    = -dentifier< id num"er of this element in the installation.

    = Position< Emitter or $eceiver position.

    = Scale< Emitter or $eceiver siFe.

    = #orkPart Type< workpart type that will "e translated when the workpart collides with the receiver Aif 3 then all workparts will"e translatedB.

    = Select Element< only useful in editing mode, use it to manage the emitter or the receiver.

  • 8/19/2019 Machines Simulator Editor Help

    27/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    Media Library

    Machines Editor has availa"le a media li"rary composed "y te&tures, ! models and sounds. Some components have a te&ture

    and%or a model property, if you click it, the te&ture or model windows appears and you can choose the te&ture or model to

    apply to this component.

    The Sound li"rary is used to ear the availa"le sounds, you can use it in the components or installation programming to give yourcomponents or installations sounds capa"ilities.

    4o- can ' add media content5

    To add new ! models you will need the Microsoft 1isual Studio, CO 4665 E&press Edition is needed, and the Microsoft 7@'

    ame Studio .3, this tools are free use. Create a new game and add it the models you want, once compiled the models will "e

    transformed in &n" files, copy this files in the following folder -Machines Simulator-#ontent-Models and will "e ready to use in

    Machines Editor.

    To add new te&tures copy your te&ture files ADpg or png file formatB in the folder -Machines Simulator-#ontent-'e(tures then

    when the te&tures window will open will appear the te&tures you copied on it, and you can assign it to the components. These

    te&tures can "e use "y the components "ut are not optimiFed, this means that will use the $'M memory used "y the te&ture

    file, if you want to optimiFe the te&tures usage, you must to follow the same process that e&plained with the models< create a

    new game proDect, add the te&ture graphic files to the proDect then when compile the graphic files will "e transformed in &n"

    files, copy these files in the same folder where you copied the graphic file Athe two files are need, for e&ample tree.Dpg and

    tree.&n"B then you can use the optimiFed te&tures.

    -f you want to use new sounds you can use wav files, using the programming wave sound functions you will "e a"le to use your

    own sounds.

    Windows Designer

    0sing the #indows !esigner tool is possi"le to create easily 4! #indows to add in our installations. Press on #indow menu to

    add new windows, and select form Controls menu the control you want to add to the current selected window. #ith the

    up%down%left%right% "uttons you can place the controls in the desired position, and in the property grid you can customiFe each

    control.*nce the window is finished, can "e saved in disk Afrm e&tensionB, to add this window to the installation use the 0- o"Dect in

    the installation

    Script code<

    //Example 1:GUI gui;public void Init(){gui = new GUI(MachSim);Form form = new Form(new Vector2(100f, 100f), new Vector2(300f, 200f), "Test Form", Color.White, Color.Black,"tahoma", 0.8f, true, true, true, true, Form.BorderStyle.FixedSingle);TextButton butt = new TextButton("buton", new Vector2(10, 50), "Button1", 120, Color.Gray);butt.OnPress += new EventHandler(butt_OnPress);form.Add(butt);form.Show();gui.AddForm(form);

    MachSim.Components.Add(gui);}public void Main(GameTime gameTime){}public void Draw(GameTime gameTime){}public void Finish(){gui.RemoveAllForms();MachSim.Components.Remove(gui);}void butt_OnPress(object sender, EventArgs e){TextButton b = (TextButton)sender;Form f = (Form)b.owner;f.title = "Pressed!";} 

    //Example 2:

  • 8/19/2019 Machines Simulator Editor Help

    28/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    //Here is opened a file with the windows configuration saved with the Windows Designer UtilityGUI gui;float pos = 0;public void Init(){gui = new GUI(MachSim);gui.Load(Editor.Path() + "\\MyMachines\\Elevator.frm");Form form = gui.forms[0];form.Position = new Vector2(ScreenW - form.size.X, ScreenH - form.size.Y);TextButton but1 = (TextButton)form.Controls[0];but1.OnPress += new EventHandler(but1_OnPress);TextButton but2 = (TextButton)form.Controls[1];

    but2.OnPress += new EventHandler(but2_OnPress);MachSim.Components.Add(gui);}void but1_OnPress(object sender, EventArgs e){// Do Stuff here}void but2_OnPress(object sender, EventArgs e){// Do Stuff here}public void Main(GameTime gameTime){// Compensation factor in order to get the same speed on differents computersfloat fTimeScale = (float)gameTime.ElapsedGameTime.Ticks / TimeSpan.TicksPerSecond;if(IO.GetOutput(2)){pos -= 10 * fTimeScale;

    Editor.Move(1, new Vector3(0.01f, pos, -0.175f), Matrix.Identity);}else if (IO.GetOutput(1)){pos += 10 * fTimeScale;Editor.Move(1, new Vector3(0.01f, pos, -0.175f), Matrix.Identity);}}public void Draw(GameTime gameTime){}public void Finish(){gui.RemoveAllForms();MachSim.Components.Remove(gui);}

    Ruler

    #ith the $uler tool is possi"le to make accuracy measurements to calculate the distance "etween two points.

    *ne point is pointed "y the yellow arrow and the other "y the "lue arrow. Press @ or M keys to select the arrow you want to

    move, and press 3, 4 or numeric keys to select the a&is to move Aalso can "e moved with the /eypad keysB

  • 8/19/2019 Machines Simulator Editor Help

    29/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    The distance is showed in the upper side in $ed colour.

    Programming Reference

    -n order to give more power to your installations or your 0ser !efined Components you can use the programming module

    availa"le in Machines Editor, with this module you can access all the main installation and components o"Dects to interact with

    it.

    The Programming Module has availa"le a synta& check feature that informs you when an error is detected on the code, also its

    possi"le to have key words colored.

    Machines Editor has two different environments where the programming can "e applied, the installation and the 0ser !efined

    Components, there are common and different o"Dects applica"le to this environments.

    Installations

    This environment is programming using the CO language. Selecting the -nstallation o"Dect, the code property is where we can

    make the programming. There are four availa"le methods<

    = -nit< this method is e&ecuted when the installation is loaded at first time in Machines Simulator. -n Machines Editor is e&ecuted

    when we pass to $un Mode Athe $un Machine tool"ar icon is clicked and the physics system is ena"ledB. 0seful to initialiFation

    porpoises.

    = Main< this method is e&ecuted cyclically during the installation life, here we must to program our installation "ehavior, this

    method has a parameter called gameTime of type ameTime, this parameter is used to know a"out the e&ecutions time.

    = !raw< this method is e&ecuted cyclically during the installation life, use this method only for advance porpoises, for instance, to

    add special effects or draw your own models with special "ehaviors, etc. This method has a parameter called gameTime of type

    ameTime, this parameter is used to know a"out the e&ecutions time.

    = )inish< this method is e&ecuted only once when we e&it from the installation in Machines Simulator or when we pass to !esign

    Mode in Machines Editor.

    -n the installation there are the following o"Dects, methods, properties and functions availa"le<

    Editor Object Methods: 

    The Editor Object provides some tools in order to customize your machine program.

    These are:

  • 8/19/2019 Machines Simulator Editor Help

    30/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    void ShowText(string txt);

    Description: Shows text in the status tool bar, useful for debug purposes.

    Example: Editor.ShowText("Example text");

    void RotateY(int id, float grad);

    Description: Rotates the Component with index 'id' in the Y axis 'grad' degrees.

    Example: Editor.RotateY(0,90);

    void RotateX(int id, float grad);

    Description: Rotates the Component with index 'id' in the X axis 'grad' degrees.

    Example: Editor.RotateX(1,180);

    void RotateZ(int id, float grad);

    Description: Rotates the Component with index 'id' in the Z axis 'grad' degrees.

    Example: Editor.RotateZ(0,270);

    void Translate(int id, Vector3 value);

    Description: Translate the Component with index 'id' to the 'value' position. The

    translation is relative to the world coordinates.

    Example: Editor.Translate(2,new Vector3(0.6f, 1.5f, -3.6f));

    void TranslateWithPhys(int id, Vector3 value);

    Description: Translates the Component with index 'id' to the 'value' position but

    this movement is affected by the physic system. The translation is relative to the

    world coordinates. This method is only valid for bodies with immovable property to

    false.

    Example: Editor.TranslateWithPhys(1, new Vector3(0, 2, 0));

    void Orientation(int id, Matrix value);

    Description: Rotates the Component with index 'id' to the 'value' Matrix

    rotation.

    Example: Editor.Orientation(2,Matrix.CreateRotationY(MathHelper.ToRadians(45)));

    void Move(int id, Vector3 pos, Matrix orientation);

    Description: Moves the Component with index 'id' to the 'pos' position and

    applies 'orientation' Matrix rotation.

    Example: Editor.Move(2, new Vector3(0, 1.1f, 3.6f),

    Matrix.CreateRotationX(MathHelper.ToRadians(15)));

    Texture2D GetTexture(string name);

    Description: Returns the 'name' Texture from the media library.

    Example: Texture2D texture = Editor.GetTexture(@"Metal\metal1.jpg");

    Model GetModel(string name);

    Description: Returns the 'name' Model from the media library.

    Example: Model model = Editor.GetModel(@"Shapes\Circle");

  • 8/19/2019 Machines Simulator Editor Help

    31/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    string Path();

    Description: Returns the path where Machines Simulator Editor is installed.

    Example: string path = Editor.Path();

    void PlaySound(string sound);

    Description: Plays one time the clue 'sound' from the media library. Used for

    looping clues.Example: Editor.PlaySound("alarm");

    void PlaySingleSound(string sound);

    Description: Plays the clue 'sound' from the media library. Used for not looping

    clues.

    Example: Editor.PlaySingleSound("PneumaticCyl");

    void StopSound();

    Description: Stops the current playing clue.

    Example: Editor.StopSound();

    int WorkPartCollisionId(int id);

    Description: Returns the WorkPart Id number that collides with the id Component.

    Example: int selWp = Editor.WorkPartCollisionId(1);

    int WorkPartRayColId(int id, Vector3 pos, Vector3 target);

    Description: Returns the WorkPart Id number that collides with a Ray form the id

    Component, with pos Vecctor position and target direction.

    Example: int selWp = Editor.WorkPartRayColId(1, new Vector3(0.5f, 0, 0.2f),

    Vector3.Up);

    int WorkPartDistRayColId(int id, Vector3 pos, Vector3 target, float distance);

    Description: Returns the WorkPart Id number that collides with a Ray form the id

    Component, with pos Vecctor position, target direction and the distance is equal or

    lower than distance.

    Example: int selWp = Editor.WorkPartDistRayColId(1, new Vector3(1.0f, 0, 0.2f),

    Vector3.Up, 0.5f);

    float MouseWheel();

    Description: Returns the Mouse Wheel value.

    Example: float wheel = Editor.MouseWheel();

    bool MouseOverComponent(int id)

    Description: Returns true if the mouse cursor is over the component with index

    number 'id' of the current installation.

    Example: bool sel = Editor.MouseOverComponent(5);

    float CollisionDistance(Vector3 position, Vector3 target);

    Description: Returns the collision distance between any component and the point

    position pointing in a target direction.

    Example: float dist = Editor.CollisionDistance(Vector3.One, Vector3.Down * 2);

  • 8/19/2019 Machines Simulator Editor Help

    32/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    Matrix RotY(float deg)

    Description: Returns the matrix 3D position obtained for a Y axis space rotation

    a 'deg' degress quantity.

    Example: Matrix matRotY = Editor.RotY(45.0f);

    Matrix RotX(float deg)

    Description: Returns the matrix 3D position obtained for a X axis space rotation

    a 'deg' degress quantity.

    Example: Matrix matRotX = Editor.RotX(2);

    Matrix RotZ(float deg)

    Description: Returns the matrix 3D position obtained for a Z axis space rotation

    a 'deg' degress quantity.

    Example: Matrix matRotZ = Editor.RotZ(12.3f);

    void CameraSpeed(float vel)

    Description: Sets the camera speed.Example: Editor.CameraSpeed(9.5f);

    void AmbientLightColor(int id, Vector3 value)

    Description: Changes the ambient light color associated to the component with

    identification number 'id'.

    Example: Editor.AmbientLightColor(0, new Vector3(0.2f, 0.3f, 0.2f));

    void DiffuseColor(int id, Vector3 value)

    Description: Changes the diffuse light color associated to the component with

    identification number 'id'.

    Example: Editor.DiffuseColor(1, new Vector3(0.2f, 0.3f, 0.2f)

    void EmissiveColor(int id, Vector3 value)

    Description: Changes the emissive light color associated to the component with

    identification number 'id'.

    Example: Editor.EmissiveColor(2, new Vector3(0.2f, 0.3f, 0.2f)

    void SpecularColor(int id, Vector3 value)

    Description: Changes the specular light color associated to the component with

    identification number 'id'.

    Example: Editor.SpecularColor(3, new Vector3(0.2f, 0.3f, 0.2f)

    void SpecularPower(int id, Vector3 value)

    Description: Changes the specular powervalue associated to the component with

    identification number 'id'.

    Example: Editor.SpecularPower(4, 0.2f)

    void SetInputDescr(int number, string description)

    Description: Sets the input 'number' description in Machines Editor digital Input

    List.

    Example: Editor.SetInputDescr(12, "Sensor Signal");

  • 8/19/2019 Machines Simulator Editor Help

    33/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    void SetOutputDescr(int number, string description)

    Description: Sets the output 'number' description in Machines Editor digital

    Output Grid.

    Example: Editor.SetOutputDescr(5, "Cylinder_5_Activation");

    void Add3DDescription(Vector3 position, string description, Color col)

    Description: Sets a I/O information description in Machines Simulator environment

    when F1 key is pressed.

    Example: Editor.Add3DDescription(new Vector3(1,2,1), "Motor_Position",

    Color.Red);

    Constants:

    int ScreenW

    Description: Returns the current screen width.

    Example: int screenWidth = ScreenW;

    int ScreenH

    Description: Returns the current screen height.

    Example: int screenHeight = ScreenH; 

    Functions:

    Some useful functions to help in your machine program:

    float Compensation(GameTime gameTime)

    Description: Returns a compensation factor in order to obtain the same rateregardless of the system.

    Example: movement = speed * Compensation(gameTime);

    IO Object Methods:

    The IO Object allows to manipulate the machine I/O (digital & analogic) as the

    UserDefinedComponent Parameters.

    bool GetOutput(string name);

    Description: returns the 'name' PLC Output statusExample: if(IO.GetOutput("Advance"))

    {...}

    bool GetOutput(int num);

    Description: returns the 'num' number PLC Output status

    Example: if(IO.GetOutput(4))

    {...}

    void SetInput(string name, bool value);

    Description: set the 'name' PLC Input to the 'value' status

    Example: IO.SetInput("HomePosition", true);

  • 8/19/2019 Machines Simulator Editor Help

    34/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    void SetInput(int num, bool value);

    Description: set the 'num' number PLC Input to the 'value' status

    Example: IO.SetInput(2, true);

    bool GetInput(string name);

    Description: return the 'name' PLC Input status

    Example: bool result = IO.GetInput("HomePos");

    bool GetInput(int num);

    Description: return the 'num' number PLC Input status

    Example: bool result = IO.GetInput(7);

    void SetAnalogInp(int num, float value);

    Description: set the 'num' number PLC Analogic Input to the 'value' value

    Example: IO.SetAnalogInp(1, 3.5f);

    void SetAnalogInp(string name, float value);

    Description: set the 'name' PLC Analogic Input to the 'value' value

    Example: IO.SetAnalogInp("Control_1", ratio);

    float GetAnalogOut(int num);

    Description: return the 'num' number PLC Analogic Output value

    Example: float result = IO.GetAnalogOut(3);

    float GetAnalogOut(string name);

    Description: return the 'name' name PLC Analogic Output value

    Example: float result = IO.GetAnalogOut("robotArm");

    IOManager Object Methods (Fast access to I/O):

    bool GetInput(int num);

    Description: returns the PLC input number 'num' status

    Example: if(IOManager.GetInput(1))

    {...}

    bool GetOutput(int num);

    Description: returns the PLC output number 'num' status

    Example: if(IOManager.GetOutput(1)){...}

    void SetInput(int num, bool stat);

    Description: sets the PLC input number 'num' status to 'stat'

    Example: IOManager.SetInput(1, true);

    void SetOutput(int num, bool stat);

    Description: sets the PLC output number 'num' status to 'stat'

    Example: IOManager.SetOutput(2, false);

  • 8/19/2019 Machines Simulator Editor Help

    35/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    bool TrigInpUp(int num);

    Description: returns the PLC input number 'num' change status from false to true.

    Example: if(IOManager.TrigInpUp(1))

    {...}

    bool TrigInpDwn(int num);

    Description: returns the PLC input number 'num' change status from true to false.Example: if(IOManager.TrigInpDwn(1))

    {...}

    bool TrigOutUp(int num);

    Description: returns the PLC output number 'num' change status from false to

    true.

    Example: if(IOManager.TrigOutUp(1))

    {...}

    bool TrigOutDwn(int num);

    Description: returns the PLC output number 'num' change status from true tofalse.

    Example: if(IOManager.TrigOutDwn(1))

    {...}

    float GetAnalogOut(int num);

    Description: returns the PLC Analogic Output number 'num'

    Example: float d1 = IOManager.GetAnalogOut(1);

    void SetAnalogInp(int num, float v);

    Description: sets the PLC Analogic Input 'num' value 'v' to be sent to the PLC

    Example: IOManager.SetAnalogInp(3, 10.5f);

    void AnalogOutFromPLC(int num, float v);

    Description: sets the PLC Analogic Output number 'num' value 'v' that comes from

    the PLC

    Example: IOManager.AnalogOutFromPLC(1, 2.54f); 

    float AnalogInpToPLC(int num);

    Description: returns the PLC Analogic Input number 'num' sent to the PLC

    Example: float d1 = IOManager.AnalogInpToPLC(1);

    machine[] Array

    Through the machine[] array is possible to access to each PhysicObject element of the

    installation.

    Instaation !hysicObject Methods: 

    PhysicObject WorkPartCollision();

  • 8/19/2019 Machines Simulator Editor Help

    36/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    Description: returns the PhysicObject from the WorkPartList that collides with

    the Component.

    Example: PhysicObject searchPart = machine[1].WorkPartCollision();

    PhysicObject WorkPartRayCol(Vector3 pos, Vector3 target);

    Description: returns the PhysicObject from the WorkPartList that collides with

    the Component ray that has the origin in the 'pos' position and has a direction

    'target'.Example: PhysicObject searchPart =

    machine[1].WorkPartRayCol(box[1].body.Position, Vector3.Up);

    PhysicObject WorkPartDistRayCol(Vector3 pos, Vector3 target, float distance);

    Description: returns the PhysicObject from the WorkPartList that collides with

    the Component ray that has the origin in the 'pos' position, has a direction 'target'

    and the distance between the Component and the WorkPart it's less or equal that

    distance.

    Example: PhysicObject searchPart =

    machine[0].WorkPartDistRayCol(machine[0].body.Position,

    machine[0].body.Orientation.Right, 0.5f);

    List WorkPartCollisionList()

    Description: returns all the PhysicObjects from the WorkPartList that collides

    with the Component.

    Example: PhysicObjectList collisionPartList = machine[1].WorkPartCollisionList();

    void SetTexture(String text)

    Description: Sets the 'text' Texture file to the component.

    Example: machine[0].SetTexture (@"Metal\metal1.jpg");

    void SetTexture(Texture2D text)

    Description: Sets the 'text' Texture to the component.

    Example: machine[0].SetTexture (Editor.GetTexture(@"Metal\metal1.jpg"));

    void SetModel(String mdl)

    Description: Sets the 'mdl' Model file to the component.

    Example: machine[0].SetModel (@"Shapes\Circle");

    void SetModel(Model mdl)

    Description: Sets the 'mdl' Model to the component.

    Example: machine[0].SetModel (Editor.GetModel(@"Shapes\Circle"));

    void PlaySound(string snd);

    Description: Plays one time the clue 'snd' from the media library. Used for

    looping clues.

    Example: machine[0].PlaySound("alarm");

    void PlaySingleSound(string sound);

    Description: Plays the clue 'sound' from the media library. Used for not looping

    clues.

    Example: machine[1].PlaySingleSound("PneumaticCyl");

    void StopSound();

    Description: Stops the current playing clue.

    Example: machine[0].StopSound();

  • 8/19/2019 Machines Simulator Editor Help

    37/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    void LoadWaveFile(string sound);

    Description: Load the 'sound' wave sound file.

    Example: machine[0].LoadWaveFile(Editor.Path() + @"\Content\motor.wav");

    void PlayWaveFile();

    Description: Plays the loaded wave sound file.Example: machine[0].PlayWaveFile();

    void PlayWaveFile(string sound);

    Description: Plays the 'sound' wave sound file.

    Example: machine[0].PlayWaveFile(Editor.Path() + @"\Content\engine.wav");

    void StopWaveFile();

    Description: Stops the loaded wave sound file.

    Example: machine[0].StopWaveFile();

    void ApplyMovement(Vector3 direction, float Speed)

    Description: This method is used to apply velocity to the WorkParts and Dinamic

    elements that collides with the surface of the installation element.

    Example: machine[0].ApplyMovement(machine[0].body.Orientation.Forward, 1);

    void ApplyMovementOnly(Vector3 direction, float Speed)

    Description: This method is used to apply velocity to the WorkParts and Dinamic

    elements that collides with the surface of the installation element and eliminates the

    other forces.

    Example: machine[0].ApplyMovement(machine[0].body.Orientation.Forward, 1);

    void StopMovement()

    Description: This method is used to remove the applied velocity to the WorkParts

    and Dinamic elements that collides with the surface of the installation element.

    Example: machine[0].StopMovement();

    Main Objects:

    Game MachSim;

    Description: main Object.

    IInputHandler input;

    Description: object to manage the mouse & keyboard.

    GraphicsDeviceManager graphics;

    Description: graphics object.

    SpriteBatch spriteBatch;

    Description: 2D drawing object.

  • 8/19/2019 Machines Simulator Editor Help

    38/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    FixCam camera;

    Description: camera object.

    Components[] machine;

    Description: array with the Components elements.

    List WorkPartList;

    Description: List with the current WorkParts created in the machine.

    IOClass IO;

    Description: Digital Input/Output object. 

    in"ut Object Methods: 

    bool input.KeyboardState.IsKeyDown(Keys.KeyName);

    Description: returns if the passed key is pressed.

    Example: if(input.KeyboardState.IsKeyDown(Keys.D1))

    {...}

    bool input.KeyboardState.WasKeyPressed(Keys.KeyName);

    Description: returns if the passed key was pressed.

    Example: if(input.KeyboardState.WasKeyPressed(Keys.M))

    {...} 

    User Defined Components

    This environment can "e programming using the CO language. The code property is where we can make the programming. There

    are four availa"le methods<

    = -nit< this method is e&ecuted when the installation is loaded at first time in Machines Simulator. -n Machines Editor is e&ecuted

    when we pass to $un Mode Athe $un Machine tool"ar icon is clicked and the physics system is ena"ledB. 0seful to initialiFation

    porpoises.

    = Main< this method is e&ecuted cyclically during the installation life, here we must to program our installation "ehavior, this

    method has a parameter called gameTime of type ameTime, this parameter is used to know a"out the e&ecutions time.

    = !raw< this method is e&ecuted cyclically during the installation life, use this method only for advance porpoises, for instance, to

    add special effects or draw your own models with special "ehaviors, etc. This method has a parameter called gameTime of type

    ameTime, this parameter is used to know a"out the e&ecutions time.

    = )inish< this method is e&ecuted only once when we e&it from the installation in Machines Simulator or when we pass to !esignMode in Machines Editor.

    -n the 0ser !efined Components there are the following o"Dects, methods, properties and functions availa"le<

    Editor Object Methods: 

    The Editor Object provides some tools in order to customize your UserDefinedComponents.

    These are:

  • 8/19/2019 Machines Simulator Editor Help

    39/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    void ShowText(string txt);

    Description: Shows text in the status tool bar, useful for debug purposes.

    Example: Editor.ShowText("Example text");

    Vector3 ComponentPosition();

    Description: Returns the UserDefinedComponent Position.Example: Vector3 pos = Editor.ComponentPosition();

    Vector3 ComponentScale();

    Description: Returns the UserDefinedComponent Scale.

    Example: Vector3 scal = Editor.ComponentScale();

    float ComponentRotationOnY();

    Description: Returns the UserDefinedComponent degrees rotation in the Y axis;

    Example: float rot = Editor.ComponentRotationOnY();

    void RotateY(int id, float grad);

    Description: Rotates the box element with index 'id' in the Y axis 'grad'

    degrees.

    Example: Editor.RotateY(0,90);

    void RotateX(int id, float grad);

    Description: Rotates the box element with index 'id' in the X axis 'grad'

    degrees.

    Example: Editor.RotateX(1,180);

    void RotateZ(int id, float grad);

    Description: Rotates the box element with index 'id' in the Z axis 'grad'

    degrees.

    Example: Editor.RotateZ(0,270);

    void Translate(int id, Vector3 value);

    Description: Translate the box element with index 'id' to the 'value' position.

    The translation is relative to the component coordinates.

    Example: Editor.Translate(2, new Vector3(0.6f, 1.5f, -3.6f));

    void TranslateWithPhys(int id, Vector3 value);

    Description: Translates the box element with index 'id' to the 'value' position

    but this movement is affected by the physic system. The translation is relative to the

    component coordinates. This method is only valid for bodies with immovable property to

    false.

    Example: Editor.TranslateWithPhys(1, new Vector3(0, 2, 0));

    void Orientation(int id, Matrix value);

    Description: Rotates the box element with index 'id' to the 'value' Matrix

    rotation.

  • 8/19/2019 Machines Simulator Editor Help

    40/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    Example: Editor.Orientation(2,Matrix.CreateRotationY(MathHelper.ToRadians(45)));

    void Move(int id, Vector3 pos, Matrix orientation);

    Description: Moves the box element with index 'id' to the 'pos' position and

    applies 'orientation' Matrix rotation.

    Example: Editor.Move(2, new Vector3(0, 1.1f, 3.6f),

    Matrix.CreateRotationX(MathHelper.ToRadians(15)));

    Texture2D GetTexture(string name);

    Description: Returns the 'name' Texture from the media library.

    Example: Texture2D texture = Editor.GetTexture(@"Metal\metal1.jpg");

    Model GetModel(string name);

    Description: Returns the 'name' Model from the media library.

    Example: Model model = Editor.GetModel(@"Shapes\Circle");

    string Path();

    Description: Returns the path where Machines Simulator Editor is installed.Example: string path = Editor.Path();

    void PlaySound(string sound);

    Description: Plays one time the clue 'sound' from the media library. Used for

    looping clues.

    Example: Editor.PlaySound("alarm");

    void PlaySingleSound(string sound);

    Description: Plays the clue 'sound' from the media library. Used for not looping

    clues.

    Example: Editor.PlaySingleSound("PneumaticCyl");

    void StopSound();

    Description: Stops the current playing clue.

    Example: Editor.StopSound();

    void AlphaChannel(int id, float value);

    Description: Changes the Alpha value for the id box component.

    Example: Editor.AlphaChannel(0, 0.5f);

    int WorkPartCollisionId(int id);

    Description: Returns the WorkPart Id number that collides with the id box

    component.

    Example: int selWp = Editor.WorkPartCollisionId(1);

    int WorkPartRayColId(int id, Vector3 pos, Vector3 target);

  • 8/19/2019 Machines Simulator Editor Help

    41/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    Description: Returns the WorkPart Id number that collides with a Ray form the id

    box component, with pos Vecctor position and target direction.

    Example: int selWp = Editor.WorkPartRayColId(1, new Vector3(0.5f, 0, 0.2f),

    Vector3.Up);

    int WorkPartDistRayColId(int id, Vector3 pos, Vector3 target, float distance);

    Description: Returns the WorkPart Id number that collides with a Ray form the idbox component, with pos Vecctor position, target direction and the distance is equal or

    lower than distance.

    Example: int selWp = Editor.WorkPartDistRayColId(1, new Vector3(1.0f, 0, 0.2f),

    Vector3.Up, 0.5f);

    float MouseWheel();

    Description: Returns the Mouse Wheel value.

    Example: float wheel = Editor.MouseWheel();

    bool MouseOverUDC(int id)

    Description: Returns true if the mouse cursor is over the box with index number'id' of the current UserDefined component.

    Example: bool sel = Editor.MouseOverUDC(1);

    float CollisionDistance(Vector3 position, Vector3 target);

    Description: Returns the collision distance between any component and the point

    position pointing in a target direction.

    Example: float dist = Editor.CollisionDistance(Vector3.One, Vector3.Down * 2);

    Matrix RotY(float deg)

    Description: Returns the matrix 3D position obtained for a Y axis space rotation

    a 'deg' degress quantity.

    Example: Matrix matRotY = Editor.RotY(45.0f);

    Matrix RotX(float deg)

    Description: Returns the matrix 3D position obtained for a X axis space rotation

    a 'deg' degress quantity.

    Example: Matrix matRotX = Editor.RotX(2);

    Matrix RotZ(float deg)

    Description: Returns the matrix 3D position obtained for a Z axis space rotation

    a 'deg' degress quantity.

    Example: Matrix matRotZ = Editor.RotZ(12.3f);

    void AmbientLightColor(int id, Vector3 value)

    Description: Changes the ambient light color associated to the box element with

    identification number 'id'.

    Example: Editor.AmbientLightColor(0, new Vector3(0.2f, 0.3f, 0.2f));

    void DiffuseColor(int id, Vector3 value)

  • 8/19/2019 Machines Simulator Editor Help

    42/74

     

    Copyright © 2008 2015 by Rafael Izquierdo All Rights Reserved.

    Machines Simulator Editor

    Description: Changes the diffuse light color associated to the box element with

    identification number 'id'.

    Example: Editor.DiffuseColor(1, new Vector3(0.2f, 0.3f, 0.2f)

    void EmissiveColor(int id, Vector3 value)

    Description: Changes the emissive light color associated to the box element with

    identification number 'id'.

    Example: Editor.EmissiveColor(2, new Vector3(0.2f, 0.3f, 0.2f)

    void SpecularColor(int id, Vector3 value)

    Description: Changes the specular light color associated to the box element with

    identification number 'id'.

    Example: Editor.SpecularColor(3, new Vector3(0.2f, 0.3f, 0.2f)

    void SpecularPower(int id, Vector3 value)

    Description: Changes the specular powervalue associated to the box element with

    identification number 'id'.

    Example: Editor.SpecularPower(4, 0.2f)

    Constants:

    int ScreenW

    Description