#include <mod_base_chase_plane.hh>
Public Member Functions | |
| ChasePlane (const SharedPtr< Craft > target) | |
| ~ChasePlane () | |
| void | Sync (void) |
| void | Enable (const bool enable=true) |
| void | Rotate (uint axis, Radian rad) |
| void | Translate (uint axis, fp inc) |
| void | Reset (void) |
Private Member Functions | |
| void | SetPosition (const WorldVertex &position) |
| void | Update (void) |
| void | ZoomOutFromTarget_ (void) |
| void | ChangeEye_ (void) |
Private Attributes | |
| CLASS_VAR SharedPtr0 < Craft > | msActiveTarget = NULL |
| const SharedPtr< Craft > | mTarget |
| Matrix | mViewMatrix |
| fp | mDistanceFromTarget |
| bool | mNeedInitialSync |
Friends | |
| class | Craft |
ChasePlane is a Mediator between View::Eye and a Craft. Craft provides a hook in SetPosition() to invoke a ChasePlane so ChasePlane follows its target.
Craft::EnableChasePlane( shptr<ChasePlane> ) Craft::SetPosition() --> ChasePlane::SetPosition()
Every Craft has a ChasePlane object so that the orientation and position of a ChasePlane is per-Craft, but only one ChasePlane can be active/enabled at a time.
An inactive ChasePlane can itself be changed but while inactive, it won't affect the View/Eye.
Computing the view of a ChasePlane: Think of the ChasePlane matrix as being where the target is, and it can be rotated arbitrarily. ZoomOutFromTarget() then moves the ChasePlane backwards so that it continually look at at the target. Effectively, the ChasePlane orbits its target while always looking at it.
| mod_base::ChasePlane::ChasePlane | ( | const SharedPtr< Craft > | target | ) |
| mod_base::ChasePlane::~ChasePlane | ( | ) |
| void mod_base::ChasePlane::Sync | ( | void | ) |
Sync matrixs of ChasePlane and its target.
The target matrix is a non-Eye matrix. The ChasePlane is an Eye matrix. This difference in mapping requires conversion by a transpose matrix.
| void mod_base::ChasePlane::Enable | ( | const bool | enable = true |
) |
Enable/disable ChasePlane. Continues to use the current ChasePlane matrix. Call Sync() to convert the target's matrix into the ChasePlane.
| void mod_base::ChasePlane::Rotate | ( | uint | axis, | |
| Radian | rad | |||
| ) |
Rotate ChasePlane.
Translate ChasePlane.
| void mod_base::ChasePlane::Reset | ( | void | ) |
Reset ChasePlane.
| void mod_base::ChasePlane::SetPosition | ( | const WorldVertex & | position | ) | [private] |
| void mod_base::ChasePlane::Update | ( | void | ) | [private] |
Update ChasePlane view.
| void mod_base::ChasePlane::ZoomOutFromTarget_ | ( | void | ) | [private] |
Subroutine of Update() -- not for use elsewhere.
| void mod_base::ChasePlane::ChangeEye_ | ( | void | ) | [private] |
Subroutine of Update() -- not for use elsewhere.
Call this after changing the ChasePlane's orientation or position. Eye should not be changed if the ChasePlane is inactive.
friend class Craft [friend] |
SharedPtrNull< Craft > mod_base::ChasePlane::msActiveTarget = NULL [private] |
const SharedPtr<Craft> mod_base::ChasePlane::mTarget [private] |
Matrix mod_base::ChasePlane::mViewMatrix [private] |
fp mod_base::ChasePlane::mDistanceFromTarget [private] |
bool mod_base::ChasePlane::mNeedInitialSync [private] |
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:28 2007