mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 17:29:18 +02:00
more glm instead of Math3D in vehicle
This commit is contained in:
@@ -716,7 +716,7 @@ private:
|
|||||||
// TODO: check if scanning takes into account direction when selecting axle
|
// TODO: check if scanning takes into account direction when selecting axle
|
||||||
// if it does, replace the version above
|
// if it does, replace the version above
|
||||||
// if it doesn't, fix it so it does
|
// if it doesn't, fix it so it does
|
||||||
inline Math3D::vector3 AxlePositionGet() {
|
inline glm::dvec3 AxlePositionGet() {
|
||||||
return (
|
return (
|
||||||
iDirection ?
|
iDirection ?
|
||||||
( iAxleFirst ? Axle1.pPosition : Axle0.pPosition ) :
|
( iAxleFirst ? Axle1.pPosition : Axle0.pPosition ) :
|
||||||
@@ -834,8 +834,8 @@ public:
|
|||||||
std::pair<double, double> shake_angles() const;
|
std::pair<double, double> shake_angles() const;
|
||||||
// members
|
// members
|
||||||
struct baseshake_config {
|
struct baseshake_config {
|
||||||
Math3D::vector3 angle_scale { 0.05, 0.0, 0.1 }; // roll, yaw, pitch
|
glm::dvec3 angle_scale { 0.05, 0.0, 0.1 }; // roll, yaw, pitch
|
||||||
Math3D::vector3 jolt_scale { 0.2, 0.2, 0.1 };
|
glm::dvec3 jolt_scale{0.2, 0.2, 0.1};
|
||||||
double jolt_limit { 2.0f };
|
double jolt_limit { 2.0f };
|
||||||
} BaseShake;
|
} BaseShake;
|
||||||
struct engineshake_config {
|
struct engineshake_config {
|
||||||
|
|||||||
@@ -563,7 +563,7 @@ TTrain::TTrain() {
|
|||||||
fPPress = fNPress = 0;
|
fPPress = fNPress = 0;
|
||||||
|
|
||||||
// asMessage="";
|
// asMessage="";
|
||||||
pMechOffset = Math3D::vector3(0, 0, 0);
|
pMechOffset = glm::dvec3(0, 0, 0);
|
||||||
fBlinkTimer = 0;
|
fBlinkTimer = 0;
|
||||||
fHaslerTimer = 0;
|
fHaslerTimer = 0;
|
||||||
DynamicSet(NULL); // ustawia wszystkie mv*
|
DynamicSet(NULL); // ustawia wszystkie mv*
|
||||||
@@ -5147,11 +5147,10 @@ void TTrain::OnCommand_endsignalstoggle( TTrain *Train, command_data const &Comm
|
|||||||
auto *vehicle { std::get<TDynamicObject *>( simulation::Region->find_vehicle( Command.location, 10, false, true ) ) };
|
auto *vehicle { std::get<TDynamicObject *>( simulation::Region->find_vehicle( Command.location, 10, false, true ) ) };
|
||||||
|
|
||||||
if( vehicle == nullptr ) { return; }
|
if( vehicle == nullptr ) { return; }
|
||||||
// TODO: Maybe command_data should be dvec3?
|
|
||||||
int const CouplNr {
|
int const CouplNr {
|
||||||
clamp(
|
clamp(
|
||||||
vehicle->DirectionGet()
|
vehicle->DirectionGet()
|
||||||
* ( Math3D::LengthSquared3( vehicle->HeadPosition() - glm::dvec3(Command.location) ) > Math3D::LengthSquared3( vehicle->RearPosition() - glm::dvec3(Command.location) ) ?
|
* ( glm::length2( vehicle->HeadPosition() - glm::dvec3(Command.location) ) > glm::length2( vehicle->RearPosition() - glm::dvec3(Command.location) ) ?
|
||||||
1 :
|
1 :
|
||||||
-1 ),
|
-1 ),
|
||||||
0, 1 ) }; // z [-1,1] zrobić [0,1]
|
0, 1 ) }; // z [-1,1] zrobić [0,1]
|
||||||
|
|||||||
Reference in New Issue
Block a user