$24
Assignment
You will build on top of the posted solution to assignment four and implement 1) left-mouse-click selection and 2) Flying entities. Use the posted solution to assignment four as the basis for this assignment. Your mission:
Use bu ered input to implement left-mouse-click selection. As before, an axis aligned bounding box should bound the selected entity.
Add desiredAltitude and altitude variables and change the altitude towards the desiredAltitude at climbRate in your physics aspect to implement movement along the y-axis.
Architecture (10 points)
Understand and use the posted solution to assignment four and implement the two require-ments by adding to this codebase.
Simple 3D Physics (20 points)
Just like speed, desiredSpeed, and acceleration, ying entities simply need to change altitude to desiredAltitude according to a climbRate.
Controlling desired altitude (10 points)
Players control a selected ying entity's desired altitude using the numeric PgUp and numeric PgDn keys on your keyboard.
New ying entity mesh (10 points)
I have uploaded a new ying entity's mesh and material to our model website. Only this Banshee entity can y. You will need to take, place, and use these les to implement your ying entity. None of the other ship models or the alien vessel may leave the water surface. Make sure to load at least one example of each of the ve (5) di erent types of ship models (entity types) at http://www.cse.unr.edu/~sushil/models/381/ into your evolving game engine.
Camera control (5 points)
You will now control the camera with the WASD and E (up) and F (down) keys (get my permission if you would like to use di erent keys).
Quitting
Hitting the escape key should shut down your running game engine.
Tab selection (5 points)
Continue to leave the tab key bound to selection - that is - pressing the tab key will select the "next" entity. Only selected entities have visible axis aligned bounding boxes. So now, once you implement mouse selection, we will have two ways of selecting entities. Both can and should work together. Once you select an entity with a mouse left click, you should be able to select the \next" entity by pressing the tab button.
Mouse selection (40 points)
Use bu ered input to implement mouse selection in the input manager. Left clicking the mouse over an entity in our game world should select the entity under the mouse (and unselect any other selected entity). To use bu ered input, you will need to
Make your input manager inherit from OIS::MouseListener and OIS::KeyListener
Register the input manager to handle bu ered mouse and keyboard events with, for example:
mMouse-setEventCallback(this);
mKeyboard-setEventCallback(this);
during contruction or initialization of the input manager, as is done in the base appli-cation.
3. Make your input manager capture the mouse and keyboard every tick with, for example:
mKeyboard-capture();
mMouse-capture();
Override bool mousePressed(const OIS::MouseEvent &arg, OIS::MouseButtonID id) and put your ray-casting, distance thresholding, and nding the closest entity here.
You will want to use the code shown in lab as a guide (40 points).
Cumulative Extra Credit
Add shift-selection, where pressing the left-shift-key and tab key (or mouse), adds the next entity to the list of selected entities. User control applies to all selected entities (+5)
Add a speci c selection sound for each di erent type of entity. For example, when an entity of type, say, destroyer gets selected, it says Ready to destroy while when the frigate gets selected it says Let's go. Nothing obscene please (+10).
Third person view forward from a selected entity's point of view (+5) Add group mouse selection (+5)
Add the ability for selected entities to intercept another entity. Use right-mouse click to indicate the target ship to be intercepted (+5)
Add wakes to all entities. This code should be added to Renderer (+5)
Turning in your assignment
Assume that this format will be used for all your laboratory assignments throughout the semester unless otherwise speci ed.
Demonstrate your working program in the lab on the due date. You will be graded on your demonstration.
In lab, submit the assignment using canvas
Make a subdirectory in your home directory named as5.
Place all your project les in as5 (you will demo from this folder in lab).
Tar and gzip or Zip the entire folder and submit using Canvas
Ask me or one of the TAs if you have questions.
Objectives
Demonstrate an ability to apply knowledge of computing, mathematics, science, and engineering by learning and applying knowledge of C++ and game engine architecture to solve the problem of implementing a game engine
Demonstrate an ability to analyze a problem, and identify, formulate and use the appropriate computing and engineering requirements for obtaining its solution by using inheritance, callbacks, and polymorphism
Demonstrate an ability to use the techniques, skills, and modern engineering tools necessary for engineering practice by using the ogre engine framework and the eclipse
IDE
Demonstrate an ability to apply design and development principles in the construction of software systems or computer systems of varying complexity such as our game engine
4