|
coastline 0.0.4
|
The cameras that follow each vehicle. More...
#include <PR/ultratypes.h>#include "common/cameraprojection.h"#include "common/instantreplay.h"#include "common/render.h"#include "common/vecmath.h"#include "common/vehicle.h"
Go to the source code of this file.
Functions | |
| void | ResolveVehicleTrackCollision (Vehicle *vehicle, CameraFrame *camera, Vec3f *target) |
| Keep a camera out of the track: if the line from the look-at point of a vehicle to the camera passes through a triangle, and so does the line from a target point, put the camera just in front of the triangle, no farther from the look-at point than it was. | |
| void | UpdateCameraChase (Vehicle *vehicle, CameraFrame *camera, f32 share) |
| Move the chase camera behind a vehicle, blending the direction it was in towards the one behind the vehicle by a share. | |
| void | UpdateCameraLookAtTarget (Vehicle *vehicle) |
| Put the look-at point above a vehicle, ahead of it by a lead that shrinks with its speed. | |
| void | ComputeCameraBasis (Vehicle *vehicle, CameraFrame *camera) |
| Point a camera at the look-at point of a vehicle and build its axes about the world up. | |
| void | PlaceTrackCamera (Vehicle *vehicle) |
| Make the trackside camera active, placed ahead of and beside a vehicle. | |
| void | UpdateCameraViewBasisAndFov (Vehicle *vehicle, CameraFrame *camera) |
| Point a camera at a point one unit above a vehicle, build its axes about the world up, and zoom it with its distance from that point, as the trackside camera does. | |
| void | UpdateCameraSystem (Vehicle *vehicle) |
| Update every camera of a vehicle for a frame. | |
| void | InitCameraForVehicle (Vehicle *vehicle) |
| Set up the cameras of a vehicle at the start of a race. | |
| void | SetupCameraMatrix (CameraFrame *camera, f32 fov, f32 farDistance, f32 width, f32 height) |
| Build the view and the perspective of a camera for a rectangle of the screen, and set the far distance. | |
| void | SetupFrustumCorners (CameraFrame *camera, f32 fov, f32 farDistance, f32 width, f32 height) |
| Set up the corners of the far rectangle of the view of a camera, which the shadows clip to. | |
Variables | |
| s32 | g_bVehicleTrackCollisionCorrected |
| Whether the last call of ResolveVehicleTrackCollision() moved the camera. | |
| Vehicle * | g_pActiveCameraVehicle |
| The vehicle the view being drawn follows. | |
| s32 | g_dwReplayCameraHoldTimer |
| Counts down the frames after the chase camera hits the track in a replay. | |
| s32 | g_dwReplayCameraSwitchTimer |
| The frames until the replay changes its camera view again. | |
| s32 | g_dwCameraRayHitCount |
| Set to 1 by the ray cast down from the active camera each frame. | |
| u16 | g_awCameraRayHitInstances [] |
| The placed models of the ground below the active camera, the nearest first. | |
| s32 | g_dwRearViewMirrorMode |
| The size of the rear-view mirror over the bumper view: 0 for none, 1 small, 2 middling and 3 large. | |
| f32 | g_fCameraRayGroundDistance |
| What CastRayAgainstTrack() found below the camera of the view being drawn. | |
| s32 | g_dwCameraRayGroundSurface |
| The surface of the track below the active camera found by the last ray cast. | |
| s32 | g_dwCameraRayNearbyCount |
| The nearby placed models found by the last camera ray cast. | |
| u16 | g_awCameraRayNearbyInstances [] |
| The indices of nearby placed models found by the last camera ray cast. | |
| Vec3f | g_afFrustumCenter |
| The middle of the far rectangle of the view. | |
| Vec3f | g_vFrustumHalfRight |
| Half the far rectangle of the view, across. | |
| Vec3f | g_vFrustumHalfUp |
| Half the far rectangle of the view, up. | |
The cameras that follow each vehicle.
| void ResolveVehicleTrackCollision | ( | Vehicle * | vehicle, |
| CameraFrame * | camera, | ||
| Vec3f * | target ) |
Keep a camera out of the track: if the line from the look-at point of a vehicle to the camera passes through a triangle, and so does the line from a target point, put the camera just in front of the triangle, no farther from the look-at point than it was.
| vehicle | The vehicle the camera follows. |
| camera | The camera to move. |
| target | The point the second line starts from. |
| void UpdateCameraChase | ( | Vehicle * | vehicle, |
| CameraFrame * | camera, | ||
| f32 | share ) |
Move the chase camera behind a vehicle, blending the direction it was in towards the one behind the vehicle by a share.
| vehicle | The vehicle the camera follows. |
| camera | The chase camera. |
| share | The share of the way to the direction behind, from 0 for none to 1 for all of it. |
| void UpdateCameraLookAtTarget | ( | Vehicle * | vehicle | ) |
Put the look-at point above a vehicle, ahead of it by a lead that shrinks with its speed.
| vehicle | The vehicle whose look-at point to move. |
| void ComputeCameraBasis | ( | Vehicle * | vehicle, |
| CameraFrame * | camera ) |
Point a camera at the look-at point of a vehicle and build its axes about the world up.
| vehicle | The vehicle whose look-at point to point at. |
| camera | The camera whose axes to build. |
| void PlaceTrackCamera | ( | Vehicle * | vehicle | ) |
Make the trackside camera active, placed ahead of and beside a vehicle.
| vehicle | The vehicle the camera watches. |
| void UpdateCameraViewBasisAndFov | ( | Vehicle * | vehicle, |
| CameraFrame * | camera ) |
Point a camera at a point one unit above a vehicle, build its axes about the world up, and zoom it with its distance from that point, as the trackside camera does.
| vehicle | The vehicle the camera watches. |
| camera | The camera whose axes and field of view to set. |
| void UpdateCameraSystem | ( | Vehicle * | vehicle | ) |
Update every camera of a vehicle for a frame.
| vehicle | The vehicle whose cameras to update. |
| void InitCameraForVehicle | ( | Vehicle * | vehicle | ) |
Set up the cameras of a vehicle at the start of a race.
| vehicle | The vehicle whose cameras to set up. |
| void SetupCameraMatrix | ( | CameraFrame * | camera, |
| f32 | fov, | ||
| f32 | farDistance, | ||
| f32 | width, | ||
| f32 | height ) |
Build the view and the perspective of a camera for a rectangle of the screen, and set the far distance.
| camera | The camera. |
| fov | The field of view, in radians, for a screen of 4 by 3. |
| farDistance | The distance of the far plane. |
| width | The width of the rectangle. |
| height | The height of the rectangle. |
| void SetupFrustumCorners | ( | CameraFrame * | camera, |
| f32 | fov, | ||
| f32 | farDistance, | ||
| f32 | width, | ||
| f32 | height ) |
Set up the corners of the far rectangle of the view of a camera, which the shadows clip to.
| camera | The camera. |
| fov | The half angle of the view across, in radians. |
| farDistance | The distance of the far plane. |
| width | The width of the view. |
| height | The height of the view. |
|
extern |
Whether the last call of ResolveVehicleTrackCollision() moved the camera.
|
extern |
The vehicle the view being drawn follows.
|
extern |
Counts down the frames after the chase camera hits the track in a replay.
|
extern |
The frames until the replay changes its camera view again.
|
extern |
Set to 1 by the ray cast down from the active camera each frame.
RenderPrecipitationEffect() checks that many of g_awCameraRayHitInstances.
|
extern |
The placed models of the ground below the active camera, the nearest first.
|
extern |
The size of the rear-view mirror over the bumper view: 0 for none, 1 small, 2 middling and 3 large.
|
extern |
What CastRayAgainstTrack() found below the camera of the view being drawn.
|
extern |
The surface of the track below the active camera found by the last ray cast.
|
extern |
The nearby placed models found by the last camera ray cast.
|
extern |
The indices of nearby placed models found by the last camera ray cast.
|
extern |
The middle of the far rectangle of the view.
|
extern |
Half the far rectangle of the view, across.
|
extern |
Half the far rectangle of the view, up.