Put the pilot's own vehicle on the Winners Circle
Your own vehicle is built insideEntity - a cockpit and no hull, because you are sitting in it and never see it. That is fine for a race and wrong for a podium: from the presentation camera your spot on the stand was the one that was empty, and on a single-pod race that is the whole picture. The renderer now gives the viewpoint entity an exterior before the shot. Disconnected_Eye is the engine's own switch for this case, documented as being there "so higher level renderers can fix the eye in one spot and watch the viewpoint entity drive around", and it is what makes NotifyOfNewInterestingEntity choose outsideEntity. The exterior is added alongside what is already there rather than by tearing the entity down and rebuilding it. Teardown-and-rebuild is the path the interest manager uses constantly for scenery dropping out of range, so it looked safe, but it is not safe for the viewpoint entity: that one is never uninteresting, the eye renderable goes down with it, and doing it mid-mission stops the scene rendering at all - the screen went black from the moment the podium came up and never came back. Adding the renderables directly does the same job with nothing removed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -7047,6 +7047,63 @@ void
|
||||
mPresentationCamera = False;
|
||||
}
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// Give the pilot a vehicle to look at. Their own is built insideEntity - a
|
||||
// cockpit and no hull - so on the podium they would be the one empty spot.
|
||||
// Drop those renderables and build the entity again with Disconnected_Eye
|
||||
// set, which is what makes NotifyOfNewInterestingEntity choose outsideEntity.
|
||||
//
|
||||
// Tearing renderables down and rebuilding is the same path the interest
|
||||
// manager takes every time something drops out of range mid-race, so it is
|
||||
// well travelled. The eye renderable goes with them, which is fine: the
|
||||
// presentation camera supplies the view once the podium is up.
|
||||
//
|
||||
void
|
||||
DPLRenderer::ShowViewpointFromOutside()
|
||||
{
|
||||
Check(this);
|
||||
|
||||
Entity *viewpoint = GetLinkedEntity();
|
||||
if (viewpoint == NULL)
|
||||
{
|
||||
DEBUG_STREAM << "WinnersCircle: no viewpoint entity to turn around\n"
|
||||
<< std::flush;
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Add the exterior alongside what is already there rather than tearing
|
||||
// the entity down and rebuilding it. The teardown path is safe for
|
||||
// scenery going out of range, but not for the viewpoint entity: it is
|
||||
// never uninteresting, the eye renderable goes with it, and doing it
|
||||
// mid-mission stops the scene rendering altogether.
|
||||
//
|
||||
// This is what NotifyOfNewInterestingEntity does, minus the teardown
|
||||
// and with the view type forced.
|
||||
//
|
||||
Check(application);
|
||||
ResourceFile *resource_file = application->GetResourceFile();
|
||||
Check(resource_file);
|
||||
ResourceDescription *video_resource = resource_file->SearchList(
|
||||
viewpoint->GetResourceID(),
|
||||
ResourceDescription::VideoModelResourceType);
|
||||
|
||||
if (video_resource == NULL)
|
||||
{
|
||||
DEBUG_STREAM << "WinnersCircle: own vehicle has no exterior model\n"
|
||||
<< std::flush;
|
||||
return;
|
||||
}
|
||||
|
||||
video_resource->Lock();
|
||||
MakeEntityRenderables(viewpoint, video_resource, outsideEntity);
|
||||
video_resource->Unlock();
|
||||
|
||||
DEBUG_STREAM << "WinnersCircle: own vehicle given an exterior\n"
|
||||
<< std::flush;
|
||||
}
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// Come up out of the black. SetFogStyle(winnersCircleFogStyle) has already
|
||||
|
||||
@@ -343,6 +343,16 @@ public:
|
||||
//------------------------------------------------------------------
|
||||
void StartPresentationFadeIn(Scalar seconds);
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Rebuild the viewpoint entity - the pilot's own vehicle - as an
|
||||
// exterior. It is normally built insideEntity, which is a cockpit
|
||||
// and no hull, so from any camera that is not in it you see nothing
|
||||
// where your own vehicle should be. Disconnected_Eye is the engine's
|
||||
// own switch for this: "so higher level renderers can fix the eye in
|
||||
// one spot and watch the viewpoint entity drive around."
|
||||
//------------------------------------------------------------------
|
||||
void ShowViewpointFromOutside();
|
||||
|
||||
unsigned int* MakeBitSliceStorage();
|
||||
|
||||
void SortAndReloadNameBitmaps();
|
||||
|
||||
@@ -215,6 +215,15 @@ void
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
//---------------------------------------------------------------------
|
||||
// Your own vehicle is built as a cockpit with no hull, so from any
|
||||
// camera outside it there is nothing where you should be - on the stand
|
||||
// you would be the one empty spot. Turn it inside out before the shot.
|
||||
//---------------------------------------------------------------------
|
||||
//
|
||||
dpl_renderer->ShowViewpointFromOutside();
|
||||
|
||||
//
|
||||
//---------------------------------------------------------------------
|
||||
// The name plates are drawn per rank slot, so they have to be re-sorted
|
||||
|
||||
Reference in New Issue
Block a user