Sophie

Sophie

distrib > Mandriva > 10.0-com > i586 > by-pkgid > 06719cf03808e17ae6f0852ca1052dc2 > files > 228

libogre1-devel-0.13.0-1mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0094)http://homepages.ihug.co.nz/~evilnic/Tutorials/Ogre/LightsCameraAction/ChangeShipMovement.html -->
<HTML><HEAD><TITLE>Creating OGRE Project Files</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<STYLE type=text/css>.MainHeader {
	FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: #ffffff; BACKGROUND-COLOR: #003300
}
BODY {
	FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #ffffff
}
.BorderHeader {
	FONT-WEIGHT: bold; FONT-SIZE: 8pt; COLOR: #333300; BACKGROUND-COLOR: #999900; TEXT-ALIGN: center
}
.MainContent {
	FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif
}
.BorderContent {
	BORDER-RIGHT: #666600 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: black 0px solid; PADDING-LEFT: 2px; FONT-SIZE: 8pt; MARGIN-BOTTOM: 2px; PADDING-BOTTOM: 10px; BORDER-LEFT: #666600 1px solid; COLOR: #000000; PADDING-TOP: 2px; BORDER-BOTTOM: #666600 1px solid
}
A:link {
	COLOR: #000066; TEXT-DECORATION: underline
}
A:hover {
	COLOR: #0000ff; TEXT-DECORATION: underline
}
A:visited {
	COLOR: #660066; TEXT-DECORATION: underline
}
LI {
	LEFT: -15px; COLOR: #000000; LIST-STYLE-TYPE: circle; POSITION: relative
}
.NewsDate {
	FONT-WEIGHT: bold; COLOR: #000000
}
TD {
	FONT-SIZE: 10pt
}
TH {
	FONT-SIZE: 10pt
}
.Annotation {
	FONT-SIZE: 10px
}
.header {
	FONT-SIZE: 16pt; COLOR: #000000
}
.SectionHeader {
	FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #000000
}
PRE {
	FONT-SIZE: 12px; COLOR: #000066
}
</STYLE>

<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<META content="" name=keywords>
<META content="" name=description>
<META content=Nicholas name=author>
<META http-equiv=reply-to content=vastrim@hotmail.com>
<META content="Sat, 13 Jul, 2002 12:32:59 p GMT" name=creation_date></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<P class=header align=center>OGRE (Object-Oriented Graphics Rendering 
Engine)</P>
<P class=header align=center>Changing the way the ship moves </P>
<P class=MainHeader align=left>&nbsp;</P>
<P align=left>We want to change the way the ship moves for now so that we can 
rotate it. This will mean that when we are working on the lights on the wings we 
can get a better look at them. </P>
<P>Open Ship.h and change the frameStarted method to be <PRE></PRE><PRE>

    bool frameStarted(const FrameEvent&amp; evt)
    {
		// Move upto 80 units/second
		Real MoveFactor = 80.0 * evt.timeSinceLastFrame;

		// Copy the current state of the input devices
		mInputDevice-&gt;capture();

		// Move the ship node!
		if(mInputDevice-&gt;isKeyDown(Ogre::KC_UP))
		  mShipNode-&gt;translate(0.0, MoveFactor, 0.0);

		if(mInputDevice-&gt;isKeyDown(Ogre::KC_DOWN))
		  mShipNode-&gt;translate(0.0, -MoveFactor, 0.0);

		// Instead of moving the ship left and right, rotate it using yaw()
		if(mInputDevice-&gt;isKeyDown(Ogre::KC_LEFT))
		  mShipNode-&gt;yaw(MoveFactor);

		if(mInputDevice-&gt;isKeyDown(Ogre::KC_RIGHT))
		  mShipNode-&gt;yaw(-MoveFactor);

		return true;
    }


</PRE>
<TABLE cellSpacing=2 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
    <TD width="14%"><A 
      href="Index.html">Back 
      to Index</A></TD>
    <TD width="39%">&nbsp;</TD>
    <TD width="22%"><A 
      href="ProjectSetup.html">&lt;&lt; 
      Previous section</A></TD>
    <TD width="25%"><A 
      href="AvionicLights.html">Next 
      section &gt;&gt;</A></TD></TR></TBODY></TABLE>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P class=SectionHeader>&nbsp;</P></BODY></HTML>