Rise
The Vieneo Province
Toggle main menu visibility
Loading...
Searching...
No Matches
VehicleLightProfiles.h
Go to the documentation of this file.
1
#pragma once
2
#include "
LandingLights.h
"
3
#include "
../Protocol/ServerTypes.h
"
4
5
namespace
LandingLights
6
{
7
inline
Profile
VehicleProfile
(
unsigned
char
type)
8
{
9
switch
(type)
10
{
11
case
VehicleType::C98
:
case
VehicleType::DIHV
:
12
case
VehicleType::C2
:
case
VehicleType::C2A
:
13
case
VehicleType::T120
:
case
VehicleType::T121
:
14
return
RoadLow
;
15
case
VehicleType::T27
:
// Mammoth's off-road driving lamps
16
return
TruckDriving
;
17
case
VehicleType::EVA_SUIT
:
return
Helmet
;
18
default
:
return
AircraftLanding
;
19
}
20
}
21
inline
Light
Configure
(
Light
light,
unsigned
char
type,
const
RiseMath::Matrix
& modelBase)
22
{
23
light.
profile
=
VehicleProfile
(type);
24
// Vehicle axes use -Y as physical up (SetProjectionMatrices rolls pi).
25
// Convert it back to model space so the low-beam cutoff clips the sky,
26
// not the road, and follows vehicle pitch/roll with the authored aim.
27
RiseMath::Matrix
inverse;
28
RiseMath::MatrixInverse
(&inverse,
nullptr
, &modelBase);
29
const
RiseMath::Vector3
vehicleUp(0, -1, 0);
30
RiseMath::Vec3TransformNormal
(&light.
up
, &vehicleUp, &inverse);
31
light.
up
=
OrthonormalUp
(light.
up
, light.
direction
);
32
return
light;
33
}
34
}
LandingLights.h
ServerTypes.h
EVA_SUIT
@ EVA_SUIT
Definition
ServerTypes.h:69
C98
@ C98
Definition
ServerTypes.h:61
C2
@ C2
Definition
ServerTypes.h:66
C2A
@ C2A
Definition
ServerTypes.h:81
T120
@ T120
Definition
ServerTypes.h:67
T27
@ T27
Definition
ServerTypes.h:82
DIHV
@ DIHV
Definition
ServerTypes.h:62
T121
@ T121
Definition
ServerTypes.h:89
LandingLights
Definition
BeamProfile.h:6
LandingLights::AircraftLanding
constexpr Profile AircraftLanding
Definition
BeamProfile.h:38
LandingLights::Configure
Light Configure(Light light, unsigned char type, const RiseMath::Matrix &modelBase)
Definition
VehicleLightProfiles.h:21
LandingLights::Helmet
constexpr Profile Helmet
Definition
BeamProfile.h:41
LandingLights::VehicleProfile
Profile VehicleProfile(unsigned char type)
Definition
VehicleLightProfiles.h:7
LandingLights::OrthonormalUp
Vector OrthonormalUp(Vector up, const Vector &direction)
Definition
BeamProfile.h:43
LandingLights::RoadLow
constexpr Profile RoadLow
Definition
BeamProfile.h:35
LandingLights::TruckDriving
constexpr Profile TruckDriving
Definition
BeamProfile.h:37
RiseMath::Vec3TransformNormal
Vector3 * Vec3TransformNormal(Vector3 *out, const Vector3 *a, const Matrix *m)
Definition
ClientMath.h:107
RiseMath::MatrixInverse
Matrix * MatrixInverse(Matrix *out, float *determinant, const Matrix *a)
Definition
ClientMath.h:118
LandingLights::Light
Definition
LandingLights.h:130
LandingLights::Light::up
RiseMath::Vector3 up
Definition
LandingLights.h:132
LandingLights::Light::direction
RiseMath::Vector3 direction
Definition
LandingLights.h:131
LandingLights::Light::profile
Profile profile
Definition
LandingLights.h:134
LandingLights::Profile
Definition
BeamProfile.h:11
RiseMath::Matrix
Definition
ClientMath.h:80
RiseMath::Vector3
Definition
ClientMath.h:38
Viewscreen
VehicleLightProfiles.h
Generated on
for Rise by
1.18.0