G3D::FirstPersonManipulator Class ReferenceUses a First Person (Quake- or World of Warcraft style) mapping to translate keyboard and mouse input into a flying camera position.
More...
#include <FirstPersonManipulator.h>
Inherits G3D::Manipulator.
List of all members.
Detailed Description
Uses a First Person (Quake- or World of Warcraft style) mapping to translate keyboard and mouse input into a flying camera position.
The result is an Euler-angle camera controller suitable for games and fly-throughs.
To use without G3D::GApp:
-
Create a G3D::RenderDevice
-
Create a UserInput object (set the keyboard controls when creating it)
-
Create a ManualCameraController
-
Call ManualCameraController::setActive(true)
-
Invoke ManualCameraController::doSimulation every time simulation is invoked (e.g. once per rendering iteration)
-
Use ManualCameraController::getCoordinateFrame() to set the camera's position
Member Typedef Documentation
Member Enumeration Documentation
MOUSE_DIRECT = Shooter/Quake style (default), mouse cursor is hidden and mouse controls yaw/pitch.
MOUSE_DIRECT_RIGHT_BUTTON = RPG/World of Warcraft style, on right mouse button cursor is hidden and mouse controls yaw/pitch. On OS X, ctrl+left and shift+left button are treated as the right mouse button.
MOUSE_SCROLL_AT_EDGE = Leaves mouse cursor visible and rotates while mouse is near the window edge
MOUSE_PUSH_AT_EDGE = Leaves mouse cursor visible and rotates when the mouse is actively pushing against the window edge - Enumerator:
-
| MOUSE_DIRECT |
|
| MOUSE_DIRECT_RIGHT_BUTTON |
|
| MOUSE_SCROLL_AT_EDGE |
|
| MOUSE_PUSH_AT_EDGE |
|
Constructor & Destructor Documentation
| virtual G3D::FirstPersonManipulator::~FirstPersonManipulator |
( |
|
) |
[virtual] |
Deactivates the controller.
Member Function Documentation
| bool G3D::FirstPersonManipulator::active |
( |
|
) |
const |
| virtual void G3D::Widget::fireEvent |
( |
const GEvent & |
event |
) |
[virtual, inherited] |
| virtual CoordinateFrame G3D::FirstPersonManipulator::frame |
( |
|
) |
const [virtual] |
| virtual void G3D::FirstPersonManipulator::getFrame |
( |
CoordinateFrame & |
c |
) |
const [virtual] |
| void G3D::FirstPersonManipulator::lookAt |
( |
const Vector3 & |
position |
) |
|
| Vector3 G3D::FirstPersonManipulator::lookVector |
( |
|
) |
const [inline] |
| MouseMode G3D::FirstPersonManipulator::mouseMode |
( |
|
) |
const |
| virtual bool G3D::FirstPersonManipulator::onEvent |
( |
const GEvent & |
event |
) |
[virtual] |
Returning true consumes the event and prevents other GModules from seeing it.
Motion events (GEventType::MOUSEMOTION, GEventType::JOYHATMOTION, JGEventType::OYBALLMOTION, and GEventType::JOYAXISMOTION) cannot be cancelled.
Implements G3D::Widget.
| virtual void G3D::FirstPersonManipulator::onLogic |
( |
|
) |
[virtual] |
| virtual void G3D::FirstPersonManipulator::onNetwork |
( |
|
) |
[virtual] |
Appends a posed model for this object to the array, if it has a graphic representation.
The posed model appended is allowed to reference the agent and is allowed to mutate if the agent is mutated.
Implements G3D::Widget.
| virtual void G3D::FirstPersonManipulator::onUserInput |
( |
UserInput * |
ui |
) |
[virtual] |
| float G3D::FirstPersonManipulator::pitch |
( |
|
) |
const [inline] |
| const Vector3& G3D::FirstPersonManipulator::position |
( |
|
) |
const [inline] |
| void G3D::ReferenceCountedObject::ReferenceCountedObject_zeroWeakPointers |
( |
|
) |
[inline, inherited] |
Automatically called immediately before the object is deleted.
This is not called from the destructor because it needs to be invoked before the subclass destructor.
| void G3D::FirstPersonManipulator::reset |
( |
|
) |
|
Invoke immediately before entering the main game loop.
| void G3D::FirstPersonManipulator::setActive |
( |
bool |
a |
) |
|
When active, the FirstPersonManipulator takes over the mouse.
It turns off the mouse cursor and switches to first person controller style. Use this to toggle between your menu system and first person camera control.
When deactivated, the mouse cursor is restored and the mouse is located where it was when the camera controller was activated.
In release mode, the cursor movement is restricted to the window while the controller is active. This does not occur in debug mode because you might hit a breakpoint while the controller is active and it would be annoying to not be able to move the mouse.
Sets to the closest legal controller orientation to the coordinate frame.
| virtual void G3D::Widget::setManager |
( |
WidgetManager * |
m |
) |
[inline, virtual, inherited] |
| void G3D::FirstPersonManipulator::setMouseMode |
( |
MouseMode |
m |
) |
|
| void G3D::FirstPersonManipulator::setMoveRate |
( |
double |
metersPerSecond |
) |
|
| void G3D::FirstPersonManipulator::setPosition |
( |
const Vector3 & |
t |
) |
[inline] |
| void G3D::FirstPersonManipulator::setTurnRate |
( |
double |
radiansPerSecond |
) |
|
| virtual GWindow* G3D::Widget::window |
( |
|
) |
const [virtual, inherited] |
| float G3D::FirstPersonManipulator::yaw |
( |
|
) |
const [inline] |
Member Data Documentation
The manager, set by setManager().
This cannot be a reference counted pointer because that would create a cycle between the Widget and its manager.
The long name is to keep this from accidentally conflicting with a subclass's variable name.
Do not use or explicitly manipulate this value--its type may change in the future and is not part of the supported API.
Linked list of all weak pointers that reference this (some may be on the stack!).
Do not use or explicitly manipulate this value.
The documentation for this class was generated from the following file:
Generated on Thu Aug 2 11:40:45 2007 for G3D by
1.5.2
Hosted by
|