Start of an internal 3-D view. If the property "/cockpit" (temporary
and soon to be renamed) is true, FlightGear will draw the 3-D model even in internal view. This makes sense right now only with the C310 model, since the others don't have any kind of interiors modeled and all surfaces in all models are one-sided. This isn't quite working yet -- the view code is very hard to disentangle, and currently, if the view is not forward, roll and pitch are applied incorrectly. It looks interesting (modulo a messy model) on the ground, in level flight, or looking straight ahead under any other flight conditions.
This commit is contained in:
parent
0618c2cae8
commit
bd3900a3ff
1 changed files with 13 additions and 2 deletions
|
@ -150,7 +150,9 @@ FGAircraftModel::update (int dt)
|
|||
long elapsed_ms = (_current_timestamp - _last_timestamp) / 1000;
|
||||
_last_timestamp.stamp();
|
||||
|
||||
if (globals->get_viewmgr()->get_current() == 0) {
|
||||
int view_number = globals->get_viewmgr()->get_current();
|
||||
|
||||
if (view_number == 0 && !fgGetBool("cockpit")) {
|
||||
_selector->select(false);
|
||||
} else {
|
||||
for (unsigned int i = 0; i < _animations.size(); i++)
|
||||
|
@ -171,7 +173,16 @@ FGAircraftModel::update (int dt)
|
|||
|
||||
sgMat4 sgTUX;
|
||||
sgCopyMat4( sgTUX, sgROT );
|
||||
sgPostMultMat4( sgTUX, pilot_view->get_VIEW_ROT() );
|
||||
sgMat4 VIEW_ROT;
|
||||
sgCopyMat4( VIEW_ROT, pilot_view->get_VIEW_ROT());
|
||||
if (view_number == 0) {
|
||||
// FIXME: orientation is not applied
|
||||
// correctly when view is not forward
|
||||
sgMakeRotMat4( sgROT, -pilot_view->get_view_offset()
|
||||
* SGD_RADIANS_TO_DEGREES, pilot_view->get_world_up() );
|
||||
sgPostMultMat4( VIEW_ROT, sgROT );
|
||||
}
|
||||
sgPostMultMat4( sgTUX, VIEW_ROT );
|
||||
sgPostMultMat4( sgTUX, sgTRANS );
|
||||
|
||||
sgCoord tuxpos;
|
||||
|
|
Loading…
Reference in a new issue