[Opal-commits] web tutorial9.html,1.2,1.3
Status: Inactive
Brought to you by:
tylerstreeter
|
From: tylerstreeter <tyl...@us...> - 2005-06-03 21:47:05
|
Update of /cvsroot/opal/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4476 Modified Files: tutorial9.html Log Message: Fixed error in Blueprint tutorial where a Motor wasn't being casted to a specific type. Index: tutorial9.html =================================================================== RCS file: /cvsroot/opal/web/tutorial9.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tutorial9.html 28 Mar 2005 22:34:07 -0000 1.2 --- tutorial9.html 3 Jun 2005 21:46:55 -0000 1.3 *************** *** 25,44 **** <o:Author>Tyler Streeter</o:Author> <o:LastAuthor>Tyler Streeter</o:LastAuthor> ! <o:Revision>241</o:Revision> ! <o:TotalTime>508</o:TotalTime> <o:Created>2004-06-05T15:20:00Z</o:Created> ! <o:LastSaved>2005-03-28T22:27:00Z</o:LastSaved> <o:Pages>1</o:Pages> ! <o:Words>1157</o:Words> ! <o:Characters>6599</o:Characters> <o:Company>none</o:Company> ! <o:Lines>54</o:Lines> <o:Paragraphs>15</o:Paragraphs> ! <o:CharactersWithSpaces>7741</o:CharactersWithSpaces> <o:Version>10.6714</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> ! <w:Zoom>75</w:Zoom> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> --- 25,44 ---- <o:Author>Tyler Streeter</o:Author> <o:LastAuthor>Tyler Streeter</o:LastAuthor> ! <o:Revision>243</o:Revision> ! <o:TotalTime>509</o:TotalTime> <o:Created>2004-06-05T15:20:00Z</o:Created> ! <o:LastSaved>2005-06-03T21:44:00Z</o:LastSaved> <o:Pages>1</o:Pages> ! <o:Words>1163</o:Words> ! <o:Characters>6631</o:Characters> <o:Company>none</o:Company> ! <o:Lines>55</o:Lines> <o:Paragraphs>15</o:Paragraphs> ! <o:CharactersWithSpaces>7779</o:CharactersWithSpaces> <o:Version>10.6714</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> ! <w:Zoom>90</w:Zoom> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> *************** *** 90,95 **** /* List Definitions */ @list l0 ! {mso-list-id:880628336; ! mso-list-template-ids:-1775226150;} @list l0:level1 {mso-level-number-format:bullet; --- 90,95 ---- /* List Definitions */ @list l0 ! {mso-list-id:1136684464; ! mso-list-template-ids:-2126118016;} @list l0:level1 {mso-level-number-format:bullet; *************** *** 102,107 **** mso-bidi-font-family:"Times New Roman";} @list l1 ! {mso-list-id:1412464396; ! mso-list-template-ids:2009647496;} @list l1:level1 {mso-level-number-format:bullet; --- 102,107 ---- mso-bidi-font-family:"Times New Roman";} @list l1 ! {mso-list-id:1463571841; ! mso-list-template-ids:116717466;} @list l1:level1 {mso-level-number-format:bullet; *************** *** 179,183 **** </style> <![endif]--><!--[if gte mso 9]><xml> ! <o:shapedefaults v:ext="edit" spidmax="66562"> <o:colormenu v:ext="edit" fillcolor="white"/> </o:shapedefaults></xml><![endif]--><!--[if gte mso 9]><xml> --- 179,183 ---- </style> <![endif]--><!--[if gte mso 9]><xml> ! <o:shapedefaults v:ext="edit" spidmax="67586"> <o:colormenu v:ext="edit" fillcolor="white"/> </o:shapedefaults></xml><![endif]--><!--[if gte mso 9]><xml> *************** *** 217,234 **** XML files at the end of this page.<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> ! <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>This tutorial ! covers Blueprints and OPAL XML files, two features that are useful when ! dealing with complex physical objects containing several different components ! (e.g. vehicles, ragdolls, game levels, etc.)<span style='mso-spacerun:yes'> ! </span>Blueprints are collections of data objects that describe Solids, ! Joints, Motors, and Sensors.<span style='mso-spacerun:yes'> </span>They can ! be setup by manually creating data objects and adding them to the Blueprint, ! by copying data from existing Solids, Joints, etc., or by loading them from ! OPAL XML files.<span style='mso-spacerun:yes'> </span>Objects that refer to ! others (e.g. a Joint refers to two Solids) can only refer to objects within ! the same Blueprint.<span style='mso-spacerun:yes'> </span>Instantiating a ! Blueprint returns a BlueprintInstance object that contains pointers to all ! the instantiated objects within the Blueprint; this will be described towards ! the end of the tutorial.<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span --- 217,235 ---- XML files at the end of this page.<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> ! <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>This ! tutorial covers Blueprints and OPAL XML files, two features that are useful ! when dealing with complex physical objects containing several different ! components (e.g. vehicles, ragdolls, game levels, etc.)<span ! style='mso-spacerun:yes'> </span>Blueprints are collections of data objects ! that describe Solids, Joints, Motors, and Sensors.<span ! style='mso-spacerun:yes'> </span>They can be setup by manually creating data ! objects and adding them to the Blueprint, by copying data from existing ! Solids, Joints, etc., or by loading them from OPAL XML files.<span ! style='mso-spacerun:yes'> </span>Objects that refer to others (e.g. a Joint ! refers to two Solids) can only refer to objects within the same ! Blueprint.<span style='mso-spacerun:yes'> </span>Instantiating a Blueprint ! returns a BlueprintInstance object that contains pointers to all the ! instantiated objects within the Blueprint; this will be described towards the ! end of the tutorial.<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span *************** *** 343,350 **** <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>Instantiating the Blueprint will create instances of all the objects contained in the ! Blueprint.<span style='mso-spacerun:yes'> </span>The call to finalize is ! necessary to let the Blueprint setup internal indices used for references to ! objects within the Blueprint.<span style='mso-spacerun:yes'> </span>The ! Blueprint cannot be modified after calling finalize.<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>Note --- 344,351 ---- <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>Instantiating the Blueprint will create instances of all the objects contained in the ! Blueprint.<span style='mso-spacerun:yes'> </span>The call to finalize is necessary ! to let the Blueprint setup internal indices used for references to objects ! within the Blueprint.<span style='mso-spacerun:yes'> </span>The Blueprint ! cannot be modified after calling finalize.<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>Note *************** *** 357,362 **** style='mso-spacerun:yes'> </span>The Blueprint ignores pointer references; for example, the JointData object contains two Solid pointers, but the ! Blueprint ignores these and only uses the solid0BlueprintRefName and solid0BlueprintRefName ! strings.<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>The --- 358,363 ---- style='mso-spacerun:yes'> </span>The Blueprint ignores pointer references; for example, the JointData object contains two Solid pointers, but the ! Blueprint ignores these and only uses the solid0BlueprintRefName and ! solid0BlueprintRefName strings.<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>The *************** *** 395,400 **** SolidData object from another existing Solid.<span style='mso-spacerun:yes'> </span>It is assumed that <o:p></o:p></span></p> ! <p class=MsoNormal><span style='font-family:Courier;color:black'>// the Solids ! name has been set via Solid::setName.<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:Courier;color:black'>opal::SolidData solid2Data = solid2->getData();<o:p></o:p></span></p> --- 396,401 ---- SolidData object from another existing Solid.<span style='mso-spacerun:yes'> </span>It is assumed that <o:p></o:p></span></p> ! <p class=MsoNormal><span style='font-family:Courier;color:black'>// the ! Solids name has been set via Solid::setName.<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:Courier;color:black'>opal::SolidData solid2Data = solid2->getData();<o:p></o:p></span></p> *************** *** 465,476 **** the use of existing data objects, this example contained a notable difference from the previous one: it instantiated the Blueprint twice, each time at a ! different location.<span style='mso-spacerun:yes'> </span>The instantiateBlueprint ! function takes an offset matrix (and a real value for scaling, not shown ! here) that can affect everything in the Blueprint instance at once.<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span ! style='font-size:16.0pt;font-family:"Book Antiqua";color:black'>Loading Blueprints ! from OPAL XML Files<o:p></o:p></span></b></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>OPAL XML files can be used to describe all parameters for Solids, Joints, Motors, --- 466,478 ---- the use of existing data objects, this example contained a notable difference from the previous one: it instantiated the Blueprint twice, each time at a ! different location.<span style='mso-spacerun:yes'> </span>The ! instantiateBlueprint function takes an offset matrix (and a real value for ! scaling, not shown here) that can affect everything in the Blueprint instance ! at once.<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span ! style='font-size:16.0pt;font-family:"Book Antiqua";color:black'>Loading ! Blueprints from OPAL XML Files<o:p></o:p></span></b></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>OPAL XML files can be used to describe all parameters for Solids, Joints, Motors, *************** *** 534,545 **** <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span ! style='font-size:16.0pt;font-family:"Book Antiqua";color:black'>Getting ! Access to Instantiated Object Pointers<o:p></o:p></span></b></p> ! <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>Once a ! Blueprint is instantiated, you may want to get pointers to all the individual ! objects that were just created.<span style='mso-spacerun:yes'> </span>There ! are two ways to do this: getting a pointer by name and looping over the ! pointers.<span style='mso-spacerun:yes'> </span>The following examples ! demonstrate these methods.<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>Here --- 536,547 ---- <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span ! style='font-size:16.0pt;font-family:"Book Antiqua";color:black'>Getting Access ! to Instantiated Object Pointers<o:p></o:p></span></b></p> ! <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>Once ! a Blueprint is instantiated, you may want to get pointers to all the ! individual objects that were just created.<span style='mso-spacerun:yes'> ! </span>There are two ways to do this: getting a pointer by name and looping ! over the pointers.<span style='mso-spacerun:yes'> </span>The following ! examples demonstrate these methods.<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>Here *************** *** 580,584 **** mastSolid = instance.getSolid(mast);<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:Courier;color:black'>opal::ThrusterMotor* ! engine = instance.getMotor(main engine);<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> </td> --- 582,588 ---- mastSolid = instance.getSolid(mast);<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:Courier;color:black'>opal::ThrusterMotor* ! engine = NULL;<o:p></o:p></span></p> ! <p class=MsoNormal><span style='font-family:Courier;color:black'>engine = (opal::ThrusterMotor*)instance.getMotor(main ! engine);<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> </td> *************** *** 600,605 **** <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> ! <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>The ! next example loops through every Solid in the instance, creating and storing an application-specific object for each:<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> --- 604,610 ---- <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> ! <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> ! <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'>The next ! example loops through every Solid in the instance, creating and storing an application-specific object for each:<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:"Book Antiqua";color:black'><o:p> </o:p></span></p> *************** *** 638,642 **** instance.getSolid(i);<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:Courier;color:black'><span ! style='mso-spacerun:yes'> </span>PhysicalPart* newPart = new PhysicalPart();<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:Courier;color:black'><span --- 643,648 ---- instance.getSolid(i);<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:Courier;color:black'><span ! style='mso-spacerun:yes'> </span><span ! style='mso-spacerun:yes'> </span>PhysicalPart* newPart = new PhysicalPart();<o:p></o:p></span></p> <p class=MsoNormal><span style='font-family:Courier;color:black'><span |