2016-02-20 23:25:00 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-09-30 02:56:11 +02:00
|
|
|
#include "Entity/Vehicle.hpp"
|
2016-02-20 23:25:00 +01:00
|
|
|
#include "Entity/Player.hpp"
|
2015-10-29 21:56:07 +01:00
|
|
|
#include "Base/Quaternion.hpp"
|
2016-05-22 05:20:38 +02:00
|
|
|
#include "Base/Vector2.hpp"
|
|
|
|
#include "Base/Vector3.hpp"
|
2015-11-01 00:33:12 +01:00
|
|
|
#include "Core.hpp"
|
2021-01-30 07:51:39 +01:00
|
|
|
#include "Core/Areas.hpp"
|
|
|
|
#include "Core/Tasks.hpp"
|
2015-09-30 02:56:11 +02:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
namespace SqMod {
|
|
|
|
|
2016-11-15 20:16:24 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
SQMOD_DECL_TYPENAME(Typename, _SC("SqVehicle"))
|
2016-11-15 20:16:24 +01:00
|
|
|
|
2015-11-01 00:33:12 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
const int32_t CVehicle::Max = SQMOD_VEHICLE_POOL;
|
2016-02-20 23:25:00 +01:00
|
|
|
|
2016-08-07 00:54:33 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
SQInteger CVehicle::SqGetNull(HSQUIRRELVM vm)
|
|
|
|
{
|
2020-04-17 16:42:09 +02:00
|
|
|
sq_pushobject(vm, Core::Get().GetNullVehicle().GetObj());
|
2016-08-07 00:54:33 +02:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-02-21 20:24:59 +01:00
|
|
|
LightObj & CVehicle::GetNull()
|
2016-08-07 00:54:33 +02:00
|
|
|
{
|
|
|
|
return Core::Get().GetNullVehicle();
|
|
|
|
}
|
|
|
|
|
2016-02-20 23:25:00 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
CVehicle::CVehicle(int32_t id)
|
2016-02-20 23:25:00 +01:00
|
|
|
: m_ID(VALID_ENTITYGETEX(id, SQMOD_VEHICLE_POOL))
|
2021-01-30 07:51:39 +01:00
|
|
|
, m_Tag(fmt::format("{}", id)), m_Data(), m_CircularLocks(0)
|
2015-11-01 00:33:12 +01:00
|
|
|
{
|
|
|
|
/* ... */
|
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
const String & CVehicle::ToString() const
|
2016-02-20 23:25:00 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
return m_Tag;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-03-10 04:57:13 +01:00
|
|
|
const String & CVehicle::GetTag() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
return m_Tag;
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
2015-10-29 21:56:07 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2019-02-17 16:23:59 +01:00
|
|
|
void CVehicle::SetTag(StackStrF & tag)
|
2016-02-20 23:25:00 +01:00
|
|
|
{
|
2016-11-16 13:49:12 +01:00
|
|
|
if (tag.mLen > 0)
|
|
|
|
{
|
2020-03-22 09:00:31 +01:00
|
|
|
m_Tag.assign(tag.mPtr, static_cast< size_t >(tag.mLen));
|
2016-11-16 13:49:12 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_Tag.clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2019-02-17 16:23:59 +01:00
|
|
|
CVehicle & CVehicle::ApplyTag(StackStrF & tag)
|
2016-11-16 13:49:12 +01:00
|
|
|
{
|
|
|
|
SetTag(tag);
|
|
|
|
return *this;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-02-21 20:24:59 +01:00
|
|
|
LightObj & CVehicle::GetData()
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return m_Data;
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
2015-10-29 21:56:07 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-02-21 20:24:59 +01:00
|
|
|
void CVehicle::SetData(LightObj & data)
|
2016-02-20 23:25:00 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Apply the specified value
|
|
|
|
m_Data = data;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
bool CVehicle::Destroy(int32_t header, LightObj & payload) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2016-05-22 05:20:38 +02:00
|
|
|
return Core::Get().DelVehicle(m_ID, header, payload);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-02-21 20:24:59 +01:00
|
|
|
LightObj & CVehicle::GetEvents() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-02-21 20:24:59 +01:00
|
|
|
// Return the associated event table
|
|
|
|
return Core::Get().GetVehicle(m_ID).mEvents;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-07-26 23:13:50 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::CustomEvent(int32_t header, LightObj & payload) const
|
2016-07-26 23:13:50 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2021-01-30 07:51:39 +01:00
|
|
|
// Perform the requested action
|
2016-07-26 23:13:50 +02:00
|
|
|
Core::Get().EmitVehicleCustom(m_ID, header, payload);
|
|
|
|
}
|
|
|
|
|
2015-10-29 21:56:07 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
bool CVehicle::IsStreamedFor(CPlayer & player) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Is the specified player even valid?
|
2016-02-20 23:25:00 +01:00
|
|
|
if (!player.IsActive())
|
2016-03-12 21:51:44 +01:00
|
|
|
{
|
2016-03-21 21:37:58 +01:00
|
|
|
STHROWF("Invalid player argument: null");
|
2016-03-12 21:51:44 +01:00
|
|
|
}
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return _Func->IsVehicleStreamedForPlayer(m_ID, player.GetID());
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
2015-10-29 21:56:07 +01:00
|
|
|
|
2016-05-22 05:20:38 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
bool CVehicle::GetOption(int32_t option_id) const
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Attempt to obtain the current value of the specified option
|
|
|
|
const bool value = _Func->GetVehicleOption(m_ID, static_cast< vcmpVehicleOption >(option_id));
|
|
|
|
// Check for errors
|
|
|
|
if (_Func->GetLastError() == vcmpErrorArgumentOutOfBounds)
|
|
|
|
{
|
2021-02-03 16:50:39 +01:00
|
|
|
STHROWF("Invalid option identifier: {}", option_id);
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
// Return the requested value
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetOption(int32_t option_id, bool toggle)
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Attempt to obtain the current value of the specified option
|
|
|
|
const bool value = _Func->GetVehicleOption(m_ID, static_cast< vcmpVehicleOption >(option_id));
|
2021-09-12 14:55:55 +02:00
|
|
|
// Avoid infinite recursive event loops
|
|
|
|
if (!(m_CircularLocks & VEHICLECL_EMIT_VEHICLE_OPTION))
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Prevent this event from triggering while executed
|
2016-08-18 13:38:00 +02:00
|
|
|
BitGuardU32 bg(m_CircularLocks, VEHICLECL_EMIT_VEHICLE_OPTION);
|
2016-05-22 05:20:38 +02:00
|
|
|
// Now forward the event call
|
2017-02-21 20:24:59 +01:00
|
|
|
Core::Get().EmitVehicleOption(m_ID, option_id, value, 0, NullLightObj());
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
2021-09-12 14:55:55 +02:00
|
|
|
// Attempt to modify the current value of the specified option
|
|
|
|
if (_Func->SetVehicleOption(m_ID, static_cast< vcmpVehicleOption >(option_id),
|
|
|
|
static_cast< uint8_t >(toggle)) == vcmpErrorArgumentOutOfBounds)
|
|
|
|
{
|
|
|
|
STHROWF("Invalid option identifier: {}", option_id);
|
|
|
|
}
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetOptionEx(int32_t option_id, bool toggle, int32_t header, LightObj & payload)
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Attempt to obtain the current value of the specified option
|
|
|
|
const bool value = _Func->GetVehicleOption(m_ID, static_cast< vcmpVehicleOption >(option_id));
|
2021-09-12 14:55:55 +02:00
|
|
|
// Avoid infinite recursive event loops
|
|
|
|
if (!(m_CircularLocks & VEHICLECL_EMIT_VEHICLE_OPTION))
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Prevent this event from triggering while executed
|
2016-08-18 13:38:00 +02:00
|
|
|
BitGuardU32 bg(m_CircularLocks, VEHICLECL_EMIT_VEHICLE_OPTION);
|
2016-05-22 05:20:38 +02:00
|
|
|
// Now forward the event call
|
|
|
|
Core::Get().EmitVehicleOption(m_ID, option_id, value, header, payload);
|
|
|
|
}
|
2021-09-12 14:55:55 +02:00
|
|
|
// Attempt to modify the current value of the specified option
|
|
|
|
if (_Func->SetVehicleOption(m_ID, static_cast< vcmpVehicleOption >(option_id),
|
|
|
|
static_cast< uint8_t >(toggle)) == vcmpErrorArgumentOutOfBounds)
|
|
|
|
{
|
|
|
|
STHROWF("Invalid option identifier: {}", option_id);
|
|
|
|
}
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t CVehicle::GetSyncSource() const
|
2016-02-20 23:25:00 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return _Func->GetVehicleSyncSource(m_ID);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t CVehicle::GetSyncType() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return _Func->GetVehicleSyncType(m_ID);
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
2015-10-29 21:56:07 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t CVehicle::GetWorld() const
|
2016-02-20 23:25:00 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return _Func->GetVehicleWorld(m_ID);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetWorld(int32_t world)
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2016-08-18 13:38:00 +02:00
|
|
|
// Grab the current value for this property
|
2021-01-30 07:51:39 +01:00
|
|
|
const int32_t current = _Func->GetVehicleWorld(m_ID);
|
2016-08-18 13:38:00 +02:00
|
|
|
// Don't even bother if it's the same value
|
|
|
|
if (current == world)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// Avoid infinite recursive event loops
|
|
|
|
if (!(m_CircularLocks & VEHICLECL_EMIT_VEHICLE_WORLD))
|
|
|
|
{
|
|
|
|
// Prevent this event from triggering while executed
|
|
|
|
BitGuardU32 bg(m_CircularLocks, VEHICLECL_EMIT_VEHICLE_WORLD);
|
|
|
|
// Now forward the event call
|
|
|
|
Core::Get().EmitVehicleWorld(m_ID, current, world);
|
|
|
|
}
|
2021-09-12 14:55:55 +02:00
|
|
|
// Avoid property unwind from a recursive call
|
|
|
|
_Func->SetVehicleWorld(m_ID, world);
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
2015-10-29 21:56:07 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t CVehicle::GetModel() const
|
2016-02-20 23:25:00 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return _Func->GetVehicleModel(m_ID);
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
LightObj & CVehicle::GetOccupant(int32_t slot) const
|
2016-02-20 23:25:00 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-05-25 21:15:32 +02:00
|
|
|
// Attempt to retrieve the requested information
|
|
|
|
const int id = _Func->GetVehicleOccupant(m_ID, slot);
|
|
|
|
// Was there an issue with the given value?
|
2018-01-24 16:59:51 +01:00
|
|
|
if (INVALID_ENTITYEX(id, SQMOD_PLAYER_POOL))
|
2017-05-25 21:15:32 +02:00
|
|
|
{
|
|
|
|
const vcmpError err = _Func->GetLastError();
|
2018-07-27 18:50:18 +02:00
|
|
|
// Identify the type of error and at least log it
|
2017-05-25 21:15:32 +02:00
|
|
|
if (err == vcmpErrorArgumentOutOfBounds)
|
|
|
|
{
|
2018-07-27 18:50:18 +02:00
|
|
|
LogWrn("Out of range slot [%d]", slot);
|
2017-05-25 21:15:32 +02:00
|
|
|
}
|
|
|
|
else if (err == vcmpErrorNoSuchEntity)
|
|
|
|
{
|
2018-07-27 18:50:18 +02:00
|
|
|
LogWrn("Unoccupied slot [%d]", id);
|
2017-05-25 21:15:32 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-07-27 18:50:18 +02:00
|
|
|
LogWrn("Error while getting occupant at [%d] for [%s]", slot, m_Tag.c_str());
|
2017-05-25 21:15:32 +02:00
|
|
|
}
|
2018-07-27 18:50:18 +02:00
|
|
|
// Default to a null instance
|
2018-07-27 18:53:01 +02:00
|
|
|
return Core::Get().GetNullVehicle();
|
2017-05-25 21:15:32 +02:00
|
|
|
}
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-05-25 21:15:32 +02:00
|
|
|
return Core::Get().GetPlayer(id).mObj;
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t CVehicle::GetOccupantID(int32_t slot) const
|
2016-02-20 23:25:00 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return _Func->GetVehicleOccupant(m_ID, slot);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2018-01-28 21:53:27 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
bool CVehicle::HasOccupant(int32_t slot) const
|
2018-01-28 21:53:27 +01:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
2021-01-30 07:51:39 +01:00
|
|
|
const int32_t id = _Func->GetVehicleOccupant(m_ID, slot);
|
2018-01-28 21:53:27 +01:00
|
|
|
// Use the server errors to see if there was an occupant
|
|
|
|
const vcmpError err = _Func->GetLastError();
|
|
|
|
// Return whether there was no error and the returned ID is valid
|
2021-03-27 15:25:31 +01:00
|
|
|
return (err == vcmpErrorNone) && VALID_ENTITYEX(id, SQMOD_PLAYER_POOL);
|
2018-01-28 21:53:27 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CVehicle::Respawn() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->RespawnVehicle(m_ID);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-07-23 16:29:32 +02:00
|
|
|
uint32_t CVehicle::GetImmunity() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return _Func->GetVehicleImmunityFlags(m_ID);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-07-23 16:29:32 +02:00
|
|
|
void CVehicle::SetImmunity(uint32_t flags)
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2016-08-18 13:45:12 +02:00
|
|
|
// Grab the current value for this property
|
2021-07-23 16:29:32 +02:00
|
|
|
const uint32_t current = _Func->GetVehicleImmunityFlags(m_ID);
|
2016-08-18 13:45:12 +02:00
|
|
|
// Avoid infinite recursive event loops
|
|
|
|
if (!(m_CircularLocks & VEHICLECL_EMIT_VEHICLE_IMMUNITY))
|
|
|
|
{
|
|
|
|
// Prevent this event from triggering while executed
|
|
|
|
BitGuardU32 bg(m_CircularLocks, VEHICLECL_EMIT_VEHICLE_IMMUNITY);
|
|
|
|
// Now forward the event call
|
2021-07-23 16:29:32 +02:00
|
|
|
Core::Get().EmitVehicleImmunity(m_ID, static_cast< int32_t >(current), static_cast< int32_t >(flags));
|
2016-08-18 13:45:12 +02:00
|
|
|
}
|
2021-09-12 14:55:55 +02:00
|
|
|
// Avoid property unwind from a recursive call
|
|
|
|
_Func->SetVehicleImmunityFlags(m_ID, static_cast< uint32_t >(flags));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-05-22 05:20:38 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void CVehicle::Explode() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->ExplodeVehicle(m_ID);
|
|
|
|
}
|
|
|
|
|
2021-03-15 06:01:26 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void CVehicle::FlattenTyres(bool toggle) const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
if(toggle)
|
|
|
|
{
|
|
|
|
_Func->SetVehicleTyreStatus(m_ID, 0, 0);
|
|
|
|
_Func->SetVehicleTyreStatus(m_ID, 1, 0);
|
|
|
|
_Func->SetVehicleTyreStatus(m_ID, 2, 0);
|
|
|
|
_Func->SetVehicleTyreStatus(m_ID, 3, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_Func->SetVehicleTyreStatus(m_ID, 0, 1);
|
|
|
|
_Func->SetVehicleTyreStatus(m_ID, 1, 1);
|
|
|
|
_Func->SetVehicleTyreStatus(m_ID, 2, 1);
|
|
|
|
_Func->SetVehicleTyreStatus(m_ID, 3, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
bool CVehicle::IsWrecked() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return _Func->IsVehicleWrecked(m_ID);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-08-06 20:15:32 +02:00
|
|
|
Vector3 CVehicle::GetPosition() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Create a default vector instance
|
|
|
|
Vector3 vec;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the values
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->GetVehiclePosition(m_ID, &vec.x, &vec.y, &vec.z);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return vec;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CVehicle::SetPosition(const Vector3 & pos) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehiclePosition(m_ID, pos.x, pos.y, pos.z, static_cast< uint8_t >(false));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetPositionB(const Vector3 & pos, bool empty) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehiclePosition(m_ID, pos.x, pos.y, pos.z, static_cast< uint8_t >(empty));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetPositionEx(float x, float y, float z) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehiclePosition(m_ID, x, y, z, static_cast< uint8_t >(false));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetPositionExB(float x, float y, float z, bool empty) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehiclePosition(m_ID, x, y, z, static_cast< uint8_t >(empty));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-08-06 20:15:32 +02:00
|
|
|
Quaternion CVehicle::GetRotation() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Create a default quaternion instance
|
2021-01-30 07:51:39 +01:00
|
|
|
Quaternion q;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the values
|
2021-01-30 07:51:39 +01:00
|
|
|
_Func->GetVehicleRotation(m_ID, &q.x, &q.y, &q.z, &q.w);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2021-01-30 07:51:39 +01:00
|
|
|
return q;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CVehicle::SetRotation(const Quaternion & rot) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleRotation(m_ID, rot.x, rot.y, rot.z, rot.w);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetRotationEx(float x, float y, float z, float w) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleRotation(m_ID, x, y, z, w);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-08-06 20:15:32 +02:00
|
|
|
Vector3 CVehicle::GetRotationEuler() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Create a default vector instance
|
|
|
|
Vector3 vec;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the values
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->GetVehicleRotationEuler(m_ID, &vec.x, &vec.y, &vec.z);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return vec;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CVehicle::SetRotationEuler(const Vector3 & rot) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleRotationEuler(m_ID, rot.x, rot.y, rot.z);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetRotationEulerEx(float x, float y, float z) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleRotationEuler(m_ID, x, y, z);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-08-06 20:15:32 +02:00
|
|
|
Vector3 CVehicle::GetSpeed() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Create a default vector instance
|
|
|
|
Vector3 vec;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the values
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleSpeed(m_ID, &vec.x, &vec.y, &vec.z, static_cast< uint8_t >(false));
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return vec;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CVehicle::SetSpeed(const Vector3 & vel) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleSpeed(m_ID, vel.x, vel.y, vel.z,
|
|
|
|
static_cast< uint8_t >(false), static_cast< uint8_t >(false));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetSpeedEx(float x, float y, float z) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleSpeed(m_ID, x, y, z, static_cast< uint8_t >(false), static_cast< uint8_t >(false));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CVehicle::AddSpeed(const Vector3 & vel) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleSpeed(m_ID, vel.x, vel.y, vel.z,
|
|
|
|
static_cast< uint8_t >(true), static_cast< uint8_t >(false));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::AddSpeedEx(float x, float y, float z) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleSpeed(m_ID, x, y, z, static_cast< uint8_t >(true), static_cast< uint8_t >(false));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-08-06 20:15:32 +02:00
|
|
|
Vector3 CVehicle::GetRelativeSpeed() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Create a default vector instance
|
|
|
|
Vector3 vec;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the values
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleSpeed(m_ID, &vec.x, &vec.y, &vec.z, static_cast< uint8_t >(true));
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return vec;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::SetRelativeSpeed(const Vector3 & vel) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleSpeed(m_ID, vel.x, vel.y, vel.z,
|
|
|
|
static_cast< uint8_t >(false), static_cast< uint8_t >(true));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetRelativeSpeedEx(float x, float y, float z) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleSpeed(m_ID, x, y, z, static_cast< uint8_t >(false), static_cast< uint8_t >(true));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::AddRelativeSpeed(const Vector3 & vel) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleSpeed(m_ID, vel.x, vel.y, vel.z,
|
|
|
|
static_cast< uint8_t >(true), static_cast< uint8_t >(true));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::AddRelativeSpeedEx(float x, float y, float z) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleSpeed(m_ID, x, y, z, static_cast< uint8_t >(true), static_cast< uint8_t >(true));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-08-06 20:15:32 +02:00
|
|
|
Vector3 CVehicle::GetTurnSpeed() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Create a default vector instance
|
|
|
|
Vector3 vec;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the values
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleTurnSpeed(m_ID, &vec.x, &vec.y, &vec.z, static_cast< uint8_t >(false));
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return vec;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CVehicle::SetTurnSpeed(const Vector3 & vel) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, vel.x, vel.y, vel.z,
|
|
|
|
static_cast< uint8_t >(false), static_cast< uint8_t >(false));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetTurnSpeedEx(float x, float y, float z) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, x, y, z, static_cast< uint8_t >(false),
|
|
|
|
static_cast< uint8_t >(false));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CVehicle::AddTurnSpeed(const Vector3 & vel) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, vel.x, vel.y, vel.z,
|
|
|
|
static_cast< uint8_t >(true), static_cast< uint8_t >(false));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::AddTurnSpeedEx(float x, float y, float z) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, x, y, z, static_cast< uint8_t >(true),
|
|
|
|
static_cast< uint8_t >(false));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-08-06 20:15:32 +02:00
|
|
|
Vector3 CVehicle::GetRelativeTurnSpeed() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Create a default vector instance
|
|
|
|
Vector3 vec;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the values
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleTurnSpeed(m_ID, &vec.x, &vec.y, &vec.z, static_cast< uint8_t >(true));
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return vec;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::SetRelativeTurnSpeed(const Vector3 & vel) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, vel.x, vel.y, vel.z,
|
|
|
|
static_cast< uint8_t >(false), static_cast< uint8_t >(true));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetRelativeTurnSpeedEx(float x, float y, float z) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, x, y, z, static_cast< uint8_t >(false),
|
|
|
|
static_cast< uint8_t >(true));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::AddRelativeTurnSpeed(const Vector3 & vel) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, vel.x, vel.y, vel.z,
|
|
|
|
static_cast< uint8_t >(true), static_cast< uint8_t >(true));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::AddRelativeTurnSpeedEx(float x, float y, float z) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, x, y, z, static_cast< uint8_t >(true),
|
|
|
|
static_cast< uint8_t >(true));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-08-06 20:15:32 +02:00
|
|
|
Vector3 CVehicle::GetSpawnPosition() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Create a default vector instance
|
|
|
|
Vector3 vec;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the values
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->GetVehicleSpawnPosition(m_ID, &vec.x, &vec.y, &vec.z);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return vec;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::SetSpawnPosition(const Vector3 & pos) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleSpawnPosition(m_ID, pos.x, pos.y, pos.z);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetSpawnPositionEx(float x, float y, float z) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleSpawnPosition(m_ID, x, y, z);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-08-06 20:15:32 +02:00
|
|
|
Quaternion CVehicle::GetSpawnRotation() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Create a default quaternion instance
|
2021-01-30 07:51:39 +01:00
|
|
|
Quaternion q;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the values
|
2021-01-30 07:51:39 +01:00
|
|
|
_Func->GetVehicleSpawnRotation(m_ID, &q.x, &q.y, &q.z, &q.w);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2021-01-30 07:51:39 +01:00
|
|
|
return q;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CVehicle::SetSpawnRotation(const Quaternion & rot) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleSpawnRotation(m_ID, rot.x, rot.y, rot.z, rot.w);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetSpawnRotationEx(float x, float y, float z, float w) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleSpawnRotation(m_ID, x, y, z, w);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-08-06 20:15:32 +02:00
|
|
|
Vector3 CVehicle::GetSpawnRotationEuler() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Create a default vector instance
|
|
|
|
Vector3 vec;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the rotation values
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->GetVehicleSpawnRotationEuler(m_ID, &vec.x, &vec.y, &vec.z);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return vec;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CVehicle::SetSpawnRotationEuler(const Vector3 & rot) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleSpawnRotationEuler(m_ID, rot.x, rot.y, rot.z);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetSpawnRotationEulerEx(float x, float y, float z) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleSpawnRotationEuler(m_ID, x, y, z);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
uint32_t CVehicle::GetIdleRespawnTimer() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return _Func->GetVehicleIdleRespawnTimer(m_ID);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetIdleRespawnTimer(uint32_t millis) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleIdleRespawnTimer(m_ID, millis);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetHealth() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return _Func->GetVehicleHealth(m_ID);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetHealth(float amount) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->SetVehicleHealth(m_ID, amount);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
2016-02-20 23:25:00 +01:00
|
|
|
|
2016-07-13 00:47:36 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void CVehicle::Fix() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->SetVehicleHealth(m_ID, 1000);
|
|
|
|
_Func->SetVehicleDamageData(m_ID, 0);
|
2021-03-15 06:01:26 +01:00
|
|
|
_Func->SetVehicleLightsData(m_ID, _Func->GetVehicleLightsData(m_ID) & 0xFFFFFF00);
|
2016-07-13 00:47:36 +02:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t CVehicle::GetPrimaryColor() const
|
2016-02-20 23:25:00 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// The color value
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t primary = -1, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested color
|
2018-01-30 17:05:47 +01:00
|
|
|
_Func->GetVehicleColour(m_ID, &primary, &dummy);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2016-02-20 23:25:00 +01:00
|
|
|
return primary;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetPrimaryColor(int32_t col) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// The unchanged color value
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t secondary = -1, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the unchanged color
|
2018-01-30 17:05:47 +01:00
|
|
|
_Func->GetVehicleColour(m_ID, &dummy, &secondary);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2016-02-20 23:25:00 +01:00
|
|
|
_Func->SetVehicleColour(m_ID, col, secondary);
|
|
|
|
}
|
2015-10-29 21:56:07 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t CVehicle::GetSecondaryColor() const
|
2016-02-20 23:25:00 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// The color value
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t secondary = -1, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested color
|
2018-01-30 17:05:47 +01:00
|
|
|
_Func->GetVehicleColour(m_ID, &dummy, &secondary);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2016-02-20 23:25:00 +01:00
|
|
|
return secondary;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetSecondaryColor(int32_t col) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// The unchanged color value
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t primary = -1, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the unchanged color
|
2018-01-30 17:05:47 +01:00
|
|
|
_Func->GetVehicleColour(m_ID, &primary, &dummy);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2016-02-20 23:25:00 +01:00
|
|
|
_Func->SetVehicleColour(m_ID, primary, col);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetColors(int32_t primary, int32_t secondary) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->SetVehicleColour(m_ID, primary, secondary);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t CVehicle::GetPartStatus(int32_t part) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
2016-05-22 05:20:38 +02:00
|
|
|
return _Func->GetVehiclePartStatus(m_ID, part);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetPartStatus(int32_t part, int32_t status)
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2016-08-18 13:51:55 +02:00
|
|
|
// Grab the current value for this property
|
2021-01-30 07:51:39 +01:00
|
|
|
const int32_t current = _Func->GetVehiclePartStatus(m_ID, part);
|
2016-08-18 13:51:55 +02:00
|
|
|
// Don't even bother if it's the same value
|
|
|
|
if (current == status)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// Avoid infinite recursive event loops
|
|
|
|
if (!(m_CircularLocks & VEHICLECL_EMIT_VEHICLE_PARTSTATUS))
|
|
|
|
{
|
|
|
|
// Prevent this event from triggering while executed
|
|
|
|
BitGuardU32 bg(m_CircularLocks, VEHICLECL_EMIT_VEHICLE_PARTSTATUS);
|
|
|
|
// Now forward the event call
|
2016-08-18 14:32:18 +02:00
|
|
|
Core::Get().EmitVehiclePartStatus(m_ID, part, current, status);
|
2016-08-18 13:51:55 +02:00
|
|
|
}
|
2021-09-12 14:55:55 +02:00
|
|
|
// Avoid property unwind from a recursive call
|
|
|
|
_Func->SetVehiclePartStatus(m_ID, part, status);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t CVehicle::GetTyreStatus(int32_t tyre) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
2016-08-20 21:42:54 +02:00
|
|
|
return _Func->GetVehicleTyreStatus(m_ID, tyre);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetTyreStatus(int32_t tyre, int32_t status)
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2016-08-18 13:56:38 +02:00
|
|
|
// Grab the current value for this property
|
2021-01-30 07:51:39 +01:00
|
|
|
const int32_t current = _Func->GetVehicleTyreStatus(m_ID, tyre);
|
2016-08-18 13:56:38 +02:00
|
|
|
// Don't even bother if it's the same value
|
|
|
|
if (current == status)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// Avoid infinite recursive event loops
|
2016-08-20 21:42:54 +02:00
|
|
|
if (!(m_CircularLocks & VEHICLECL_EMIT_VEHICLE_TYRESTATUS))
|
2016-08-18 13:56:38 +02:00
|
|
|
{
|
|
|
|
// Prevent this event from triggering while executed
|
2016-08-20 21:42:54 +02:00
|
|
|
BitGuardU32 bg(m_CircularLocks, VEHICLECL_EMIT_VEHICLE_TYRESTATUS);
|
2016-08-18 13:56:38 +02:00
|
|
|
// Now forward the event call
|
2016-08-20 21:42:54 +02:00
|
|
|
Core::Get().EmitVehicleTyreStatus(m_ID, tyre, current, status);
|
2016-08-18 13:56:38 +02:00
|
|
|
}
|
2021-09-12 14:55:55 +02:00
|
|
|
// Avoid property unwind from a recursive call
|
|
|
|
_Func->SetVehicleTyreStatus(m_ID, tyre, status);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
uint32_t CVehicle::GetDamageData() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
2016-05-22 05:20:38 +02:00
|
|
|
return _Func->GetVehicleDamageData(m_ID);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetDamageData(uint32_t data)
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2016-08-18 14:06:03 +02:00
|
|
|
// Grab the current value for this property
|
2021-01-30 07:51:39 +01:00
|
|
|
const uint32_t current = _Func->GetVehicleDamageData(m_ID);
|
2016-08-18 14:06:03 +02:00
|
|
|
// Don't even bother if it's the same value
|
|
|
|
if (current == data)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// Avoid infinite recursive event loops
|
|
|
|
if (!(m_CircularLocks & VEHICLECL_EMIT_VEHICLE_DAMAGEDATA))
|
|
|
|
{
|
|
|
|
// Prevent this event from triggering while executed
|
|
|
|
BitGuardU32 bg(m_CircularLocks, VEHICLECL_EMIT_VEHICLE_DAMAGEDATA);
|
|
|
|
// Now forward the event call
|
|
|
|
Core::Get().EmitVehicleDamageData(m_ID, current, data);
|
|
|
|
}
|
2021-09-12 14:55:55 +02:00
|
|
|
// Avoid property unwind from a recursive call
|
|
|
|
_Func->SetVehicleDamageData(m_ID, data);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t CVehicle::GetRadio() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
2016-05-22 05:20:38 +02:00
|
|
|
return _Func->GetVehicleRadio(m_ID);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetRadio(int32_t radio)
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2016-08-18 14:13:33 +02:00
|
|
|
// Grab the current value for this property
|
2021-01-30 07:51:39 +01:00
|
|
|
const int32_t current = _Func->GetVehicleRadio(m_ID);
|
2016-08-18 14:13:33 +02:00
|
|
|
// Don't even bother if it's the same value
|
|
|
|
if (current == radio)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// Avoid infinite recursive event loops
|
|
|
|
if (!(m_CircularLocks & VEHICLECL_EMIT_VEHICLE_RADIO))
|
|
|
|
{
|
|
|
|
// Prevent this event from triggering while executed
|
|
|
|
BitGuardU32 bg(m_CircularLocks, VEHICLECL_EMIT_VEHICLE_RADIO);
|
|
|
|
// Now forward the event call
|
|
|
|
Core::Get().EmitVehicleRadio(m_ID, current, radio);
|
|
|
|
}
|
2021-09-12 14:55:55 +02:00
|
|
|
// Avoid property unwind from a recursive call
|
|
|
|
_Func->SetVehicleRadio(m_ID, radio);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-08-06 20:15:32 +02:00
|
|
|
Vector2 CVehicle::GetTurretRotation() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Create a default vector instance
|
|
|
|
Vector2 vec;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the values
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->GetVehicleTurretRotation(m_ID, &vec.x, &vec.y);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return vec;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetHorizontalTurretRotation() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2016-05-22 05:20:38 +02:00
|
|
|
// Where the rotation value is retrieved
|
2021-01-30 07:51:39 +01:00
|
|
|
float rot = 0.0f, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the turret rotation value
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehicleTurretRotation(m_ID, &rot, &dummy);
|
2016-05-22 05:20:38 +02:00
|
|
|
// Return the requested information
|
|
|
|
return rot;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetVerticalTurretRotation() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2016-05-22 05:20:38 +02:00
|
|
|
// Where the rotation value is retrieved
|
2021-01-30 07:51:39 +01:00
|
|
|
float rot = 0.0f, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the turret rotation value
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehicleTurretRotation(m_ID, &dummy, &rot);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2016-05-22 05:20:38 +02:00
|
|
|
return rot;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
bool CVehicle::ExistsHandlingRule(int32_t rule) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2016-05-22 05:20:38 +02:00
|
|
|
// Return the requested information
|
|
|
|
return _Func->ExistsInstHandlingRule(m_ID, rule);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
SQFloat CVehicle::GetHandlingRule(int32_t rule) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
2020-03-22 09:00:31 +01:00
|
|
|
return static_cast< SQFloat >(_Func->GetInstHandlingRule(m_ID, rule));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetHandlingRule(int32_t rule, float data)
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2016-08-18 14:21:50 +02:00
|
|
|
// Grab the current value for this property
|
2020-03-22 09:00:31 +01:00
|
|
|
const auto current = static_cast< SQFloat >(_Func->GetInstHandlingRule(m_ID, rule));
|
2016-08-18 14:21:50 +02:00
|
|
|
// Avoid infinite recursive event loops
|
|
|
|
if (!(m_CircularLocks & VEHICLECL_EMIT_VEHICLE_HANDLINGRULE))
|
|
|
|
{
|
|
|
|
// Prevent this event from triggering while executed
|
|
|
|
BitGuardU32 bg(m_CircularLocks, VEHICLECL_EMIT_VEHICLE_HANDLINGRULE);
|
|
|
|
// Now forward the event call
|
2016-08-18 14:32:18 +02:00
|
|
|
Core::Get().EmitVehicleHandlingRule(m_ID, rule, current, data);
|
2016-08-18 14:21:50 +02:00
|
|
|
}
|
2021-09-12 14:55:55 +02:00
|
|
|
// Avoid property unwind from a recursive call
|
|
|
|
_Func->SetInstHandlingRule(m_ID, rule, data);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::ResetHandlingRule(int32_t rule)
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2016-08-18 14:21:50 +02:00
|
|
|
// Grab the current value for this property
|
2020-03-22 09:00:31 +01:00
|
|
|
const auto current = static_cast< SQFloat >(_Func->GetInstHandlingRule(m_ID, rule));
|
2016-08-18 14:21:50 +02:00
|
|
|
// Avoid infinite recursive event loops
|
|
|
|
if (!(m_CircularLocks & VEHICLECL_EMIT_VEHICLE_HANDLINGRULE))
|
|
|
|
{
|
|
|
|
// Prevent this event from triggering while executed
|
|
|
|
BitGuardU32 bg(m_CircularLocks, VEHICLECL_EMIT_VEHICLE_HANDLINGRULE);
|
|
|
|
// Now forward the event call
|
2020-03-22 09:00:31 +01:00
|
|
|
Core::Get().EmitVehicleHandlingRule(m_ID, rule, current, static_cast< SQFloat >(_Func->GetInstHandlingRule(m_ID, rule)));
|
2016-08-18 14:21:50 +02:00
|
|
|
}
|
2021-09-12 14:55:55 +02:00
|
|
|
// Avoid property unwind from a recursive call
|
|
|
|
_Func->ResetInstHandlingRule(m_ID, rule);
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void CVehicle::ResetHandlings() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->ResetInstHandling(m_ID);
|
|
|
|
}
|
|
|
|
|
2018-06-28 21:12:05 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-07-23 16:29:32 +02:00
|
|
|
uint32_t CVehicle::GetLightsData() const
|
2018-06-28 21:12:05 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Retrieve the requested data
|
|
|
|
return _Func->GetVehicleLightsData(m_ID);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetLightsData(int32_t data) const
|
2018-06-28 21:12:05 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Apply the requested data
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleLightsData(m_ID, static_cast< uint32_t >(data));
|
2018-06-28 21:12:05 +02:00
|
|
|
}
|
|
|
|
|
2016-05-22 05:20:38 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-09-12 14:55:55 +02:00
|
|
|
bool CVehicle::Embark(CPlayer & player)
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Is the specified player even valid?
|
|
|
|
if (!player.IsActive())
|
|
|
|
{
|
|
|
|
STHROWF("Invalid player argument: null");
|
|
|
|
}
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2021-09-12 14:55:55 +02:00
|
|
|
// If the player embarks in the same vehicle then ignore
|
|
|
|
if (_Func->GetPlayerVehicleId(player.GetID()) == m_ID)
|
|
|
|
{
|
|
|
|
return true; // I guess this is somewhat successful
|
|
|
|
}
|
|
|
|
// Avoid infinite recursive event loops
|
|
|
|
else if (!(m_CircularLocks & VEHICLECL_EMIT_VEHICLE_EMBARK))
|
|
|
|
{
|
|
|
|
// Prevent this event from triggering while executed
|
|
|
|
BitGuardU32 bg(m_CircularLocks, VEHICLECL_EMIT_VEHICLE_EMBARK);
|
|
|
|
// Now forward the event call
|
|
|
|
Core::Get().EmitPlayerEmbarking(player.GetID(), m_ID, 0);
|
|
|
|
}
|
2016-05-22 05:20:38 +02:00
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
return (_Func->PutPlayerInVehicle(player.GetID(), m_ID, 0,
|
|
|
|
static_cast< uint8_t >(true), static_cast< uint8_t >(true))
|
2016-05-22 05:20:38 +02:00
|
|
|
!= vcmpErrorRequestDenied);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-09-12 14:55:55 +02:00
|
|
|
bool CVehicle::EmbarkEx(CPlayer & player, int32_t slot, bool allocate, bool warp)
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-05-22 05:20:38 +02:00
|
|
|
// Is the specified player even valid?
|
|
|
|
if (!player.IsActive())
|
|
|
|
{
|
|
|
|
STHROWF("Invalid player argument: null");
|
|
|
|
}
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2021-09-12 14:55:55 +02:00
|
|
|
// If the player embarks in the same vehicle then ignore
|
|
|
|
if (_Func->GetPlayerVehicleId(player.GetID()) == m_ID)
|
|
|
|
{
|
|
|
|
return true; // I guess this is somewhat successful
|
|
|
|
}
|
|
|
|
// Avoid infinite recursive event loops
|
|
|
|
else if (!(m_CircularLocks & VEHICLECL_EMIT_VEHICLE_EMBARK))
|
|
|
|
{
|
|
|
|
// Prevent this event from triggering while executed
|
|
|
|
BitGuardU32 bg(m_CircularLocks, VEHICLECL_EMIT_VEHICLE_EMBARK);
|
|
|
|
// Now forward the event call
|
|
|
|
Core::Get().EmitPlayerEmbarking(player.GetID(), m_ID, 0);
|
|
|
|
}
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
return (_Func->PutPlayerInVehicle(player.GetID(), m_ID, slot,
|
|
|
|
static_cast< uint8_t >(allocate), static_cast< uint8_t >(warp)) != vcmpErrorRequestDenied);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
2020-03-20 19:37:17 +01:00
|
|
|
#if SQMOD_SDK_LEAST(2, 1)
|
2019-06-01 23:39:06 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void CVehicle::SetPlayer3DArrow(CPlayer & target, bool toggle) const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Spectate the given target
|
|
|
|
_Func->SetVehicle3DArrowForPlayer(m_ID, target.GetID(), toggle);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
bool CVehicle::GetPlayer3DArrow(CPlayer & target) const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Spectate the given target
|
|
|
|
return _Func->GetVehicle3DArrowForPlayer(m_ID, target.GetID());
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void CVehicle::SetPlayer3DArrowID(SQInteger id, bool toggle) const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Spectate the given target
|
|
|
|
_Func->SetVehicle3DArrowForPlayer(m_ID, id, toggle);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
bool CVehicle::GetPlayer3DArrowID(SQInteger id) const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Spectate the given target
|
|
|
|
return _Func->GetVehicle3DArrowForPlayer(m_ID, id);
|
|
|
|
}
|
2020-03-20 19:37:17 +01:00
|
|
|
#endif
|
2017-06-19 03:09:35 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
bool CVehicle::GetCollideAreas() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
2020-03-22 09:00:31 +01:00
|
|
|
return static_cast< bool >(Core::Get().GetVehicle(m_ID).mFlags & ENF_AREA_TRACK);
|
2017-06-19 03:09:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CVehicle::SetCollideAreas(bool toggle) const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
if (toggle)
|
|
|
|
{
|
|
|
|
Core::Get().GetVehicle(m_ID).mFlags |= ENF_AREA_TRACK;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Obtain the actual entity instance
|
|
|
|
auto & inst = Core::Get().GetVehicle(m_ID);
|
|
|
|
// Is this option even enabled?
|
|
|
|
if (!(inst.mFlags & ENF_AREA_TRACK))
|
|
|
|
{
|
|
|
|
return; // Not enabled to begin with
|
|
|
|
}
|
|
|
|
// Disable the option
|
|
|
|
inst.mFlags ^= ENF_AREA_TRACK;
|
|
|
|
// Clear current areas
|
|
|
|
inst.mAreas.clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CVehicle::SetAreasCollide(bool toggle) const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
if (toggle)
|
|
|
|
{
|
|
|
|
Core::Get().GetVehicle(m_ID).mFlags |= ENF_AREA_TRACK;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Obtain the actual entity instance
|
|
|
|
auto & inst = Core::Get().GetVehicle(m_ID);
|
|
|
|
// Is this option even enabled?
|
|
|
|
if (!(inst.mFlags & ENF_AREA_TRACK))
|
|
|
|
{
|
|
|
|
return; // Not enabled to begin with
|
|
|
|
}
|
|
|
|
// Disable the option
|
|
|
|
inst.mFlags ^= ENF_AREA_TRACK;
|
|
|
|
// Is the vehicle currently in any areas?
|
|
|
|
if (inst.mAreas.empty())
|
|
|
|
{
|
|
|
|
return; // Nothing to test
|
|
|
|
}
|
|
|
|
|
|
|
|
Vector3 pos;
|
|
|
|
// Obtain the current position of this instance
|
|
|
|
_Func->GetVehiclePosition(m_ID, &pos.x, &pos.y, &pos.z);
|
|
|
|
// Do a final check to see if the vehicle left any area
|
|
|
|
for (auto & ap : inst.mAreas)
|
|
|
|
{
|
|
|
|
// Is the vehicle still in this area?
|
|
|
|
if (!ap.first->TestEx(pos.x, pos.y))
|
|
|
|
{
|
|
|
|
Core::Get().EmitVehicleLeaveArea(m_ID, ap.second); // Emit the script event
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Clear current areas
|
|
|
|
inst.mAreas.clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-08 15:53:16 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
SQInteger CVehicle::GetTrackPosition() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return Core::Get().GetVehicle(m_ID).mTrackPosition;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void CVehicle::SetTrackPosition(SQInteger num) const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Assign the requested information
|
|
|
|
Core::Get().GetVehicle(m_ID).mTrackPosition = num;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
SQInteger CVehicle::GetTrackRotation() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return Core::Get().GetVehicle(m_ID).mTrackRotation;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void CVehicle::SetTrackRotation(SQInteger num) const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Assign the requested information
|
|
|
|
Core::Get().GetVehicle(m_ID).mTrackRotation = num;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t CVehicle::GetLastPrimaryColor() const
|
2016-06-08 15:53:16 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
2016-08-21 17:07:35 +02:00
|
|
|
return Core::Get().GetVehicle(m_ID).mLastPrimaryColor;
|
2016-06-08 15:53:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
int32_t CVehicle::GetLastSecondaryColor() const
|
2016-06-08 15:53:16 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
2016-08-21 17:07:35 +02:00
|
|
|
return Core::Get().GetVehicle(m_ID).mLastSecondaryColor;
|
2016-06-08 15:53:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetLastHealth() const
|
2016-06-08 15:53:16 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return Core::Get().GetVehicle(m_ID).mLastHealth;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
const Vector3 & CVehicle::GetLastPosition() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return Core::Get().GetVehicle(m_ID).mLastPosition;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
const Quaternion & CVehicle::GetLastRotation() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return Core::Get().GetVehicle(m_ID).mLastRotation;
|
|
|
|
}
|
|
|
|
|
2020-05-04 10:58:30 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
SQFloat CVehicle::GetDistance() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return static_cast< SQFloat >(Core::Get().GetVehicle(m_ID).mDistance);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void CVehicle::SetDistance(SQFloat distance) const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Assign the requested information
|
2021-01-30 07:51:39 +01:00
|
|
|
Core::Get().GetVehicle(m_ID).mDistance = static_cast< double >(distance);
|
2020-05-04 10:58:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
bool CVehicle::GetTrackDistance() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return static_cast< bool >(Core::Get().GetVehicle(m_ID).mFlags & ENF_DIST_TRACK);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void CVehicle::SetTrackDistance(bool toggle) const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Assign the requested information
|
|
|
|
if (toggle)
|
|
|
|
{
|
|
|
|
Core::Get().GetVehicle(m_ID).mFlags |= ENF_DIST_TRACK;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Core::Get().GetVehicle(m_ID).mFlags ^= ENF_DIST_TRACK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetPositionX() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve a temporary float to retrieve the requested component
|
2021-01-30 07:51:39 +01:00
|
|
|
float x = 0.0f, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the requested component value
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehiclePosition(m_ID, &x, &dummy, &dummy);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return x;
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetPositionY() const
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve a temporary float to retrieve the requested component
|
2021-01-30 07:51:39 +01:00
|
|
|
float y = 0.0f, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the requested component value
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehiclePosition(m_ID, &dummy, &y, &dummy);
|
2016-05-22 05:20:38 +02:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return y;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetPositionZ() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve a temporary float to retrieve the requested component
|
2021-01-30 07:51:39 +01:00
|
|
|
float z = 0.0f, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the requested component value
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehiclePosition(m_ID, &dummy, &dummy, &z);
|
2016-05-22 05:20:38 +02:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return z;
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetPositionX(float x) const
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float y, z, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Retrieve the current values for unchanged components
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehiclePosition(m_ID, &dummy, &y, &z);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehiclePosition(m_ID, x, y, z, static_cast< uint8_t >(false));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetPositionY(float y) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float x, z, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Retrieve the current values for unchanged components
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehiclePosition(m_ID, &x, &dummy, &z);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehiclePosition(m_ID, x, y, z, static_cast< uint8_t >(false));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetPositionZ(float z) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float x, y, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Retrieve the current values for unchanged components
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehiclePosition(m_ID, &x, &y, &dummy);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2020-12-21 11:20:30 +01:00
|
|
|
_Func->SetVehiclePosition(m_ID, x, y, z, static_cast< uint8_t >(false));
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetRotationX() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve a temporary float to retrieve the requested component
|
2021-01-30 07:51:39 +01:00
|
|
|
float x = 0.0f, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the requested component value
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehicleRotation(m_ID, &x, &dummy, &dummy, &dummy);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return x;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetRotationY() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve a temporary float to retrieve the requested component
|
2021-01-30 07:51:39 +01:00
|
|
|
float y = 0.0f, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the requested component value
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehicleRotation(m_ID, &dummy, &y, &dummy, &dummy);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return y;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetRotationZ() const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve a temporary float to retrieve the requested component
|
2021-01-30 07:51:39 +01:00
|
|
|
float z = 0.0f, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the requested component value
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehicleRotation(m_ID, &dummy, &dummy, &z, &dummy);
|
2016-05-22 05:20:38 +02:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return z;
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetRotationW() const
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve a temporary float to retrieve the requested component
|
2021-01-30 07:51:39 +01:00
|
|
|
float w = 0.0f, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the requested component value
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehicleRotation(m_ID, &dummy, &dummy, &dummy, &w);
|
2016-05-22 05:20:38 +02:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return w;
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetRotationX(float x) const
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float y, z, w, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Retrieve the current values for unchanged components
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehicleRotation(m_ID, &dummy, &y, &z, &w);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehicleRotation(m_ID, x, y, z, w);
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetRotationY(float y) const
|
2016-02-20 23:25:00 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float x, z, w, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Retrieve the current values for unchanged components
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehicleRotation(m_ID, &x, &dummy, &z, &w);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehicleRotation(m_ID, x, y, z, w);
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetRotationZ(float z) const
|
2016-02-20 23:25:00 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float x, y, w, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Retrieve the current values for unchanged components
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehicleRotation(m_ID, &x, &y, &dummy, &w);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehicleRotation(m_ID, x, y, z, w);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetRotationW(float w) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float x, y, z, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Retrieve the current values for unchanged components
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehicleRotation(m_ID, &x, &y, &z, &dummy);
|
2016-05-22 05:20:38 +02:00
|
|
|
// Perform the requested operation
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehicleRotation(m_ID, x, y, z, w);
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetEulerRotationX() const
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve a temporary float to retrieve the requested component
|
2021-01-30 07:51:39 +01:00
|
|
|
float x = 0.0f, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested component value
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehicleRotationEuler(m_ID, &x, &dummy, &dummy);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return x;
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetEulerRotationY() const
|
2016-02-20 23:25:00 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve a temporary float to retrieve the requested component
|
2021-01-30 07:51:39 +01:00
|
|
|
float y = 0.0f, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested component value
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehicleRotationEuler(m_ID, &dummy, &y, &dummy);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return y;
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetEulerRotationZ() const
|
2016-02-20 23:25:00 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve a temporary float to retrieve the requested component
|
2021-01-30 07:51:39 +01:00
|
|
|
float z = 0.0f, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested component value
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehicleRotationEuler(m_ID, &dummy, &dummy, &z);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return z;
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetEulerRotationX(float x) const
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float y, z, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Retrieve the current values for unchanged components
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehicleRotationEuler(m_ID, &dummy, &y, &z);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehicleRotationEuler(m_ID, x, y, z);
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetEulerRotationY(float y) const
|
2016-02-20 23:25:00 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float x, z, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Retrieve the current values for unchanged components
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehicleRotationEuler(m_ID, &x, &dummy, &z);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehicleRotationEuler(m_ID, x, y, z);
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetEulerRotationZ(float z) const
|
2016-02-20 23:25:00 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float x, y, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Retrieve the current values for unchanged components
|
2018-01-30 18:09:54 +01:00
|
|
|
_Func->GetVehicleRotationEuler(m_ID, &x, &y, &dummy);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehicleRotationEuler(m_ID, z, y, z);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2015-11-01 00:33:12 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetSpeedX() const
|
2015-11-01 00:33:12 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2016-05-22 05:20:38 +02:00
|
|
|
// Clear previous information, if any
|
2021-01-30 07:51:39 +01:00
|
|
|
float x = 0.0f, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested component value
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleSpeed(m_ID, &x, &dummy, &dummy, static_cast< uint8_t >(false));
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return x;
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetSpeedY() const
|
2015-11-01 00:33:12 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2016-05-22 05:20:38 +02:00
|
|
|
// Clear previous information, if any
|
2021-01-30 07:51:39 +01:00
|
|
|
float y = 0.0f, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested component value
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleSpeed(m_ID, &dummy, &y, &dummy, static_cast< uint8_t >(false));
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return y;
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetSpeedZ() const
|
2015-11-01 00:33:12 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2016-05-22 05:20:38 +02:00
|
|
|
// Clear previous information, if any
|
2021-01-30 07:51:39 +01:00
|
|
|
float z = 0.0f, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested component value
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleSpeed(m_ID, &dummy, &dummy, &z, static_cast< uint8_t >(false));
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return z;
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetSpeedX(float x) const
|
2015-11-01 00:33:12 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float y, z, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Retrieve the current values for unchanged components
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleSpeed(m_ID, &dummy, &y, &z, static_cast< uint8_t >(false));
|
2016-05-22 05:20:38 +02:00
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleSpeed(m_ID, x, y, z, static_cast< uint8_t >(false), static_cast< uint8_t >(false));
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetSpeedY(float y) const
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float x, z, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Retrieve the current values for unchanged components
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleSpeed(m_ID, &x, &dummy, &z, static_cast< uint8_t >(false));
|
2016-05-22 05:20:38 +02:00
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleSpeed(m_ID, x, y, z, static_cast< uint8_t >(false), static_cast< uint8_t >(false));
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetSpeedZ(float z) const
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float x, y, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Retrieve the current values for unchanged components
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleSpeed(m_ID, &x, &y, &dummy, static_cast< uint8_t >(false));
|
2016-05-22 05:20:38 +02:00
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleSpeed(m_ID, z, y, z, static_cast< uint8_t >(false), static_cast< uint8_t >(false));
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetRelativeSpeedX() const
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous information, if any
|
2021-01-30 07:51:39 +01:00
|
|
|
float x = 0.0f, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested component value
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleSpeed(m_ID, &x, &dummy, &dummy, static_cast< uint8_t >(true));
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return x;
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetRelativeSpeedY() const
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous information, if any
|
2021-01-30 07:51:39 +01:00
|
|
|
float y = 0.0f, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the requested component value
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleSpeed(m_ID, &dummy, &y, &dummy, static_cast< uint8_t >(true));
|
2016-05-22 05:20:38 +02:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return y;
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetRelativeSpeedZ() const
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous information, if any
|
2021-01-30 07:51:39 +01:00
|
|
|
float z = 0.0f, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the requested component value
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleSpeed(m_ID, &dummy, &dummy, &z, static_cast< uint8_t >(true));
|
2016-05-22 05:20:38 +02:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return z;
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetRelativeSpeedX(float x) const
|
2015-11-01 00:33:12 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float y, z, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Retrieve the current values for unchanged components
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleSpeed(m_ID, &dummy, &y, &z, static_cast< uint8_t >(true));
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleSpeed(m_ID, x, y, z, static_cast< uint8_t >(false), static_cast< uint8_t >(true));
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetRelativeSpeedY(float y) const
|
2015-11-01 00:33:12 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float x, z, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Retrieve the current values for unchanged components
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleSpeed(m_ID, &x, &dummy, &z, static_cast< uint8_t >(true));
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleSpeed(m_ID, x, y, z, static_cast< uint8_t >(false), static_cast< uint8_t >(true));
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetRelativeSpeedZ(float z) const
|
2015-11-01 00:33:12 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float x, y, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Retrieve the current values for unchanged components
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleSpeed(m_ID, &x, &y, &dummy, static_cast< uint8_t >(true));
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleSpeed(m_ID, z, y, z, static_cast< uint8_t >(false), static_cast< uint8_t >(true));
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetTurnSpeedX() const
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous information, if any
|
2021-01-30 07:51:39 +01:00
|
|
|
float x = 0.0f, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the requested component value
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleTurnSpeed(m_ID, &x, &dummy, &dummy, static_cast< uint8_t >(false));
|
2016-05-22 05:20:38 +02:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return x;
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetTurnSpeedY() const
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous information, if any
|
2021-01-30 07:51:39 +01:00
|
|
|
float y = 0.0f, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the requested component value
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleTurnSpeed(m_ID, &dummy, &y, &dummy, static_cast< uint8_t >(false));
|
2016-05-22 05:20:38 +02:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return y;
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetTurnSpeedZ() const
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous information, if any
|
2021-01-30 07:51:39 +01:00
|
|
|
float z = 0.0f, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the requested component value
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleTurnSpeed(m_ID, &dummy, &dummy, &z, static_cast< uint8_t >(false));
|
2016-05-22 05:20:38 +02:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return z;
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetTurnSpeedX(float x) const
|
2015-11-01 00:33:12 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float y, z, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Retrieve the current values for unchanged components
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleTurnSpeed(m_ID, &dummy, &y, &z, static_cast< uint8_t >(false));
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, x, y, z, static_cast< uint8_t >(false), static_cast< uint8_t >(false));
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
2016-05-22 05:20:38 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetTurnSpeedY(float y) const
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float x, z, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Retrieve the current values for unchanged components
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleTurnSpeed(m_ID, &x, &dummy, &z, static_cast< uint8_t >(false));
|
2016-05-22 05:20:38 +02:00
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, x, y, z, static_cast< uint8_t >(false), static_cast< uint8_t >(false));
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
2016-02-20 23:25:00 +01:00
|
|
|
|
2015-11-01 00:33:12 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetTurnSpeedZ(float z) const
|
2015-11-01 00:33:12 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float x, y, dummy;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Retrieve the current values for unchanged components
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleTurnSpeed(m_ID, &x, &y, &dummy, static_cast< uint8_t >(false));
|
2016-05-22 05:20:38 +02:00
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, z, y, z, static_cast< uint8_t >(false), static_cast< uint8_t >(false));
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetRelativeTurnSpeedX() const
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous information, if any
|
2021-01-30 07:51:39 +01:00
|
|
|
float x = 0.0f, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested component value
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleTurnSpeed(m_ID, &x, &dummy, &dummy, static_cast< uint8_t >(true));
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return x;
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetRelativeTurnSpeedY() const
|
2015-11-01 00:33:12 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2016-05-22 05:20:38 +02:00
|
|
|
// Clear previous information, if any
|
2021-01-30 07:51:39 +01:00
|
|
|
float y = 0.0f, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested component value
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleTurnSpeed(m_ID, &dummy, &y, &dummy, static_cast< uint8_t >(true));
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return y;
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
float CVehicle::GetRelativeTurnSpeedZ() const
|
2015-11-01 00:33:12 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2016-05-22 05:20:38 +02:00
|
|
|
// Clear previous information, if any
|
2021-01-30 07:51:39 +01:00
|
|
|
float z = 0.0f, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested component value
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleTurnSpeed(m_ID, &dummy, &dummy, &z, static_cast< uint8_t >(true));
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return z;
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetRelativeTurnSpeedX(float x) const
|
2015-11-01 00:33:12 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float y, z, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Retrieve the current values for unchanged components
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleTurnSpeed(m_ID, &dummy, &y, &z, static_cast< uint8_t >(true));
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, x, y, z, static_cast< uint8_t >(false), static_cast< uint8_t >(true));
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetRelativeTurnSpeedY(float y) const
|
2016-02-20 23:25:00 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float x, z, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Retrieve the current values for unchanged components
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleTurnSpeed(m_ID, &x, &dummy, &z, static_cast< uint8_t >(true));
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, x, y, z, static_cast< uint8_t >(false), static_cast< uint8_t >(true));
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
void CVehicle::SetRelativeTurnSpeedZ(float z) const
|
2016-02-20 23:25:00 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2021-01-30 07:51:39 +01:00
|
|
|
float x, y, dummy;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Retrieve the current values for unchanged components
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->GetVehicleTurnSpeed(m_ID, &x, &y, &dummy, static_cast< uint8_t >(true));
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2020-03-22 09:00:31 +01:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, z, y, z, static_cast< uint8_t >(false), static_cast< uint8_t >(true));
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
static LightObj & Vehicle_CreateEx1a(int32_t model, int32_t world, float x, float y, float z, float angle,
|
|
|
|
int32_t primary, int32_t secondary)
|
2015-11-01 00:33:12 +01:00
|
|
|
{
|
2016-05-22 05:20:38 +02:00
|
|
|
return Core::Get().NewVehicle(model, world, x, y, z, angle, primary, secondary,
|
2021-03-20 10:51:40 +01:00
|
|
|
SQMOD_CREATE_DEFAULT, NullLightObj()).mObj;
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
2021-01-30 07:51:39 +01:00
|
|
|
static LightObj & Vehicle_CreateEx1b(int32_t model, int32_t world, float x, float y, float z, float angle,
|
|
|
|
int32_t primary, int32_t secondary, int32_t header, LightObj & payload)
|
2015-11-01 00:33:12 +01:00
|
|
|
{
|
2016-05-22 05:20:38 +02:00
|
|
|
return Core::Get().NewVehicle(model, world, x, y, z, angle, primary, secondary,
|
2021-03-20 10:51:40 +01:00
|
|
|
header, payload).mObj;
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
static LightObj & Vehicle_Create1a(int32_t model, int32_t world, const Vector3 & pos, float angle,
|
|
|
|
int32_t primary, int32_t secondary)
|
2015-11-01 00:33:12 +01:00
|
|
|
{
|
2016-05-22 05:20:38 +02:00
|
|
|
return Core::Get().NewVehicle(model, world, pos.x, pos.y, pos.z, angle, primary, secondary,
|
2021-03-20 10:51:40 +01:00
|
|
|
SQMOD_CREATE_DEFAULT, NullLightObj()).mObj;
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
2021-01-30 07:51:39 +01:00
|
|
|
static LightObj & Vehicle_Create1b(int32_t model, int32_t world, const Vector3 & pos, float angle,
|
|
|
|
int32_t primary, int32_t secondary, int32_t header, LightObj & payload)
|
2015-11-01 00:33:12 +01:00
|
|
|
{
|
2016-05-22 05:20:38 +02:00
|
|
|
return Core::Get().NewVehicle(model, world, pos.x, pos.y, pos.z, angle, primary, secondary,
|
2021-03-20 10:51:40 +01:00
|
|
|
header, payload).mObj;
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
2015-10-29 21:56:07 +01:00
|
|
|
// ================================================================================================
|
2016-02-20 23:25:00 +01:00
|
|
|
void Register_CVehicle(HSQUIRRELVM vm)
|
|
|
|
{
|
2016-11-15 20:16:24 +01:00
|
|
|
RootTable(vm).Bind(Typename::Str,
|
|
|
|
Class< CVehicle, NoConstructor< CVehicle > >(vm, Typename::Str)
|
2016-06-03 20:26:19 +02:00
|
|
|
// Meta-methods
|
2016-11-15 20:16:24 +01:00
|
|
|
.SquirrelFunc(_SC("_typename"), &Typename::Fn)
|
2016-02-20 23:25:00 +01:00
|
|
|
.Func(_SC("_tostring"), &CVehicle::ToString)
|
2016-03-10 05:18:39 +01:00
|
|
|
// Static Values
|
2016-03-10 04:57:13 +01:00
|
|
|
.SetStaticValue(_SC("MaxID"), CVehicle::Max)
|
|
|
|
// Core Properties
|
2017-02-21 20:24:59 +01:00
|
|
|
.Prop(_SC("On"), &CVehicle::GetEvents)
|
2016-02-20 23:25:00 +01:00
|
|
|
.Prop(_SC("ID"), &CVehicle::GetID)
|
|
|
|
.Prop(_SC("Tag"), &CVehicle::GetTag, &CVehicle::SetTag)
|
|
|
|
.Prop(_SC("Data"), &CVehicle::GetData, &CVehicle::SetData)
|
|
|
|
.Prop(_SC("Active"), &CVehicle::IsActive)
|
2016-03-10 05:18:39 +01:00
|
|
|
// Core Methods
|
2016-11-16 13:49:12 +01:00
|
|
|
.FmtFunc(_SC("SetTag"), &CVehicle::ApplyTag)
|
2016-07-26 23:13:50 +02:00
|
|
|
.Func(_SC("CustomEvent"), &CVehicle::CustomEvent)
|
2016-03-10 04:57:13 +01:00
|
|
|
// Core Overloads
|
2021-01-30 07:51:39 +01:00
|
|
|
.Overload(_SC("Destroy"), &CVehicle::Destroy0)
|
|
|
|
.Overload(_SC("Destroy"), &CVehicle::Destroy1)
|
|
|
|
.Overload(_SC("Destroy"), &CVehicle::Destroy)
|
2016-03-10 04:57:13 +01:00
|
|
|
// Properties
|
2016-02-20 23:25:00 +01:00
|
|
|
.Prop(_SC("SyncSource"), &CVehicle::GetSyncSource)
|
|
|
|
.Prop(_SC("SyncType"), &CVehicle::GetSyncType)
|
|
|
|
.Prop(_SC("World"), &CVehicle::GetWorld, &CVehicle::SetWorld)
|
|
|
|
.Prop(_SC("Model"), &CVehicle::GetModel)
|
|
|
|
.Prop(_SC("Immunity"), &CVehicle::GetImmunity, &CVehicle::SetImmunity)
|
|
|
|
.Prop(_SC("Wrecked"), &CVehicle::IsWrecked)
|
|
|
|
.Prop(_SC("Pos"), &CVehicle::GetPosition, &CVehicle::SetPosition)
|
|
|
|
.Prop(_SC("Position"), &CVehicle::GetPosition, &CVehicle::SetPosition)
|
|
|
|
.Prop(_SC("Rot"), &CVehicle::GetRotation, &CVehicle::SetRotation)
|
|
|
|
.Prop(_SC("Rotation"), &CVehicle::GetRotation, &CVehicle::SetRotation)
|
2016-05-22 05:20:38 +02:00
|
|
|
.Prop(_SC("EulerRot"), &CVehicle::GetRotationEuler, &CVehicle::SetRotationEuler)
|
|
|
|
.Prop(_SC("EulerRotation"), &CVehicle::GetRotationEuler, &CVehicle::SetRotationEuler)
|
2016-02-20 23:25:00 +01:00
|
|
|
.Prop(_SC("Speed"), &CVehicle::GetSpeed, &CVehicle::SetSpeed)
|
2016-05-22 05:20:38 +02:00
|
|
|
.Prop(_SC("RelSpeed"), &CVehicle::GetRelativeSpeed, &CVehicle::SetRelativeSpeed)
|
|
|
|
.Prop(_SC("RelativeSpeed"), &CVehicle::GetRelativeSpeed, &CVehicle::SetRelativeSpeed)
|
2016-02-20 23:25:00 +01:00
|
|
|
.Prop(_SC("TurnSpeed"), &CVehicle::GetTurnSpeed, &CVehicle::SetTurnSpeed)
|
2016-05-22 05:20:38 +02:00
|
|
|
.Prop(_SC("RelTurnSpeed"), &CVehicle::GetRelativeTurnSpeed, &CVehicle::SetRelativeTurnSpeed)
|
|
|
|
.Prop(_SC("RelativeTurnSpeed"), &CVehicle::GetRelativeTurnSpeed, &CVehicle::SetRelativeTurnSpeed)
|
2016-02-20 23:25:00 +01:00
|
|
|
.Prop(_SC("SpawnPos"), &CVehicle::GetSpawnPosition, &CVehicle::SetSpawnPosition)
|
|
|
|
.Prop(_SC("SpawnPosition"), &CVehicle::GetSpawnPosition, &CVehicle::SetSpawnPosition)
|
|
|
|
.Prop(_SC("SpawnRot"), &CVehicle::GetSpawnRotation, &CVehicle::SetSpawnRotation)
|
|
|
|
.Prop(_SC("SpawnRotation"), &CVehicle::GetSpawnRotation, &CVehicle::SetSpawnRotation)
|
2016-05-22 05:20:38 +02:00
|
|
|
.Prop(_SC("SpawnEulerRot"), &CVehicle::GetSpawnRotationEuler, &CVehicle::SetSpawnRotationEuler)
|
|
|
|
.Prop(_SC("SpawnEulerRotation"), &CVehicle::GetSpawnRotationEuler, &CVehicle::SetSpawnRotationEuler)
|
|
|
|
.Prop(_SC("IdleRespawnTimer"), &CVehicle::GetIdleRespawnTimer, &CVehicle::SetIdleRespawnTimer)
|
2016-02-20 23:25:00 +01:00
|
|
|
.Prop(_SC("Health"), &CVehicle::GetHealth, &CVehicle::SetHealth)
|
|
|
|
.Prop(_SC("PrimaryColor"), &CVehicle::GetPrimaryColor, &CVehicle::SetPrimaryColor)
|
|
|
|
.Prop(_SC("SecondaryColor"), &CVehicle::GetSecondaryColor, &CVehicle::SetSecondaryColor)
|
2016-08-21 17:07:35 +02:00
|
|
|
.Prop(_SC("PrimaryColour"), &CVehicle::GetPrimaryColor, &CVehicle::SetPrimaryColor)
|
|
|
|
.Prop(_SC("SecondaryColour"), &CVehicle::GetSecondaryColor, &CVehicle::SetSecondaryColor)
|
2016-02-20 23:25:00 +01:00
|
|
|
.Prop(_SC("DamageData"), &CVehicle::GetDamageData, &CVehicle::SetDamageData)
|
|
|
|
.Prop(_SC("Radio"), &CVehicle::GetRadio, &CVehicle::SetRadio)
|
2016-05-22 05:20:38 +02:00
|
|
|
.Prop(_SC("TurretRotation"), &CVehicle::GetTurretRotation)
|
|
|
|
.Prop(_SC("HorTurretRotation"), &CVehicle::GetHorizontalTurretRotation)
|
|
|
|
.Prop(_SC("HorizontalTurretRotation"), &CVehicle::GetHorizontalTurretRotation)
|
|
|
|
.Prop(_SC("VerTurretRotation"), &CVehicle::GetVerticalTurretRotation)
|
|
|
|
.Prop(_SC("VerticalTurretRotation"), &CVehicle::GetVerticalTurretRotation)
|
2018-06-28 21:12:05 +02:00
|
|
|
.Prop(_SC("LightsData"), &CVehicle::GetLightsData, &CVehicle::SetLightsData)
|
2017-06-19 03:09:35 +02:00
|
|
|
.Prop(_SC("CollideAreas"), &CVehicle::GetCollideAreas, &CVehicle::SetCollideAreas)
|
2016-06-08 15:53:16 +02:00
|
|
|
.Prop(_SC("TrackPosition"), &CVehicle::GetTrackPosition, &CVehicle::SetTrackPosition)
|
|
|
|
.Prop(_SC("TrackRotation"), &CVehicle::GetTrackRotation, &CVehicle::SetTrackRotation)
|
2016-08-21 17:07:35 +02:00
|
|
|
.Prop(_SC("LastPrimaryColor"), &CVehicle::GetLastPrimaryColor)
|
|
|
|
.Prop(_SC("LastSecondaryColor"), &CVehicle::GetLastSecondaryColor)
|
|
|
|
.Prop(_SC("LastPrimaryColour"), &CVehicle::GetLastPrimaryColor)
|
|
|
|
.Prop(_SC("LastSecondaryColour"), &CVehicle::GetLastSecondaryColor)
|
2016-06-08 15:53:16 +02:00
|
|
|
.Prop(_SC("LastHealth"), &CVehicle::GetLastHealth)
|
|
|
|
.Prop(_SC("LastPosition"), &CVehicle::GetLastPosition)
|
|
|
|
.Prop(_SC("LastRotation"), &CVehicle::GetLastRotation)
|
2020-05-04 10:58:30 +02:00
|
|
|
.Prop(_SC("Distance"), &CVehicle::GetDistance, &CVehicle::SetDistance)
|
|
|
|
.Prop(_SC("TrackDistance"), &CVehicle::GetTrackDistance, &CVehicle::SetTrackDistance)
|
2016-05-22 05:20:38 +02:00
|
|
|
.Prop(_SC("PosX"), &CVehicle::GetPositionX, &CVehicle::SetPositionX)
|
|
|
|
.Prop(_SC("PosY"), &CVehicle::GetPositionY, &CVehicle::SetPositionY)
|
|
|
|
.Prop(_SC("PosZ"), &CVehicle::GetPositionZ, &CVehicle::SetPositionZ)
|
|
|
|
.Prop(_SC("RotX"), &CVehicle::GetRotationX, &CVehicle::SetRotationX)
|
|
|
|
.Prop(_SC("RotY"), &CVehicle::GetRotationY, &CVehicle::SetRotationY)
|
|
|
|
.Prop(_SC("RotZ"), &CVehicle::GetRotationZ, &CVehicle::SetRotationZ)
|
|
|
|
.Prop(_SC("RotW"), &CVehicle::GetRotationW, &CVehicle::SetRotationW)
|
|
|
|
.Prop(_SC("EulerX"), &CVehicle::GetEulerRotationX, &CVehicle::SetEulerRotationX)
|
|
|
|
.Prop(_SC("EulerY"), &CVehicle::GetEulerRotationY, &CVehicle::SetEulerRotationY)
|
|
|
|
.Prop(_SC("EulerZ"), &CVehicle::GetEulerRotationZ, &CVehicle::SetEulerRotationZ)
|
|
|
|
.Prop(_SC("SpeedX"), &CVehicle::GetSpeedX, &CVehicle::SetSpeedX)
|
|
|
|
.Prop(_SC("SpeedY"), &CVehicle::GetSpeedY, &CVehicle::SetSpeedY)
|
|
|
|
.Prop(_SC("SpeedZ"), &CVehicle::GetSpeedZ, &CVehicle::SetSpeedZ)
|
|
|
|
.Prop(_SC("RelSpeedX"), &CVehicle::GetRelativeSpeedX, &CVehicle::SetRelativeSpeedX)
|
|
|
|
.Prop(_SC("RelSpeedY"), &CVehicle::GetRelativeSpeedY, &CVehicle::SetRelativeSpeedY)
|
|
|
|
.Prop(_SC("RelSpeedZ"), &CVehicle::GetRelativeSpeedZ, &CVehicle::SetRelativeSpeedZ)
|
|
|
|
.Prop(_SC("TurnSpeedX"), &CVehicle::GetTurnSpeedX, &CVehicle::SetTurnSpeedX)
|
|
|
|
.Prop(_SC("TurnSpeedY"), &CVehicle::GetTurnSpeedY, &CVehicle::SetTurnSpeedY)
|
|
|
|
.Prop(_SC("TurnSpeedZ"), &CVehicle::GetTurnSpeedZ, &CVehicle::SetTurnSpeedZ)
|
|
|
|
.Prop(_SC("RelTurnSpeedX"), &CVehicle::GetRelativeTurnSpeedX, &CVehicle::SetRelativeTurnSpeedX)
|
|
|
|
.Prop(_SC("RelTurnSpeedY"), &CVehicle::GetRelativeTurnSpeedY, &CVehicle::SetRelativeTurnSpeedY)
|
|
|
|
.Prop(_SC("RelTurnSpeedZ"), &CVehicle::GetRelativeTurnSpeedZ, &CVehicle::SetRelativeTurnSpeedZ)
|
2016-03-10 05:18:39 +01:00
|
|
|
// Member Methods
|
2016-02-20 23:25:00 +01:00
|
|
|
.Func(_SC("StreamedFor"), &CVehicle::IsStreamedFor)
|
2016-05-22 05:20:38 +02:00
|
|
|
.Func(_SC("GetOption"), &CVehicle::GetOption)
|
|
|
|
.Func(_SC("SetOption"), &CVehicle::SetOption)
|
|
|
|
.Func(_SC("SetOptionEx"), &CVehicle::SetOptionEx)
|
2016-02-20 23:25:00 +01:00
|
|
|
.Func(_SC("Occupant"), &CVehicle::GetOccupant)
|
|
|
|
.Func(_SC("OccupantID"), &CVehicle::GetOccupantID)
|
2018-01-28 21:53:27 +01:00
|
|
|
.Func(_SC("HasOccupant"), &CVehicle::HasOccupant)
|
2016-02-20 23:25:00 +01:00
|
|
|
.Func(_SC("Respawn"), &CVehicle::Respawn)
|
2016-05-22 05:20:38 +02:00
|
|
|
.Func(_SC("Explode"), &CVehicle::Explode)
|
2021-03-15 06:01:26 +01:00
|
|
|
.Func(_SC("FlattenTyres"), &CVehicle::FlattenTyres)
|
2016-02-20 23:25:00 +01:00
|
|
|
.Func(_SC("SetRot"), &CVehicle::SetRotationEx)
|
|
|
|
.Func(_SC("SetRotation"), &CVehicle::SetRotationEx)
|
2016-05-22 05:20:38 +02:00
|
|
|
.Func(_SC("SetEulerRot"), &CVehicle::SetRotationEulerEx)
|
|
|
|
.Func(_SC("SetEulerRotation"), &CVehicle::SetRotationEulerEx)
|
2016-02-20 23:25:00 +01:00
|
|
|
.Func(_SC("SetSpeed"), &CVehicle::SetSpeedEx)
|
2016-05-22 05:20:38 +02:00
|
|
|
.Func(_SC("SetRelativeSpeed"), &CVehicle::SetRelativeSpeedEx)
|
2016-02-20 23:25:00 +01:00
|
|
|
.Func(_SC("SetTurnSpeed"), &CVehicle::SetTurnSpeedEx)
|
2016-05-22 05:20:38 +02:00
|
|
|
.Func(_SC("SetRelativeTurnSpeed"), &CVehicle::SetRelativeTurnSpeedEx)
|
2016-02-20 23:25:00 +01:00
|
|
|
.Func(_SC("SetSpawnPos"), &CVehicle::SetSpawnPositionEx)
|
|
|
|
.Func(_SC("SetSpawnPosition"), &CVehicle::SetSpawnPositionEx)
|
|
|
|
.Func(_SC("SetSpawnRot"), &CVehicle::SetSpawnRotationEx)
|
|
|
|
.Func(_SC("SetSpawnRotation"), &CVehicle::SetSpawnRotationEx)
|
2016-05-22 05:20:38 +02:00
|
|
|
.Func(_SC("SetSpawnEulerRot"), &CVehicle::SetSpawnRotationEulerEx)
|
|
|
|
.Func(_SC("SetSpawnEulerRotation"), &CVehicle::SetSpawnRotationEulerEx)
|
2016-07-13 00:47:36 +02:00
|
|
|
.Func(_SC("Fix"), &CVehicle::Fix)
|
2016-02-20 23:25:00 +01:00
|
|
|
.Func(_SC("SetColors"), &CVehicle::SetColors)
|
|
|
|
.Func(_SC("GetPartStatus"), &CVehicle::GetPartStatus)
|
|
|
|
.Func(_SC("SetPartStatus"), &CVehicle::SetPartStatus)
|
2016-08-20 21:42:54 +02:00
|
|
|
.Func(_SC("GetTyreStatus"), &CVehicle::GetTyreStatus)
|
|
|
|
.Func(_SC("SetTyreStatus"), &CVehicle::SetTyreStatus)
|
2016-05-22 05:20:38 +02:00
|
|
|
.Func(_SC("ExistsHandlingRule"), &CVehicle::ExistsHandlingRule)
|
|
|
|
.Func(_SC("GetHandlingRule"), &CVehicle::GetHandlingRule)
|
|
|
|
.Func(_SC("SetHandlingRule"), &CVehicle::SetHandlingRule)
|
|
|
|
.Func(_SC("ResetHandlingRule"), &CVehicle::ResetHandlingRule)
|
|
|
|
.Func(_SC("ResetHandlings"), &CVehicle::ResetHandlings)
|
2020-03-20 19:37:17 +01:00
|
|
|
#if SQMOD_SDK_LEAST(2, 1)
|
2019-06-01 23:39:06 +02:00
|
|
|
.Func(_SC("SetPlayer3DArrow"), &CVehicle::SetPlayer3DArrow)
|
|
|
|
.Func(_SC("GetPlayer3DArrow"), &CVehicle::GetPlayer3DArrow)
|
|
|
|
.Func(_SC("SetPlayer3DArrowID"), &CVehicle::SetPlayer3DArrowID)
|
|
|
|
.Func(_SC("GetPlayer3DArrowID"), &CVehicle::GetPlayer3DArrowID)
|
2020-03-20 19:37:17 +01:00
|
|
|
#endif
|
2017-06-19 03:09:35 +02:00
|
|
|
.Func(_SC("AreasCollide"), &CVehicle::SetAreasCollide)
|
2016-03-10 05:18:39 +01:00
|
|
|
// Member Overloads
|
2021-01-30 07:51:39 +01:00
|
|
|
.Overload(_SC("SetPos"), &CVehicle::SetPosition)
|
|
|
|
.Overload(_SC("SetPos"), &CVehicle::SetPositionB)
|
|
|
|
.Overload(_SC("SetPos"), &CVehicle::SetPositionEx)
|
|
|
|
.Overload(_SC("SetPos"), &CVehicle::SetPositionExB)
|
|
|
|
.Overload(_SC("SetPosition"), &CVehicle::SetPosition)
|
|
|
|
.Overload(_SC("SetPosition"), &CVehicle::SetPositionB)
|
|
|
|
.Overload(_SC("SetPosition"), &CVehicle::SetPositionEx)
|
|
|
|
.Overload(_SC("SetPosition"), &CVehicle::SetPositionExB)
|
|
|
|
.Overload(_SC("AddSpeed"), &CVehicle::AddSpeed)
|
|
|
|
.Overload(_SC("AddSpeed"), &CVehicle::AddSpeedEx)
|
|
|
|
.Overload(_SC("AddRelativeSpeed"), &CVehicle::AddRelativeSpeed)
|
|
|
|
.Overload(_SC("AddRelativeSpeed"), &CVehicle::AddRelativeSpeedEx)
|
|
|
|
.Overload(_SC("AddTurnSpeed"), &CVehicle::AddTurnSpeed)
|
|
|
|
.Overload(_SC("AddTurnSpeed"), &CVehicle::AddTurnSpeedEx)
|
|
|
|
.Overload(_SC("AddRelativeTurnSpeed"), &CVehicle::AddRelativeTurnSpeed)
|
|
|
|
.Overload(_SC("AddRelativeTurnSpeed"), &CVehicle::AddRelativeTurnSpeedEx)
|
|
|
|
.Overload(_SC("ResetHandling"), &CVehicle::ResetHandlings)
|
|
|
|
.Overload(_SC("ResetHandling"), &CVehicle::ResetHandlingRule)
|
|
|
|
.Overload(_SC("Embark"), &CVehicle::Embark)
|
|
|
|
.Overload(_SC("Embark"), &CVehicle::EmbarkEx)
|
2016-03-10 04:57:13 +01:00
|
|
|
// Static Overloads
|
2021-01-30 07:51:39 +01:00
|
|
|
.StaticOverload(_SC("CreateEx"), &Vehicle_CreateEx1a)
|
|
|
|
.StaticOverload(_SC("CreateEx"), &Vehicle_CreateEx1b)
|
|
|
|
.StaticOverload(_SC("Create"), &Vehicle_Create1a)
|
|
|
|
.StaticOverload(_SC("Create"), &Vehicle_Create1b)
|
2016-08-07 00:54:33 +02:00
|
|
|
// Raw Squirrel Methods
|
|
|
|
.SquirrelFunc(_SC("NullInst"), &CVehicle::SqGetNull)
|
2016-11-16 23:23:59 +01:00
|
|
|
.SquirrelFunc(_SC("MakeTask"), &Tasks::MakeTask< CVehicle, ENT_VEHICLE >)
|
|
|
|
.SquirrelFunc(_SC("DropTask"), &Tasks::DropTask< CVehicle, ENT_VEHICLE >)
|
|
|
|
.SquirrelFunc(_SC("DoesTask"), &Tasks::DoesTask< CVehicle, ENT_VEHICLE >)
|
2016-11-17 16:04:21 +01:00
|
|
|
.SquirrelFunc(_SC("FindTask"), &Tasks::FindTask< CVehicle, ENT_VEHICLE >)
|
2015-09-30 02:56:11 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
} // Namespace:: SqMod
|