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"
|
2018-07-29 11:25:44 +02:00
|
|
|
#include "Misc/Areas.hpp"
|
|
|
|
#include "Misc/Tasks.hpp"
|
2015-09-30 02:56:11 +02:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
namespace SqMod {
|
|
|
|
|
2016-11-15 20:16:24 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
SQMODE_DECL_TYPENAME(Typename, _SC("SqVehicle"))
|
|
|
|
|
2015-11-01 00:33:12 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-03-10 04:57:13 +01:00
|
|
|
const Int32 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)
|
|
|
|
{
|
|
|
|
sq_pushobject(vm, Core::Get().GetNullVehicle().GetObject());
|
|
|
|
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
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
CVehicle::CVehicle(Int32 id)
|
|
|
|
: m_ID(VALID_ENTITYGETEX(id, SQMOD_VEHICLE_POOL))
|
2016-05-22 05:20:38 +02:00
|
|
|
, m_Tag(ToStrF("%d", id)), m_Data(), m_CircularLocks(0)
|
2015-11-01 00:33:12 +01:00
|
|
|
{
|
|
|
|
/* ... */
|
|
|
|
}
|
|
|
|
|
2015-10-29 21:56:07 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
CVehicle::~CVehicle()
|
2015-10-29 21:56:07 +01:00
|
|
|
{
|
2016-02-20 23:25:00 +01:00
|
|
|
/* ... */
|
2015-10-29 21:56:07 +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)
|
|
|
|
{
|
|
|
|
m_Tag.assign(tag.mPtr, tag.mLen);
|
|
|
|
}
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-02-21 20:24:59 +01:00
|
|
|
bool CVehicle::Destroy(Int32 header, LightObj & payload)
|
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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-02-21 20:24:59 +01:00
|
|
|
void CVehicle::CustomEvent(Int32 header, LightObj & payload) const
|
2016-07-26 23:13:50 +02:00
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perfrom the requested action
|
|
|
|
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
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
bool CVehicle::GetOption(Int32 option_id) const
|
|
|
|
{
|
|
|
|
// 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)
|
|
|
|
{
|
|
|
|
STHROWF("Invalid option identifier: %d", option_id);
|
|
|
|
}
|
|
|
|
// Return the requested value
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void CVehicle::SetOption(Int32 option_id, bool toggle)
|
|
|
|
{
|
|
|
|
// Attempt to obtain the current value of the specified option
|
|
|
|
const bool value = _Func->GetVehicleOption(m_ID, static_cast< vcmpVehicleOption >(option_id));
|
|
|
|
// Attempt to modify the current value of the specified option
|
|
|
|
if (_Func->SetVehicleOption(m_ID, static_cast< vcmpVehicleOption >(option_id),
|
|
|
|
toggle) == vcmpErrorArgumentOutOfBounds)
|
|
|
|
{
|
|
|
|
STHROWF("Invalid option identifier: %d", option_id);
|
|
|
|
}
|
2016-08-18 13:38:00 +02:00
|
|
|
else 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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-02-21 20:24:59 +01:00
|
|
|
void CVehicle::SetOptionEx(Int32 option_id, bool toggle, Int32 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));
|
|
|
|
// Attempt to modify the current value of the specified option
|
|
|
|
if (_Func->SetVehicleOption(m_ID, static_cast< vcmpVehicleOption >(option_id),
|
|
|
|
toggle) == vcmpErrorArgumentOutOfBounds)
|
|
|
|
{
|
|
|
|
STHROWF("Invalid option identifier: %d", option_id);
|
|
|
|
}
|
2016-08-18 13:38:00 +02:00
|
|
|
else 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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 CVehicle::GetSyncSource() const
|
|
|
|
{
|
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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 CVehicle::GetWorld() const
|
|
|
|
{
|
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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-08-18 13:38:00 +02:00
|
|
|
void CVehicle::SetWorld(Int32 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
|
|
|
|
const Int32 current = _Func->GetVehicleWorld(m_ID);
|
|
|
|
// Don't even bother if it's the same value
|
|
|
|
if (current == world)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// Avoid property unwind from a recursive call
|
2016-03-10 04:57:13 +01:00
|
|
|
_Func->SetVehicleWorld(m_ID, world);
|
2016-08-18 13:38:00 +02:00
|
|
|
// 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);
|
|
|
|
}
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
2015-10-29 21:56:07 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 CVehicle::GetModel() const
|
|
|
|
{
|
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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-02-21 20:24:59 +01:00
|
|
|
LightObj & CVehicle::GetOccupant(Int32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 CVehicle::GetOccupantID(Int32 slot) const
|
|
|
|
{
|
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
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
bool CVehicle::HasOccupant(Int32 slot) const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
const Int32 id = _Func->GetVehicleOccupant(m_ID, slot);
|
|
|
|
// 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
|
|
|
|
return (err == vcmpErrorNone) && INVALID_ENTITYEX(id, SQMOD_PLAYER_POOL);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-08-18 13:45:12 +02:00
|
|
|
void CVehicle::SetImmunity(Int32 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
|
|
|
|
const Int32 current = _Func->GetVehicleImmunityFlags(m_ID);
|
|
|
|
// Avoid property unwind from a recursive call
|
2016-03-10 04:57:13 +01:00
|
|
|
_Func->SetVehicleImmunityFlags(m_ID, flags);
|
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
|
|
|
|
Core::Get().EmitVehicleImmunity(m_ID, current, 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);
|
|
|
|
}
|
|
|
|
|
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
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehiclePosition(m_ID, pos.x, pos.y, pos.z, 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::SetPositionEx(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
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehiclePosition(m_ID, pos.x, pos.y, pos.z, empty);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CVehicle::SetPositionEx(Float32 x, Float32 y, Float32 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->SetVehiclePosition(m_ID, x, y, z, false);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CVehicle::SetPositionEx(Float32 x, Float32 y, Float32 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
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehiclePosition(m_ID, x, y, z, 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
|
|
|
|
Quaternion quat;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the values
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->GetVehicleRotation(m_ID, &quat.x, &quat.y, &quat.z, &quat.w);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return quat;
|
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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CVehicle::SetRotationEx(Float32 x, Float32 y, Float32 z, Float32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CVehicle::SetRotationEulerEx(Float32 x, Float32 y, Float32 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
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->GetVehicleSpeed(m_ID, &vec.x, &vec.y, &vec.z, 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
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleSpeed(m_ID, vel.x, vel.y, vel.z, false, false);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CVehicle::SetSpeedEx(Float32 x, Float32 y, Float32 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->SetVehicleSpeed(m_ID, x, y, z, false, 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
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleSpeed(m_ID, vel.x, vel.y, vel.z, true, false);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CVehicle::AddSpeedEx(Float32 x, Float32 y, Float32 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->SetVehicleSpeed(m_ID, x, y, z, true, 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
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->GetVehicleSpeed(m_ID, &vec.x, &vec.y, &vec.z, 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
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleSpeed(m_ID, vel.x, vel.y, vel.z, false, 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::SetRelativeSpeedEx(Float32 x, Float32 y, Float32 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->SetVehicleSpeed(m_ID, x, y, z, false, 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
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleSpeed(m_ID, vel.x, vel.y, vel.z, true, 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::AddRelativeSpeedEx(Float32 x, Float32 y, Float32 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->SetVehicleSpeed(m_ID, x, y, z, true, 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
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->GetVehicleTurnSpeed(m_ID, &vec.x, &vec.y, &vec.z, 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
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, vel.x, vel.y, vel.z, false, false);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CVehicle::SetTurnSpeedEx(Float32 x, Float32 y, Float32 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->SetVehicleTurnSpeed(m_ID, x, y, z, false, 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
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, vel.x, vel.y, vel.z, true, false);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CVehicle::AddTurnSpeedEx(Float32 x, Float32 y, Float32 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->SetVehicleTurnSpeed(m_ID, x, y, z, true, 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
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->GetVehicleTurnSpeed(m_ID, &vec.x, &vec.y, &vec.z, 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
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, vel.x, vel.y, vel.z, false, 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::SetRelativeTurnSpeedEx(Float32 x, Float32 y, Float32 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->SetVehicleTurnSpeed(m_ID, x, y, z, false, 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
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, vel.x, vel.y, vel.z, true, 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::AddRelativeTurnSpeedEx(Float32 x, Float32 y, Float32 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->SetVehicleTurnSpeed(m_ID, x, y, z, true, 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::SetSpawnPositionEx(Float32 x, Float32 y, Float32 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
|
|
|
|
Quaternion quat;
|
2016-05-22 05:20:38 +02:00
|
|
|
// Query the server for the values
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->GetVehicleSpawnRotation(m_ID, &quat.x, &quat.y, &quat.z, &quat.w);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Return the requested information
|
2017-08-06 20:15:32 +02:00
|
|
|
return quat;
|
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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CVehicle::SetSpawnRotationEx(Float32 x, Float32 y, Float32 z, Float32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CVehicle::SetSpawnRotationEulerEx(Float32 x, Float32 y, Float32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
Uint32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::SetIdleRespawnTimer(Uint32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CVehicle::SetHealth(Float32 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);
|
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 CVehicle::GetPrimaryColor() const
|
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// The color value
|
2018-01-30 17:05:47 +01:00
|
|
|
Int32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CVehicle::SetPrimaryColor(Int32 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
|
2018-01-30 17:05:47 +01:00
|
|
|
Int32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 CVehicle::GetSecondaryColor() const
|
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// The color value
|
2018-01-30 17:05:47 +01:00
|
|
|
Int32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CVehicle::SetSecondaryColor(Int32 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
|
2018-01-30 17:05:47 +01:00
|
|
|
Int32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CVehicle::SetColors(Int32 primary, Int32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
Int32 CVehicle::GetPartStatus(Int32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-08-18 13:51:55 +02:00
|
|
|
void CVehicle::SetPartStatus(Int32 part, Int32 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
|
2016-08-18 14:32:18 +02:00
|
|
|
const Int32 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 property unwind from a recursive call
|
2016-08-18 14:32:18 +02:00
|
|
|
_Func->SetVehiclePartStatus(m_ID, part, status);
|
2016-08-18 13:51:55 +02:00
|
|
|
// 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
|
|
|
}
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-08-20 21:42:54 +02:00
|
|
|
Int32 CVehicle::GetTyreStatus(Int32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-08-20 21:42:54 +02:00
|
|
|
void CVehicle::SetTyreStatus(Int32 tyre, Int32 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
|
2016-08-20 21:42:54 +02:00
|
|
|
const Int32 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 property unwind from a recursive call
|
2016-08-20 21:42:54 +02:00
|
|
|
_Func->SetVehicleTyreStatus(m_ID, tyre, status);
|
2016-08-18 13:56:38 +02:00
|
|
|
// 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
|
|
|
}
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
Uint32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-08-18 14:06:03 +02:00
|
|
|
void CVehicle::SetDamageData(Uint32 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
|
|
|
|
const Uint32 current = _Func->GetVehicleDamageData(m_ID);
|
|
|
|
// Don't even bother if it's the same value
|
|
|
|
if (current == data)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// Avoid property unwind from a recursive call
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleDamageData(m_ID, data);
|
2016-08-18 14:06:03 +02:00
|
|
|
// 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);
|
|
|
|
}
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
Int32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-08-18 14:13:33 +02:00
|
|
|
void CVehicle::SetRadio(Int32 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
|
|
|
|
const Int32 current = _Func->GetVehicleRadio(m_ID);
|
|
|
|
// Don't even bother if it's the same value
|
|
|
|
if (current == radio)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// Avoid property unwind from a recursive call
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetVehicleRadio(m_ID, radio);
|
2016-08-18 14:13:33 +02:00
|
|
|
// 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);
|
|
|
|
}
|
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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
bool CVehicle::ExistsHandlingRule(Int32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 CVehicle::GetHandlingRule(Int32 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
|
2016-05-22 05:20:38 +02:00
|
|
|
return _Func->GetInstHandlingRule(m_ID, rule);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-08-18 14:21:50 +02:00
|
|
|
void CVehicle::SetHandlingRule(Int32 rule, Float32 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
|
|
|
|
const Float32 current = _Func->GetInstHandlingRule(m_ID, rule);
|
|
|
|
// Avoid property unwind from a recursive call
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->SetInstHandlingRule(m_ID, rule, data);
|
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
|
|
|
}
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-08-18 14:21:50 +02:00
|
|
|
void CVehicle::ResetHandlingRule(Int32 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
|
|
|
|
const Float32 current = _Func->GetInstHandlingRule(m_ID, rule);
|
|
|
|
// Avoid property unwind from a recursive call
|
2016-05-22 05:20:38 +02:00
|
|
|
_Func->ResetInstHandlingRule(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, _Func->GetInstHandlingRule(m_ID, rule));
|
2016-08-18 14:21:50 +02:00
|
|
|
}
|
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
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Int32 CVehicle::GetLightsData() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Retrieve the requested data
|
|
|
|
return _Func->GetVehicleLightsData(m_ID);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void CVehicle::SetLightsData(Int32 data) const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Apply the requested data
|
|
|
|
_Func->SetVehicleLightsData(m_ID, data);
|
|
|
|
}
|
|
|
|
|
2016-05-22 05:20:38 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
bool CVehicle::Embark(CPlayer & player) const
|
|
|
|
{
|
|
|
|
// Is the specified player even valid?
|
|
|
|
if (!player.IsActive())
|
|
|
|
{
|
|
|
|
STHROWF("Invalid player argument: null");
|
|
|
|
}
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
return (_Func->PutPlayerInVehicle(player.GetID(), m_ID, 0, true, true)
|
|
|
|
!= vcmpErrorRequestDenied);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
bool CVehicle::Embark(CPlayer & player, Int32 slot, bool allocate, bool warp) const
|
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();
|
|
|
|
// Perform the requested operation
|
2016-05-22 05:20:38 +02:00
|
|
|
return (_Func->PutPlayerInVehicle(player.GetID(), m_ID, slot, allocate, warp)
|
|
|
|
!= vcmpErrorRequestDenied);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2017-06-19 03:09:35 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
bool CVehicle::GetCollideAreas() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return (Core::Get().GetVehicle(m_ID).mFlags & ENF_AREA_TRACK);
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-08-21 17:07:35 +02:00
|
|
|
Int32 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
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-08-21 17:07:35 +02:00
|
|
|
Int32 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
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Float32 CVehicle::GetLastHealth() const
|
|
|
|
{
|
|
|
|
// 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;
|
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Float32 CVehicle::GetPositionY() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve a temporary float to retrieve the requested component
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void CVehicle::SetPositionX(Float32 x) const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehiclePosition(m_ID, x, y, z, false);
|
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::SetPositionY(Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehiclePosition(m_ID, x, y, z, false);
|
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::SetPositionZ(Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehiclePosition(m_ID, z, y, z, false);
|
2015-10-29 21:56:07 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Float32 CVehicle::GetRotationW() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve a temporary float to retrieve the requested component
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void CVehicle::SetRotationX(Float32 x) const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::SetRotationY(Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::SetRotationZ(Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::SetRotationW(Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Float32 CVehicle::GetEulerRotationX() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve a temporary float to retrieve the requested component
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::SetEulerRotationX(Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::SetEulerRotationY(Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::SetEulerRotationZ(Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleSpeed(m_ID, &x, &dummy, &dummy, 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleSpeed(m_ID, &dummy, &y, &dummy, 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleSpeed(m_ID, &dummy, &dummy, &z, 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::SetSpeedX(Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleSpeed(m_ID, &dummy, &y, &z, false);
|
2016-05-22 05:20:38 +02:00
|
|
|
// Perform the requested operation
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehicleSpeed(m_ID, x, y, z, false, false);
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void CVehicle::SetSpeedY(Float32 y) const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleSpeed(m_ID, &x, &dummy, &z, false);
|
2016-05-22 05:20:38 +02:00
|
|
|
// Perform the requested operation
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehicleSpeed(m_ID, x, y, z, false, false);
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void CVehicle::SetSpeedZ(Float32 z) const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleSpeed(m_ID, &x, &y, &dummy, false);
|
2016-05-22 05:20:38 +02:00
|
|
|
// Perform the requested operation
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehicleSpeed(m_ID, z, y, z, false, false);
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Float32 CVehicle::GetRelativeSpeedX() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous information, if any
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleSpeed(m_ID, &x, &dummy, &dummy, 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
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Float32 CVehicle::GetRelativeSpeedY() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous information, if any
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleSpeed(m_ID, &dummy, &y, &dummy, 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
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Float32 CVehicle::GetRelativeSpeedZ() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous information, if any
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleSpeed(m_ID, &dummy, &dummy, &z, 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::SetRelativeSpeedX(Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleSpeed(m_ID, &dummy, &y, &z, true);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehicleSpeed(m_ID, x, y, z, false, true);
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::SetRelativeSpeedY(Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleSpeed(m_ID, &x, &dummy, &z, true);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehicleSpeed(m_ID, x, y, z, false, true);
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::SetRelativeSpeedZ(Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleSpeed(m_ID, &x, &y, &dummy, true);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehicleSpeed(m_ID, z, y, z, false, true);
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Float32 CVehicle::GetTurnSpeedX() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous information, if any
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleTurnSpeed(m_ID, &x, &dummy, &dummy, 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 CVehicle::GetTurnSpeedY() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous information, if any
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleTurnSpeed(m_ID, &dummy, &y, &dummy, 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
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Float32 CVehicle::GetTurnSpeedZ() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous information, if any
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleTurnSpeed(m_ID, &dummy, &dummy, &z, 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
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void CVehicle::SetTurnSpeedX(Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleTurnSpeed(m_ID, &dummy, &y, &z, false);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, x, y, z, false, false);
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
2016-05-22 05:20:38 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void CVehicle::SetTurnSpeedY(Float32 y) const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
2017-08-06 20:15:32 +02:00
|
|
|
// Reserve some temporary floats to retrieve the missing components
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleTurnSpeed(m_ID, &x, &dummy, &z, false);
|
2016-05-22 05:20:38 +02:00
|
|
|
// Perform the requested operation
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, x, y, z, false, 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::SetTurnSpeedZ(Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleTurnSpeed(m_ID, &x, &y, &dummy, false);
|
2016-05-22 05:20:38 +02:00
|
|
|
// Perform the requested operation
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, z, y, z, false, false);
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Float32 CVehicle::GetRelativeTurnSpeedX() const
|
|
|
|
{
|
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous information, if any
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleTurnSpeed(m_ID, &x, &dummy, &dummy, 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleTurnSpeed(m_ID, &dummy, &y, &dummy, 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleTurnSpeed(m_ID, &dummy, &dummy, &z, 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
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::SetRelativeTurnSpeedX(Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleTurnSpeed(m_ID, &dummy, &y, &z, true);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, x, y, z, false, true);
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::SetRelativeTurnSpeedY(Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleTurnSpeed(m_ID, &x, &dummy, &z, true);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, x, y, z, false, true);
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void CVehicle::SetRelativeTurnSpeedZ(Float32 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
|
2018-01-30 18:09:54 +01:00
|
|
|
Float32 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->GetVehicleTurnSpeed(m_ID, &x, &y, &dummy, true);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Perform the requested operation
|
2017-08-06 20:15:32 +02:00
|
|
|
_Func->SetVehicleTurnSpeed(m_ID, z, y, z, false, true);
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-02-21 20:24:59 +01:00
|
|
|
static LightObj & Vehicle_CreateEx(Int32 model, Int32 world, Float32 x, Float32 y, Float32 z, Float32 angle,
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 primary, Int32 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,
|
2017-02-21 20:24:59 +01:00
|
|
|
SQMOD_CREATE_DEFAULT, NullLightObj());
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
2017-02-21 20:24:59 +01:00
|
|
|
static LightObj & Vehicle_CreateEx(Int32 model, Int32 world, Float32 x, Float32 y, Float32 z, Float32 angle,
|
|
|
|
Int32 primary, Int32 secondary, Int32 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,
|
2015-11-01 00:33:12 +01:00
|
|
|
header, payload);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2017-02-21 20:24:59 +01:00
|
|
|
static LightObj & Vehicle_Create(Int32 model, Int32 world, const Vector3 & pos, Float32 angle,
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 primary, Int32 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,
|
2017-02-21 20:24:59 +01:00
|
|
|
SQMOD_CREATE_DEFAULT, NullLightObj());
|
2015-11-01 00:33:12 +01:00
|
|
|
}
|
|
|
|
|
2017-02-21 20:24:59 +01:00
|
|
|
static LightObj & Vehicle_Create(Int32 model, Int32 world, const Vector3 & pos, Float32 angle,
|
|
|
|
Int32 primary, Int32 secondary, Int32 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,
|
2015-11-01 00:33:12 +01:00
|
|
|
header, payload);
|
|
|
|
}
|
|
|
|
|
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
|
2016-02-20 23:25:00 +01:00
|
|
|
.Overload< bool (CVehicle::*)(void) >(_SC("Destroy"), &CVehicle::Destroy)
|
|
|
|
.Overload< bool (CVehicle::*)(Int32) >(_SC("Destroy"), &CVehicle::Destroy)
|
2017-02-21 20:24:59 +01:00
|
|
|
.Overload< bool (CVehicle::*)(Int32, LightObj &) >(_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)
|
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)
|
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)
|
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)
|
2017-06-19 03:09:35 +02:00
|
|
|
.Func(_SC("AreasCollide"), &CVehicle::SetAreasCollide)
|
2016-03-10 05:18:39 +01:00
|
|
|
// Member Overloads
|
2015-11-11 10:36:37 +01:00
|
|
|
.Overload< void (CVehicle::*)(const Vector3 &, bool) const >
|
2016-02-20 23:25:00 +01:00
|
|
|
(_SC("SetPos"), &CVehicle::SetPositionEx)
|
|
|
|
.Overload< void (CVehicle::*)(Float32, Float32, Float32) const >
|
|
|
|
(_SC("SetPos"), &CVehicle::SetPositionEx)
|
|
|
|
.Overload< void (CVehicle::*)(Float32, Float32, Float32, bool) const >
|
|
|
|
(_SC("SetPos"), &CVehicle::SetPositionEx)
|
2015-11-11 09:56:02 +01:00
|
|
|
.Overload< void (CVehicle::*)(const Vector3 &, bool) const >
|
2016-02-20 23:25:00 +01:00
|
|
|
(_SC("SetPosition"), &CVehicle::SetPositionEx)
|
|
|
|
.Overload< void (CVehicle::*)(Float32, Float32, Float32) const >
|
|
|
|
(_SC("SetPosition"), &CVehicle::SetPositionEx)
|
|
|
|
.Overload< void (CVehicle::*)(Float32, Float32, Float32, bool) const >
|
|
|
|
(_SC("SetPosition"), &CVehicle::SetPositionEx)
|
2015-11-11 09:56:02 +01:00
|
|
|
.Overload< void (CVehicle::*)(const Vector3 &) const >
|
2016-02-20 23:25:00 +01:00
|
|
|
(_SC("AddSpeed"), &CVehicle::AddSpeed)
|
|
|
|
.Overload< void (CVehicle::*)(Float32, Float32, Float32) const >
|
|
|
|
(_SC("AddSpeed"), &CVehicle::AddSpeedEx)
|
2015-11-11 09:56:02 +01:00
|
|
|
.Overload< void (CVehicle::*)(const Vector3 &) const >
|
2016-05-22 05:20:38 +02:00
|
|
|
(_SC("AddRelativeSpeed"), &CVehicle::AddRelativeSpeed)
|
2016-02-20 23:25:00 +01:00
|
|
|
.Overload< void (CVehicle::*)(Float32, Float32, Float32) const >
|
2016-05-22 05:20:38 +02:00
|
|
|
(_SC("AddRelativeSpeed"), &CVehicle::AddRelativeSpeedEx)
|
2015-11-11 09:56:02 +01:00
|
|
|
.Overload< void (CVehicle::*)(const Vector3 &) const >
|
2016-02-20 23:25:00 +01:00
|
|
|
(_SC("AddTurnSpeed"), &CVehicle::AddTurnSpeed)
|
|
|
|
.Overload< void (CVehicle::*)(Float32, Float32, Float32) const >
|
|
|
|
(_SC("AddTurnSpeed"), &CVehicle::AddTurnSpeedEx)
|
2015-11-11 09:56:02 +01:00
|
|
|
.Overload< void (CVehicle::*)(const Vector3 &) const >
|
2016-05-22 05:20:38 +02:00
|
|
|
(_SC("AddRelativeTurnSpeed"), &CVehicle::AddRelativeTurnSpeed)
|
2016-02-20 23:25:00 +01:00
|
|
|
.Overload< void (CVehicle::*)(Float32, Float32, Float32) const >
|
2016-05-22 05:20:38 +02:00
|
|
|
(_SC("AddRelativeTurnSpeed"), &CVehicle::AddRelativeTurnSpeedEx)
|
2015-11-11 09:56:02 +01:00
|
|
|
.Overload< void (CVehicle::*)(void) const >
|
2016-05-22 05:20:38 +02:00
|
|
|
(_SC("ResetHandling"), &CVehicle::ResetHandlings)
|
2016-08-18 14:32:18 +02:00
|
|
|
.Overload< void (CVehicle::*)(Int32) >
|
2016-05-22 05:20:38 +02:00
|
|
|
(_SC("ResetHandling"), &CVehicle::ResetHandlingRule)
|
|
|
|
.Overload< bool (CVehicle::*)(CPlayer &) const >
|
2016-02-20 23:25:00 +01:00
|
|
|
(_SC("Embark"), &CVehicle::Embark)
|
2016-05-22 05:20:38 +02:00
|
|
|
.Overload< bool (CVehicle::*)(CPlayer &, Int32, bool, bool) const >
|
2016-02-20 23:25:00 +01:00
|
|
|
(_SC("Embark"), &CVehicle::Embark)
|
2016-03-10 04:57:13 +01:00
|
|
|
// Static Overloads
|
2017-02-21 20:24:59 +01:00
|
|
|
.StaticOverload< LightObj & (*)(Int32, Int32, Float32, Float32, Float32, Float32, Int32, Int32) >
|
2016-03-10 04:57:13 +01:00
|
|
|
(_SC("CreateEx"), &Vehicle_CreateEx)
|
2017-02-21 20:24:59 +01:00
|
|
|
.StaticOverload< LightObj & (*)(Int32, Int32, Float32, Float32, Float32, Float32, Int32, Int32, Int32, LightObj &) >
|
2016-03-10 04:57:13 +01:00
|
|
|
(_SC("CreateEx"), &Vehicle_CreateEx)
|
2017-02-21 20:24:59 +01:00
|
|
|
.StaticOverload< LightObj & (*)(Int32, Int32, const Vector3 &, Float32, Int32, Int32) >
|
2016-03-10 04:57:13 +01:00
|
|
|
(_SC("Create"), &Vehicle_Create)
|
2017-02-21 20:24:59 +01:00
|
|
|
.StaticOverload< LightObj & (*)(Int32, Int32, const Vector3 &, Float32, Int32, Int32, Int32, LightObj &) >
|
2016-03-10 04:57:13 +01:00
|
|
|
(_SC("Create"), &Vehicle_Create)
|
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
|