2015-09-30 02:56:11 +02:00
|
|
|
#ifndef _ENTITY_VEHICLE_HPP_
|
|
|
|
#define _ENTITY_VEHICLE_HPP_
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
#include "Base/Shared.hpp"
|
2015-09-30 02:56:11 +02:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
namespace SqMod {
|
|
|
|
|
|
|
|
/* ------------------------------------------------------------------------------------------------
|
2016-03-10 04:57:13 +01:00
|
|
|
* Manages a single vehicle entity.
|
2015-09-30 02:56:11 +02:00
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
class CVehicle
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
// --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
friend class Core;
|
|
|
|
|
|
|
|
private:
|
2015-10-29 21:56:07 +01:00
|
|
|
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
static Vector3 s_Vector3;
|
|
|
|
static Vector4 s_Vector4;
|
|
|
|
static Quaternion s_Quaternion;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* Identifier of the managed entity.
|
2015-11-01 00:33:12 +01:00
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 m_ID;
|
2015-11-01 00:33:12 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-03-10 04:57:13 +01:00
|
|
|
* User tag associated with this instance.
|
2015-10-29 21:56:07 +01:00
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
String m_Tag;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* User data associated with this instance.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Object m_Data;
|
2015-10-29 21:56:07 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* Base constructor.
|
2015-10-29 21:56:07 +01:00
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
CVehicle(Int32 id);
|
2015-10-29 21:56:07 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
public:
|
|
|
|
|
2015-10-29 21:56:07 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-03-10 04:57:13 +01:00
|
|
|
* Maximum possible number that could represent an identifier for this entity type.
|
2015-10-29 21:56:07 +01:00
|
|
|
*/
|
2016-03-10 04:57:13 +01:00
|
|
|
static const Int32 Max;
|
2015-10-29 21:56:07 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-03-10 04:57:13 +01:00
|
|
|
* Copy constructor. (disabled)
|
2015-10-29 21:56:07 +01:00
|
|
|
*/
|
2016-03-10 04:57:13 +01:00
|
|
|
CVehicle(const CVehicle &) = delete;
|
2015-10-29 21:56:07 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Move constructor. (disabled)
|
|
|
|
*/
|
|
|
|
CVehicle(CVehicle &&) = delete;
|
2015-10-29 21:56:07 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* Destructor.
|
2015-10-29 21:56:07 +01:00
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
~CVehicle();
|
2015-10-29 21:56:07 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Copy assignment operator. (disabled)
|
|
|
|
*/
|
|
|
|
CVehicle & operator = (const CVehicle &) = delete;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Move assignment operator. (disabled)
|
|
|
|
*/
|
|
|
|
CVehicle & operator = (CVehicle &&) = delete;
|
|
|
|
|
2015-10-29 21:56:07 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* See whether this instance manages a valid entity.
|
2015-10-29 21:56:07 +01:00
|
|
|
*/
|
2016-03-10 04:57:13 +01:00
|
|
|
void Validate() const
|
2016-02-20 23:25:00 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
if (INVALID_ENTITY(m_ID))
|
2016-03-12 21:51:44 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
SqThrowF("Invalid vehicle reference [%s]", m_Tag.c_str());
|
2016-03-12 21:51:44 +01:00
|
|
|
}
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
2015-10-29 21:56:07 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* Used by the script engine to compare two instances of this type.
|
2015-10-29 21:56:07 +01:00
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 Cmp(const CVehicle & o) const;
|
2015-10-29 21:56:07 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* Used by the script engine to convert an instance of this type to a string.
|
2015-10-29 21:56:07 +01:00
|
|
|
*/
|
2016-03-10 04:57:13 +01:00
|
|
|
const String & ToString() const;
|
2015-10-29 21:56:07 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-03-10 04:57:13 +01:00
|
|
|
* Used by the script engine to retrieve the name from instances of this type.
|
2015-10-29 21:56:07 +01:00
|
|
|
*/
|
2016-03-10 04:57:13 +01:00
|
|
|
static SQInteger Typename(HSQUIRRELVM vm);
|
2015-10-29 21:56:07 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-03-10 04:57:13 +01:00
|
|
|
* Retrieve the identifier of the entity managed by this instance.
|
2015-10-29 21:56:07 +01:00
|
|
|
*/
|
2016-03-10 04:57:13 +01:00
|
|
|
Int32 GetID() const
|
|
|
|
{
|
|
|
|
return m_ID;
|
|
|
|
}
|
2015-10-29 21:56:07 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* Check whether this instance manages a valid entity.
|
2015-10-29 21:56:07 +01:00
|
|
|
*/
|
2016-03-10 04:57:13 +01:00
|
|
|
bool IsActive() const
|
|
|
|
{
|
|
|
|
return VALID_ENTITY(m_ID);
|
|
|
|
}
|
2015-10-29 21:56:07 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* Retrieve the associated user tag.
|
2015-10-29 21:56:07 +01:00
|
|
|
*/
|
2016-03-10 04:57:13 +01:00
|
|
|
const String & GetTag() const;
|
2015-10-29 21:56:07 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* Modify the associated user tag.
|
2015-10-29 21:56:07 +01:00
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetTag(CSStr tag);
|
2015-10-29 21:56:07 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* Retrieve the associated user data.
|
2015-10-29 21:56:07 +01:00
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Object & GetData();
|
2015-10-29 21:56:07 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* Modify the associated user data.
|
2015-10-29 21:56:07 +01:00
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetData(Object & data);
|
2015-10-29 21:56:07 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Destroy the managed vehicle entity.
|
|
|
|
*/
|
|
|
|
bool Destroy()
|
|
|
|
{
|
|
|
|
return Destroy(0, NullObject());
|
|
|
|
}
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Destroy the managed vehicle entity.
|
|
|
|
*/
|
|
|
|
bool Destroy(Int32 header)
|
|
|
|
{
|
|
|
|
return Destroy(header, NullObject());
|
|
|
|
}
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Destroy the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
bool Destroy(Int32 header, Object & payload);
|
2015-10-29 21:56:07 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Bind to an event supported by this entity type.
|
|
|
|
*/
|
|
|
|
void BindEvent(Int32 evid, Object & env, Function & func) const;
|
2015-10-29 21:56:07 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* See if the managed vehicle entity is streamed for the specified player.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
bool IsStreamedFor(CPlayer & player) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the synchronization source of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 GetSyncSource() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the synchronization type of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 GetSyncType() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the world in which the managed vehicle entity exists.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 GetWorld() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the world in which the managed vehicle entity exists.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetWorld(Int32 world) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the vehicle model of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 GetModel() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the slot occupant from the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Object & GetOccupant(Int32 slot) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the slot occupant identifier from the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 GetOccupantID(Int32 slot) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Respawn the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void Respawn() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the immunity flags of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 GetImmunity() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the immunity flags of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetImmunity(Int32 flags) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* See whether the managed vehicle entity is wrecked.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
bool IsWrecked() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the position of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
const Vector3 & GetPosition() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the position of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetPosition(const Vector3 & pos) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the position of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetPositionEx(const Vector3 & pos, bool empty) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the position of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetPositionEx(Float32 x, Float32 y, Float32 z) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the position of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetPositionEx(Float32 x, Float32 y, Float32 z, bool empty) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the rotation of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
const Quaternion & GetRotation() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the rotation of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetRotation(const Quaternion & rot) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the rotation of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetRotationEx(Float32 x, Float32 y, Float32 z, Float32 w) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the euler rotation of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
const Vector3 & GetRotationEuler() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the euler rotation of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetRotationEuler(const Vector3 & rot) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the euler rotation of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetRotationEulerEx(Float32 x, Float32 y, Float32 z) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the speed of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
const Vector3 & GetSpeed() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the speed of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetSpeed(const Vector3 & vel) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the speed of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetSpeedEx(Float32 x, Float32 y, Float32 z) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the speed of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void AddSpeed(const Vector3 & vel) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the speed of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void AddSpeedEx(Float32 x, Float32 y, Float32 z) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the relative speed of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
const Vector3 & GetRelSpeed() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the relative speed of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetRelSpeed(const Vector3 & vel) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the relative speed of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetRelSpeedEx(Float32 x, Float32 y, Float32 z) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the relative speed of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void AddRelSpeed(const Vector3 & vel) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the relative speed of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void AddRelSpeedEx(Float32 x, Float32 y, Float32 z) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the turn speed of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
const Vector3 & GetTurnSpeed() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the turn speed of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetTurnSpeed(const Vector3 & vel) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the turn speed of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetTurnSpeedEx(Float32 x, Float32 y, Float32 z) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the turn speed of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void AddTurnSpeed(const Vector3 & vel) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the turn speed of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void AddTurnSpeedEx(Float32 x, Float32 y, Float32 z) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the relative turn speed of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
const Vector3 & GetRelTurnSpeed() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the relative turn speed of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetRelTurnSpeed(const Vector3 & vel) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the relative turn speed of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetRelTurnSpeedEx(Float32 x, Float32 y, Float32 z) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the relative turn speed of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void AddRelTurnSpeed(const Vector3 & vel) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the relative turn speed of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void AddRelTurnSpeedEx(Float32 x, Float32 y, Float32 z) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the spawn position of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
const Vector4 & GetSpawnPosition() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the spawn position of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetSpawnPosition(const Vector4 & pos) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the spawn position of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetSpawnPositionEx(Float32 x, Float32 y, Float32 z, Float32 w) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the spawn rotation of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
const Quaternion & GetSpawnRotation() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the spawn rotation of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetSpawnRotation(const Quaternion & rot) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the spawn rotation of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetSpawnRotationEx(Float32 x, Float32 y, Float32 z, Float32 w) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the euler spawn rotation of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
const Vector3 & GetSpawnRotationEuler() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the euler spawn rotation of the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetSpawnRotationEuler(const Vector3 & rot) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the euler spawn rotation of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetSpawnRotationEulerEx(Float32 x, Float32 y, Float32 z) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the respawn timer of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Uint32 GetRespawnTimer() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the respawn timer of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetRespawnTimer(Uint32 timer) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the health of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 GetHealth() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the health of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetHealth(Float32 amount) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the primary color of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 GetPrimaryColor() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the primary color of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetPrimaryColor(Int32 col) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the secondary color of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 GetSecondaryColor() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the secondary color of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetSecondaryColor(Int32 col) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the primary and secondary colors of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetColors(Int32 primary, Int32 secondary) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* See whether the managed vehicle entity is locked.
|
|
|
|
*/
|
2015-11-11 09:56:02 +01:00
|
|
|
bool GetLocked() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Set whether the managed vehicle entity is locked.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetLocked(bool toggle) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the part status of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 GetPartStatus(Int32 part) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the part status of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetPartStatus(Int32 part, Int32 status) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the tyre status of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 GetTyreStatus(Int32 tyre) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the tyre status of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetTyreStatus(Int32 tyre, Int32 status) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the damage data of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Uint32 GetDamageData() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the damage data of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetDamageData(Uint32 data) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* See whether the managed vehicle entity has alarm.
|
|
|
|
*/
|
2015-11-11 09:56:02 +01:00
|
|
|
bool GetAlarm() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Set whether the managed vehicle entity has alarm.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetAlarm(bool toggle) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* See whether the managed vehicle entity has lights.
|
|
|
|
*/
|
2015-11-11 09:56:02 +01:00
|
|
|
bool GetLights() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Set whether the managed vehicle entity has lights.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetLights(bool toggle) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the radio of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 GetRadio() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the radio of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetRadio(Int32 radio) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* See whether the managed vehicle entity has radio locked.
|
|
|
|
*/
|
2015-11-11 09:56:02 +01:00
|
|
|
bool GetRadioLocked() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Set whether the managed vehicle entity has radio locked.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetRadioLocked(bool toggle) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* See whether the managed vehicle entity is in ghost state.
|
|
|
|
*/
|
2015-11-11 09:56:02 +01:00
|
|
|
bool GetGhostState() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Set whether the managed vehicle entity is in ghost state.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetGhostState(bool toggle) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Reset all the handling rules for the managed vehicle entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void ResetHandling() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Reset the specified handling rule for the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void ResetHandling(Int32 rule) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* See whether the specified handling ruleexists in the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
bool ExistsHandling(Int32 rule) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the handling data of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 GetHandlingData(Int32 rule) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the handling data of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetHandlingData(Int32 rule, Float32 data) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Embark the specified player entity into the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void Embark(CPlayer & player) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Embark the specified player entity into the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void Embark(CPlayer & player, Int32 slot, bool allocate, bool warp) const;
|
2015-10-29 21:56:07 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the position on the x axis of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 GetPosX() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the position on the y axis of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 GetPosY() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the position on the z axis of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 GetPosZ() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the position on the x axis of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetPosX(Float32 x) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the position on the y axis of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetPosY(Float32 y) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the position on the z axis of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetPosZ(Float32 z) const;
|
2015-10-29 21:56:07 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the rotation on the x axis of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 GetRotX() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the rotation on the y axis of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 GetRotY() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the rotation on the z axis of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 GetRotZ() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the rotation amount of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 GetRotW() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the rotation on the x axis of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetRotX(Float32 x) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the rotation on the y axis of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetRotY(Float32 y) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the rotation on the z axis of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetRotZ(Float32 z) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the rotation amount of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetRotW(Float32 w) const;
|
2015-10-29 21:56:07 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the euler rotation on the x axis of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 GetERotX() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the euler rotation on the y axis of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 GetERotY() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the euler rotation on the z axis of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 GetERotZ() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the euler rotation on the x axis of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetERotX(Float32 x) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the euler rotation on the y axis of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetERotY(Float32 y) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the euler rotation on the z axis of the managed vehicle entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetERotZ(Float32 z) const;
|
2015-09-30 02:56:11 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // Namespace:: SqMod
|
|
|
|
|
2016-02-20 23:25:00 +01:00
|
|
|
#endif // _ENTITY_VEHICLE_HPP_
|