2015-11-11 07:57:26 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-09-30 02:56:11 +02:00
|
|
|
#include "Entity/Object.hpp"
|
2016-02-20 23:25:00 +01:00
|
|
|
#include "Entity/Player.hpp"
|
2015-10-29 21:10:36 +01:00
|
|
|
#include "Base/Quaternion.hpp"
|
2016-02-20 23:25:00 +01:00
|
|
|
#include "Base/Vector3.hpp"
|
2015-11-01 00:31:57 +01:00
|
|
|
#include "Core.hpp"
|
2015-09-30 02:56:11 +02:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
namespace SqMod {
|
|
|
|
|
2015-10-29 21:10:36 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Vector3 CObject::s_Vector3;
|
|
|
|
Quaternion CObject::s_Quaternion;
|
|
|
|
|
2015-11-01 00:31:57 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-03-10 04:57:13 +01:00
|
|
|
const Int32 CObject::Max = SQMOD_OBJECT_POOL;
|
2016-02-20 23:25:00 +01:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-03-10 04:57:13 +01:00
|
|
|
SQInteger CObject::Typename(HSQUIRRELVM vm)
|
|
|
|
{
|
|
|
|
static SQChar name[] = _SC("SqObject");
|
|
|
|
sq_pushstring(vm, name, sizeof(name));
|
|
|
|
return 1;
|
|
|
|
}
|
2016-02-20 23:25:00 +01:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
CObject::CObject(Int32 id)
|
|
|
|
: m_ID(VALID_ENTITYGETEX(id, SQMOD_OBJECT_POOL))
|
2016-03-10 04:57:13 +01:00
|
|
|
, m_Tag(ToStrF("%d", id))
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
|
|
|
/* ... */
|
|
|
|
}
|
2015-10-29 21:10:36 +01:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
CObject::~CObject()
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-02-20 23:25:00 +01:00
|
|
|
/* ... */
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 CObject::Cmp(const CObject & o) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-02-20 23:25:00 +01:00
|
|
|
if (m_ID == o.m_ID)
|
|
|
|
return 0;
|
|
|
|
else if (m_ID > o.m_ID)
|
|
|
|
return 1;
|
2015-10-29 21:10:36 +01:00
|
|
|
else
|
2016-02-20 23:25:00 +01:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
const String & CObject::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:10:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-03-10 04:57:13 +01:00
|
|
|
const String & CObject::GetTag() const
|
2015-10-29 21:10:36 +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:10:36 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CObject::SetTag(CSStr tag)
|
|
|
|
{
|
|
|
|
m_Tag.assign(tag);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Object & CObject::GetData()
|
2015-10-29 21:10:36 +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:10:36 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CObject::SetData(Object & data)
|
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Apply the specified value
|
|
|
|
m_Data = data;
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
bool CObject::Destroy(Int32 header, Object & payload)
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
2016-02-20 23:25:00 +01:00
|
|
|
return _Core->DelObject(m_ID, header, payload);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-03-10 04:57:13 +01:00
|
|
|
void CObject::BindEvent(Int32 evid, Object & env, Function & func) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Obtain the function instance called for this event
|
2016-02-20 23:25:00 +01:00
|
|
|
Function & event = _Core->GetObjectEvent(m_ID, evid);
|
2016-03-10 04:57:13 +01:00
|
|
|
// Is the specified callback function null?
|
2016-02-20 23:25:00 +01:00
|
|
|
if (func.IsNull())
|
2016-03-12 21:51:44 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
event.Release(); // Then release the current callback
|
2016-03-12 21:51:44 +01:00
|
|
|
}
|
2016-03-10 04:57:13 +01:00
|
|
|
// Assign the specified environment and function
|
2015-10-29 21:10:36 +01:00
|
|
|
else
|
2016-03-12 21:51:44 +01:00
|
|
|
{
|
2016-02-20 23:25:00 +01:00
|
|
|
event = Function(env.GetVM(), env, func.GetFunc());
|
2016-03-12 21:51:44 +01:00
|
|
|
}
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
bool CObject::IsStreamedFor(CPlayer & player) const
|
2015-10-29 21:10:36 +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->IsObjectStreamedForPlayer(m_ID, player.GetID());
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 CObject::GetModel() const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return _Func->GetObjectModel(m_ID);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 CObject::GetWorld() const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return _Func->GetObjectWorld(m_ID);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CObject::SetWorld(Int32 world) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->SetObjectWorld(m_ID, world);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 CObject::GetAlpha() const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return _Func->GetObjectAlpha(m_ID);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CObject::SetAlpha(Int32 alpha) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->SetObjectAlpha(m_ID, alpha, 0);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CObject::SetAlphaEx(Int32 alpha, Int32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->SetObjectAlpha(m_ID, alpha, time);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CObject::MoveTo(const Vector3 & pos, Int32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->MoveObjectTo(m_ID, pos.x, pos.y, pos.z, time);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CObject::MoveToEx(Float32 x, Float32 y, Float32 z, Int32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->MoveObjectTo(m_ID, x, y, z, time);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CObject::MoveBy(const Vector3 & pos, Int32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->MoveObjectBy(m_ID, pos.x, pos.y, pos.z, time);
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CObject::MoveByEx(Float32 x, Float32 y, Float32 z, Int32 time) const
|
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->MoveObjectBy(m_ID, x, y, z, time);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
const Vector3 & CObject::GetPosition()
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous position information
|
2015-10-29 21:10:36 +01:00
|
|
|
s_Vector3.Clear();
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the position values
|
|
|
|
_Func->GetObjectPos(m_ID, &s_Vector3.x, &s_Vector3.y, &s_Vector3.z);
|
|
|
|
// Return the requested information
|
2015-10-29 21:10:36 +01:00
|
|
|
return s_Vector3;
|
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::SetPosition(const Vector3 & pos) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->SetObjectPos(m_ID, pos.x, pos.y, pos.z);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CObject::SetPositionEx(Float32 x, Float32 y, Float32 z) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->SetObjectPos(m_ID, x, y, z);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CObject::RotateTo(const Quaternion & rot, Int32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->RotObjectTo(m_ID, rot.x, rot.y, rot.z, rot.w, time);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CObject::RotateToEx(Float32 x, Float32 y, Float32 z, Float32 w, Int32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->RotObjectTo(m_ID, x, y, z, w, time);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CObject::RotateToEuler(const Vector3 & rot, Int32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->RotObjectToEuler(m_ID, rot.x, rot.y, rot.z, time);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CObject::RotateToEulerEx(Float32 x, Float32 y, Float32 z, Int32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->RotObjectToEuler(m_ID, x, y, z, time);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CObject::RotateBy(const Quaternion & rot, Int32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->RotObjectBy(m_ID, rot.x, rot.y, rot.z, rot.w, time);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CObject::RotateByEx(Float32 x, Float32 y, Float32 z, Float32 w, Int32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->RotObjectBy(m_ID, x, y, z, w, time);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CObject::RotateByEuler(const Vector3 & rot, Int32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->RotObjectByEuler(m_ID, rot.x, rot.y, rot.z, time);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CObject::RotateByEulerEx(Float32 x, Float32 y, Float32 z, Int32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->RotObjectByEuler(m_ID, x, y, z, time);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
const Quaternion & CObject::GetRotation()
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous rotation information
|
2015-10-29 21:10:36 +01:00
|
|
|
s_Quaternion.Clear();
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the rotation values
|
|
|
|
_Func->GetObjectRot(m_ID, &s_Quaternion.x, &s_Quaternion.y, &s_Quaternion.z, &s_Quaternion.w);
|
|
|
|
// Return the requested information
|
2015-10-29 21:10:36 +01:00
|
|
|
return s_Quaternion;
|
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
const Vector3 & CObject::GetRotationEuler()
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous rotation information
|
2015-10-29 21:10:36 +01:00
|
|
|
s_Vector3.Clear();
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the rotation values
|
|
|
|
_Func->GetObjectRotEuler(m_ID, &s_Vector3.x, &s_Vector3.y, &s_Vector3.z);
|
|
|
|
// Return the requested information
|
2015-10-29 21:10:36 +01:00
|
|
|
return s_Vector3;
|
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
bool CObject::GetShotReport() const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return _Func->IsObjectShotReport(m_ID);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::SetShotReport(bool toggle) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->SetObjectShotReport(m_ID, toggle);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
bool CObject::GetBumpReport() const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Return the requested information
|
|
|
|
return _Func->IsObjectBumpReport(m_ID);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::SetBumpReport(bool toggle) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->SetObjectBumpReport(m_ID, toggle);
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
2015-11-01 00:31:57 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 CObject::GetPosX() const
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous position information, if any
|
2016-02-20 23:25:00 +01:00
|
|
|
s_Vector3.x = 0;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested component value
|
|
|
|
_Func->GetObjectPos(m_ID, &s_Vector3.x, NULL, NULL);
|
|
|
|
// Return the requested information
|
2016-02-20 23:25:00 +01:00
|
|
|
return s_Vector3.x;
|
2015-11-01 00:31:57 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 CObject::GetPosY() const
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous position information, if any
|
2016-02-20 23:25:00 +01:00
|
|
|
s_Vector3.y = 0;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested component value
|
|
|
|
_Func->GetObjectPos(m_ID, NULL, &s_Vector3.y, NULL);
|
|
|
|
// Return the requested information
|
2016-02-20 23:25:00 +01:00
|
|
|
return s_Vector3.y;
|
2015-11-01 00:31:57 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 CObject::GetPosZ() const
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous position information, if any
|
2016-02-20 23:25:00 +01:00
|
|
|
s_Vector3.z = 0;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested component value
|
|
|
|
_Func->GetObjectPos(m_ID, NULL, NULL, &s_Vector3.z);
|
|
|
|
// Return the requested information
|
2016-02-20 23:25:00 +01:00
|
|
|
return s_Vector3.z;
|
2015-11-01 00:31:57 +01:00
|
|
|
}
|
|
|
|
|
2016-02-20 23:25:00 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void CObject::SetPosX(Float32 x) const
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Retrieve the current values for unchanged components
|
|
|
|
_Func->GetObjectPos(m_ID, NULL, &s_Vector3.y, &s_Vector3.z);
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->SetObjectPos(m_ID, x, s_Vector3.y, s_Vector3.z);
|
2015-11-01 00:31:57 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CObject::SetPosY(Float32 y) const
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Retrieve the current values for unchanged components
|
|
|
|
_Func->GetObjectPos(m_ID, &s_Vector3.x, NULL, &s_Vector3.z);
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->SetObjectPos(m_ID, s_Vector3.x, y, s_Vector3.z);
|
2015-11-01 00:31:57 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
void CObject::SetPosZ(Float32 z) const
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Retrieve the current values for unchanged components
|
|
|
|
_Func->GetObjectPos(m_ID, &s_Vector3.x, &s_Vector3.y, NULL);
|
|
|
|
// Perform the requested operation
|
|
|
|
_Func->SetObjectPos(m_ID, s_Vector3.z, s_Vector3.y, z);
|
2015-11-01 00:31:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 CObject::GetRotX() const
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous rotation information, if any
|
2016-02-20 23:25:00 +01:00
|
|
|
s_Quaternion.x = 0;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested component value
|
|
|
|
_Func->GetObjectRot(m_ID, &s_Quaternion.x, NULL, NULL, NULL);
|
|
|
|
// Return the requested information
|
2016-02-20 23:25:00 +01:00
|
|
|
return s_Quaternion.x;
|
2015-11-01 00:31:57 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 CObject::GetRotY() const
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous rotation information, if any
|
2016-02-20 23:25:00 +01:00
|
|
|
s_Quaternion.y = 0;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested component value
|
|
|
|
_Func->GetObjectRot(m_ID, NULL, &s_Quaternion.y, NULL, NULL);
|
|
|
|
// Return the requested information
|
2016-02-20 23:25:00 +01:00
|
|
|
return s_Quaternion.y;
|
2015-11-01 00:31:57 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 CObject::GetRotZ() const
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous rotation information, if any
|
2016-02-20 23:25:00 +01:00
|
|
|
s_Quaternion.z = 0;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested component value
|
|
|
|
_Func->GetObjectRot(m_ID, NULL, NULL, &s_Quaternion.z, NULL);
|
|
|
|
// Return the requested information
|
2016-02-20 23:25:00 +01:00
|
|
|
return s_Quaternion.z;
|
2015-11-01 00:31:57 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 CObject::GetRotW() const
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous rotation information, if any
|
2016-02-20 23:25:00 +01:00
|
|
|
s_Quaternion.w = 0;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested component value
|
|
|
|
_Func->GetObjectRot(m_ID, NULL, NULL, NULL, &s_Quaternion.w);
|
|
|
|
// Return the requested information
|
2016-02-20 23:25:00 +01:00
|
|
|
return s_Quaternion.w;
|
2015-11-01 00:31:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 CObject::GetERotX() const
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous rotation information, if any
|
2016-02-20 23:25:00 +01:00
|
|
|
s_Vector3.x = 0;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested component value
|
|
|
|
_Func->GetObjectRotEuler(m_ID, &s_Vector3.x, NULL, NULL);
|
|
|
|
// Return the requested information
|
2016-02-20 23:25:00 +01:00
|
|
|
return s_Vector3.x;
|
2015-11-01 00:31:57 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 CObject::GetERotY() const
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous rotation information, if any
|
2016-02-20 23:25:00 +01:00
|
|
|
s_Vector3.y = 0;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested component value
|
|
|
|
_Func->GetObjectRotEuler(m_ID, NULL, &s_Vector3.y, NULL);
|
|
|
|
// Return the requested information
|
2016-02-20 23:25:00 +01:00
|
|
|
return s_Vector3.y;
|
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 CObject::GetERotZ() const
|
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
// Validate the managed identifier
|
|
|
|
Validate();
|
|
|
|
// Clear previous rotation information, if any
|
2016-02-20 23:25:00 +01:00
|
|
|
s_Vector3.z = 0;
|
2016-03-10 04:57:13 +01:00
|
|
|
// Query the server for the requested component value
|
|
|
|
_Func->GetObjectRotEuler(m_ID, NULL, NULL, &s_Vector3.z);
|
|
|
|
// Return the requested information
|
2016-02-20 23:25:00 +01:00
|
|
|
return s_Vector3.z;
|
2015-11-01 00:31:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-03-10 04:57:13 +01:00
|
|
|
static Object & Object_CreateEx(Int32 model, Int32 world, Float32 x, Float32 y, Float32 z,
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 alpha)
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
2016-02-20 23:25:00 +01:00
|
|
|
return _Core->NewObject(model, world, x, y, z, alpha, SQMOD_CREATE_DEFAULT, NullObject());
|
2015-11-01 00:31:57 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
static Object & Object_CreateEx(Int32 model, Int32 world, Float32 x, Float32 y, Float32 z,
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 alpha, Int32 header, Object & payload)
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
2016-02-20 23:25:00 +01:00
|
|
|
return _Core->NewObject(model, world, x, y, z, alpha, header, payload);
|
2015-11-01 00:31:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-03-10 04:57:13 +01:00
|
|
|
static Object & Object_Create(Int32 model, Int32 world, const Vector3 & pos, Int32 alpha)
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
|
|
|
return _Core->NewObject(model, world, pos.x, pos.y, pos.z, alpha,
|
2016-02-20 23:25:00 +01:00
|
|
|
SQMOD_CREATE_DEFAULT, NullObject());
|
2015-11-01 00:31:57 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
static Object & Object_Create(Int32 model, Int32 world, const Vector3 & pos, Int32 alpha,
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 header, Object & payload)
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
2016-02-20 23:25:00 +01:00
|
|
|
return _Core->NewObject(model, world, pos.x, pos.y, pos.z, alpha, header, payload);
|
2015-11-01 00:31:57 +01:00
|
|
|
}
|
|
|
|
|
2016-03-10 05:18:39 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
static const Object & Object_FindByID(Int32 id)
|
|
|
|
{
|
|
|
|
// Perform a range check on the specified identifier
|
|
|
|
if (INVALID_ENTITYEX(id, SQMOD_OBJECT_POOL))
|
2016-03-12 21:51:44 +01:00
|
|
|
{
|
2016-03-21 21:37:58 +01:00
|
|
|
STHROWF("The specified object identifier is invalid: %d", id);
|
2016-03-12 21:51:44 +01:00
|
|
|
}
|
2016-03-10 05:18:39 +01:00
|
|
|
// Obtain the ends of the entity pool
|
|
|
|
Core::Objects::const_iterator itr = _Core->GetObjects().cbegin();
|
|
|
|
Core::Objects::const_iterator end = _Core->GetObjects().cend();
|
|
|
|
// Process each entity in the pool
|
|
|
|
for (; itr != end; ++itr)
|
|
|
|
{
|
|
|
|
// Does the identifier match the specified one?
|
|
|
|
if (itr->mID == id)
|
2016-03-12 21:51:44 +01:00
|
|
|
{
|
2016-03-10 05:18:39 +01:00
|
|
|
return itr->mObj; // Stop searching and return this entity
|
2016-03-12 21:51:44 +01:00
|
|
|
}
|
2016-03-10 05:18:39 +01:00
|
|
|
}
|
|
|
|
// Unable to locate a object matching the specified identifier
|
|
|
|
return NullObject();
|
|
|
|
}
|
|
|
|
|
2016-03-26 17:16:58 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-03-10 05:18:39 +01:00
|
|
|
static const Object & Object_FindByTag(CSStr tag)
|
|
|
|
{
|
|
|
|
// Perform a validity check on the specified tag
|
2016-03-12 21:51:44 +01:00
|
|
|
if (!tag || *tag == '\0')
|
2016-03-21 21:37:58 +01:00
|
|
|
STHROWF("The specified object tag is invalid: null/empty");
|
2016-03-10 05:18:39 +01:00
|
|
|
// Obtain the ends of the entity pool
|
|
|
|
Core::Objects::const_iterator itr = _Core->GetObjects().cbegin();
|
|
|
|
Core::Objects::const_iterator end = _Core->GetObjects().cend();
|
|
|
|
// Process each entity in the pool
|
|
|
|
for (; itr != end; ++itr)
|
|
|
|
{
|
|
|
|
// Does this entity even exist and does the tag match the specified one?
|
|
|
|
if (itr->mInst != nullptr && itr->mInst->GetTag().compare(tag) == 0)
|
2016-03-12 21:51:44 +01:00
|
|
|
{
|
2016-03-10 05:18:39 +01:00
|
|
|
return itr->mObj; // Stop searching and return this entity
|
2016-03-12 21:51:44 +01:00
|
|
|
}
|
2016-03-10 05:18:39 +01:00
|
|
|
}
|
|
|
|
// Unable to locate a object matching the specified tag
|
|
|
|
return NullObject();
|
|
|
|
}
|
|
|
|
|
2016-03-26 17:16:58 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
static Array Object_FindActive()
|
|
|
|
{
|
|
|
|
// Remember the initial stack size
|
|
|
|
StackGuard sg;
|
|
|
|
// Obtain the ends of the entity pool
|
|
|
|
Core::Objects::const_iterator itr = _Core->GetObjects().cbegin();
|
|
|
|
Core::Objects::const_iterator end = _Core->GetObjects().cend();
|
|
|
|
// Allocate an empty array on the stack
|
|
|
|
sq_newarray(DefaultVM::Get(), 0);
|
|
|
|
// Process each entity in the pool
|
|
|
|
for (; itr != end; ++itr)
|
|
|
|
{
|
|
|
|
// Is this entity instance active?
|
|
|
|
if (VALID_ENTITY(itr->mID))
|
|
|
|
{
|
|
|
|
// Push the script object on the stack
|
|
|
|
sq_pushobject(DefaultVM::Get(), (HSQOBJECT &)((*itr).mObj));
|
|
|
|
// Append the object at the back of the array
|
|
|
|
if (SQ_FAILED(sq_arrayappend(DefaultVM::Get(), -1)))
|
|
|
|
{
|
|
|
|
STHROWF("Unable to append entity instance to the list");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Return the array at the top of the stack
|
|
|
|
return Var< Array >(DefaultVM::Get(), -1).value;
|
|
|
|
}
|
|
|
|
|
2015-10-29 21:10:36 +01:00
|
|
|
// ================================================================================================
|
2016-02-20 23:25:00 +01:00
|
|
|
void Register_CObject(HSQUIRRELVM vm)
|
|
|
|
{
|
|
|
|
RootTable(vm).Bind(_SC("SqObject"),
|
|
|
|
Class< CObject, NoConstructor< CObject > >(vm, _SC("SqObject"))
|
2016-03-10 04:57:13 +01:00
|
|
|
// Metamethods
|
2016-02-20 23:25:00 +01:00
|
|
|
.Func(_SC("_cmp"), &CObject::Cmp)
|
2016-03-10 04:57:13 +01:00
|
|
|
.SquirrelFunc(_SC("_typename"), &CObject::Typename)
|
2016-02-20 23:25:00 +01:00
|
|
|
.Func(_SC("_tostring"), &CObject::ToString)
|
2016-03-10 05:18:39 +01:00
|
|
|
// Static Values
|
2016-03-10 04:57:13 +01:00
|
|
|
.SetStaticValue(_SC("MaxID"), CObject::Max)
|
|
|
|
// Core Properties
|
2016-02-20 23:25:00 +01:00
|
|
|
.Prop(_SC("ID"), &CObject::GetID)
|
|
|
|
.Prop(_SC("Tag"), &CObject::GetTag, &CObject::SetTag)
|
|
|
|
.Prop(_SC("Data"), &CObject::GetData, &CObject::SetData)
|
|
|
|
.Prop(_SC("Active"), &CObject::IsActive)
|
2016-03-10 05:18:39 +01:00
|
|
|
// Core Methods
|
2016-02-20 23:25:00 +01:00
|
|
|
.Func(_SC("Bind"), &CObject::BindEvent)
|
2016-03-10 04:57:13 +01:00
|
|
|
// Core Overloads
|
2016-02-20 23:25:00 +01:00
|
|
|
.Overload< bool (CObject::*)(void) >(_SC("Destroy"), &CObject::Destroy)
|
|
|
|
.Overload< bool (CObject::*)(Int32) >(_SC("Destroy"), &CObject::Destroy)
|
|
|
|
.Overload< bool (CObject::*)(Int32, Object &) >(_SC("Destroy"), &CObject::Destroy)
|
2016-03-10 04:57:13 +01:00
|
|
|
// Properties
|
2016-02-20 23:25:00 +01:00
|
|
|
.Prop(_SC("Model"), &CObject::GetModel)
|
|
|
|
.Prop(_SC("World"), &CObject::GetWorld, &CObject::SetWorld)
|
|
|
|
.Prop(_SC("Alpha"), &CObject::GetAlpha, &CObject::SetAlpha)
|
|
|
|
.Prop(_SC("Pos"), &CObject::GetPosition, &CObject::SetPosition)
|
|
|
|
.Prop(_SC("Position"), &CObject::GetPosition, &CObject::SetPosition)
|
|
|
|
.Prop(_SC("ERot"), &CObject::GetRotation)
|
|
|
|
.Prop(_SC("Rotation"), &CObject::GetRotation)
|
|
|
|
.Prop(_SC("RotationEuler"), &CObject::GetRotationEuler)
|
|
|
|
.Prop(_SC("ShotReport"), &CObject::GetShotReport, &CObject::SetShotReport)
|
|
|
|
.Prop(_SC("BumpReport"), &CObject::GetBumpReport, &CObject::SetBumpReport)
|
|
|
|
.Prop(_SC("X"), &CObject::GetPosX, &CObject::SetPosX)
|
|
|
|
.Prop(_SC("Y"), &CObject::GetPosY, &CObject::SetPosY)
|
|
|
|
.Prop(_SC("Z"), &CObject::GetPosZ, &CObject::SetPosZ)
|
|
|
|
.Prop(_SC("RX"), &CObject::GetRotX)
|
|
|
|
.Prop(_SC("RY"), &CObject::GetRotY)
|
|
|
|
.Prop(_SC("RZ"), &CObject::GetRotZ)
|
|
|
|
.Prop(_SC("RW"), &CObject::GetRotW)
|
|
|
|
.Prop(_SC("EX"), &CObject::GetERotX)
|
|
|
|
.Prop(_SC("EY"), &CObject::GetERotY)
|
|
|
|
.Prop(_SC("EZ"), &CObject::GetERotZ)
|
2016-03-10 05:18:39 +01:00
|
|
|
// Member Methods
|
2016-02-20 23:25:00 +01:00
|
|
|
.Func(_SC("StreamedFor"), &CObject::IsStreamedFor)
|
|
|
|
.Func(_SC("SetAlpha"), &CObject::SetAlphaEx)
|
|
|
|
.Func(_SC("SetPosition"), &CObject::SetPositionEx)
|
2016-03-10 05:18:39 +01:00
|
|
|
// Member Overloads
|
2016-02-20 23:25:00 +01:00
|
|
|
.Overload< void (CObject::*)(const Vector3 &, Int32) const >
|
|
|
|
(_SC("MoveTo"), &CObject::MoveTo)
|
|
|
|
.Overload< void (CObject::*)(Float32, Float32, Float32, Int32) const >
|
|
|
|
(_SC("MoveTo"), &CObject::MoveToEx)
|
|
|
|
.Overload< void (CObject::*)(const Vector3 &, Int32) const >
|
|
|
|
(_SC("MoveBy"), &CObject::MoveBy)
|
|
|
|
.Overload< void (CObject::*)(Float32, Float32, Float32, Int32) const >
|
|
|
|
(_SC("MoveBy"), &CObject::MoveByEx)
|
|
|
|
.Overload< void (CObject::*)(const Quaternion &, Int32) const >
|
|
|
|
(_SC("RotateTo"), &CObject::RotateTo)
|
|
|
|
.Overload< void (CObject::*)(Float32, Float32, Float32, Float32, Int32) const >
|
|
|
|
(_SC("RotateTo"), &CObject::RotateToEx)
|
|
|
|
.Overload< void (CObject::*)(const Vector3 &, Int32) const >
|
|
|
|
(_SC("RotateToEuler"), &CObject::RotateToEuler)
|
|
|
|
.Overload< void (CObject::*)(Float32, Float32, Float32, Int32) const >
|
|
|
|
(_SC("RotateToEuler"), &CObject::RotateToEulerEx)
|
|
|
|
.Overload< void (CObject::*)(const Quaternion &, Int32) const >
|
|
|
|
(_SC("RotateBy"), &CObject::RotateBy)
|
|
|
|
.Overload< void (CObject::*)(Float32, Float32, Float32, Float32, Int32) const >
|
|
|
|
(_SC("RotateBy"), &CObject::RotateByEx)
|
|
|
|
.Overload< void (CObject::*)(const Vector3 &, Int32) const >
|
|
|
|
(_SC("RotateByEuler"), &CObject::RotateByEuler)
|
|
|
|
.Overload< void (CObject::*)(Float32, Float32, Float32, Int32) const >
|
|
|
|
(_SC("RotateByEuler"), &CObject::RotateByEulerEx)
|
2016-03-10 05:18:39 +01:00
|
|
|
// Static Functions
|
|
|
|
.StaticFunc(_SC("FindByID"), &Object_FindByID)
|
|
|
|
.StaticFunc(_SC("FindByTag"), &Object_FindByTag)
|
2016-03-26 17:16:58 +01:00
|
|
|
.StaticFunc(_SC("FindActive"), &Object_FindActive)
|
2016-03-10 04:57:13 +01:00
|
|
|
// Static Overloads
|
|
|
|
.StaticOverload< Object & (*)(Int32, Int32, Float32, Float32, Float32, Int32) >
|
|
|
|
(_SC("CreateEx"), &Object_CreateEx)
|
|
|
|
.StaticOverload< Object & (*)(Int32, Int32, Float32, Float32, Float32, Int32, Int32, Object &) >
|
|
|
|
(_SC("CreateEx"), &Object_CreateEx)
|
|
|
|
.StaticOverload< Object & (*)(Int32, Int32, const Vector3 &, Int32) >
|
|
|
|
(_SC("Create"), &Object_Create)
|
|
|
|
.StaticOverload< Object & (*)(Int32, Int32, const Vector3 &, Int32, Int32, Object &) >
|
|
|
|
(_SC("Create"), &Object_Create)
|
2015-09-30 02:56:11 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
} // Namespace:: SqMod
|