2015-11-11 07:57:26 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-09-30 02:56:11 +02:00
|
|
|
#include "Entity/Object.hpp"
|
2015-10-29 21:10:36 +01:00
|
|
|
#include "Base/Quaternion.hpp"
|
|
|
|
#include "Misc/Model.hpp"
|
2015-11-01 00:31:57 +01:00
|
|
|
#include "Core.hpp"
|
2015-09-30 02:56:11 +02:00
|
|
|
#include "Register.hpp"
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
namespace SqMod {
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-10-29 21:10:36 +01:00
|
|
|
CModel CObject::s_Model;
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Vector3 CObject::s_Vector3;
|
|
|
|
Quaternion CObject::s_Quaternion;
|
|
|
|
|
2015-11-01 00:31:57 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
CObject::CObject(const Reference< CObject > & o)
|
2015-11-01 00:31:57 +01:00
|
|
|
: Reference(o)
|
|
|
|
{
|
|
|
|
/* ... */
|
|
|
|
}
|
2015-10-29 21:10:36 +01:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
bool CObject::IsStreamedFor(const Reference< CPlayer > & player) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID) && player)
|
|
|
|
{
|
|
|
|
return _Func->IsObjectStreamedForPlayer(m_ID, player);
|
|
|
|
}
|
|
|
|
else if (!player)
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadArg("streamed_for", "see whether is streamed for player", _SCI32(player));
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("streamed_for", "see whether is streamed for player");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
const CModel & CObject::GetModel() const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
// Clear any previous model
|
|
|
|
s_Model.SetID(SQMOD_UNKNOWN);
|
|
|
|
// Attempt to retrieve the model
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
s_Model.SetID(_Func->GetObjectModel(m_ID));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("@model", "get model");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
// Return the model that could be retrieved
|
|
|
|
return s_Model;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
SQInt32 CObject::GetModelID() const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
return _Func->GetObjectModel(m_ID);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("@model_id", "get model id");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return SQMOD_UNKNOWN;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
SQInt32 CObject::GetWorld() const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
return _Func->GetObjectWorld(m_ID);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("@world", "get world");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return SQMOD_UNKNOWN;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::SetWorld(SQInt32 world) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->SetObjectWorld(m_ID, world);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("@world", "set world");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
SQInt32 CObject::GetAlpha() const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
return _Func->GetObjectAlpha(m_ID);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("@alpha", "get alpha");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return SQMOD_UNKNOWN;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::SetAlpha(SQInt32 alpha) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->SetObjectAlpha(m_ID, alpha, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("@alpha", "set alpha");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::SetAlphaEx(SQInt32 alpha, SQInt32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->SetObjectAlpha(m_ID, alpha, time);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("set_alpha", "set alpha");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::MoveToPr(const Vector3 & pos) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->MoveObjectTo(m_ID, pos.x, pos.y, pos.z, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("@mov_to", "move to");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::MoveTo(const Vector3 & pos, SQInt32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->MoveObjectTo(m_ID, pos.x, pos.y, pos.z, time);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("move_to", "move to");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::MoveToEx(SQFloat x, SQFloat y, SQFloat z) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->MoveObjectTo(m_ID, x, y, z, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("move_to", "move to");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::MoveToEx(SQFloat x, SQFloat y, SQFloat z, SQInt32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->MoveObjectTo(m_ID, x, y, z, time);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("move_to", "move to");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::MoveByPr(const Vector3 & pos) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->MoveObjectBy(m_ID, pos.x, pos.y, pos.z, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("@mov_by", "move by");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::MoveBy(const Vector3 & pos, SQInt32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->MoveObjectBy(m_ID, pos.x, pos.y, pos.z, time);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("move_by", "move by");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::MoveByEx(SQFloat x, SQFloat y, SQFloat z) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->MoveObjectBy(m_ID, x, y, z, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("move_by", "move by");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::MoveByEx(SQFloat x, SQFloat y, SQFloat z, SQInt32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->MoveObjectBy(m_ID, x, y, z, time);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("move_by", "move by");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
const Vector3 & CObject::GetPosition()
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
// Clear any previous position
|
|
|
|
s_Vector3.Clear();
|
|
|
|
// Attempt to retrieve the position
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->GetObjectPos(m_ID, &s_Vector3.x, &s_Vector3.y, &s_Vector3.z);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("@position", "get position");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
// Return the position that could be retrieved
|
|
|
|
return s_Vector3;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::SetPosition(const Vector3 & pos) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->SetObjectPos(m_ID, pos.x, pos.y, pos.z);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("@position", "set position");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::SetPositionEx(SQFloat x, SQFloat y, SQFloat z) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->SetObjectPos(m_ID, x, y, z);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("set_position", "set position");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::RotateToPr(const Quaternion & rot) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->RotObjectTo(m_ID, rot.x, rot.y, rot.z, rot.w, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("@rot_to", "rotate to quaternion");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::RotateTo(const Quaternion & rot, SQInt32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->RotObjectTo(m_ID, rot.x, rot.y, rot.z, rot.w, time);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("rotate_to", "rotate to quaternion");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::RotateToEx(SQFloat x, SQFloat y, SQFloat z, SQFloat w) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->RotObjectTo(m_ID, x, y, z, w, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("rotate_to", "rotate to quaternion");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::RotateToEx(SQFloat x, SQFloat y, SQFloat z, SQFloat w, SQInt32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->RotObjectTo(m_ID, x, y, z, w, time);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("rotate_to", "rotate to quaternion");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::RotateToEulerPr(const Vector3 & rot) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->RotObjectToEuler(m_ID, rot.x, rot.y, rot.z, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("@rot_to_euler", "rotate to euler");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::RotateToEuler(const Vector3 & rot, SQInt32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->RotObjectToEuler(m_ID, rot.x, rot.y, rot.z, time);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("rotate_to_euler", "rotate to euler");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::RotateToEulerEx(SQFloat x, SQFloat y, SQFloat z) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->RotObjectToEuler(m_ID, x, y, z, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("rotate_to_euler", "rotate to euler");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::RotateToEulerEx(SQFloat x, SQFloat y, SQFloat z, SQInt32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->RotObjectToEuler(m_ID, x, y, z, time);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("rotate_to_euler", "rotate to euler");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::RotateByPr(const Quaternion & rot) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->RotObjectBy(m_ID, rot.x, rot.y, rot.z, rot.w, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("@rot_by", "rotate by quaternion");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::RotateBy(const Quaternion & rot, SQInt32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->RotObjectBy(m_ID, rot.x, rot.y, rot.z, rot.w, time);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("rotate_by", "rotate by quaternion");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::RotateByEx(SQFloat x, SQFloat y, SQFloat z, SQFloat w) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->RotObjectBy(m_ID, x, y, z, w, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("rotate_by", "rotate by quaternion");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::RotateByEx(SQFloat x, SQFloat y, SQFloat z, SQFloat w, SQInt32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->RotObjectBy(m_ID, x, y, z, w, time);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("rotate_by", "rotate by quaternion");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::RotateByEulerPr(const Vector3 & rot) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->RotObjectByEuler(m_ID, rot.x, rot.y, rot.z, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("@rot_by_euler", "rotate by euler");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::RotateByEuler(const Vector3 & rot, SQInt32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->RotObjectByEuler(m_ID, rot.x, rot.y, rot.z, time);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("rotate_by_euler", "rotate by euler");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::RotateByEulerEx(SQFloat x, SQFloat y, SQFloat z) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->RotObjectByEuler(m_ID, x, y, z, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("rotate_by_euler", "rotate by euler");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::RotateByEulerEx(SQFloat x, SQFloat y, SQFloat z, SQInt32 time) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->RotObjectByEuler(m_ID, x, y, z, time);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("rotate_by_euler", "rotate by euler");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
const Quaternion & CObject::GetRotation()
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
// Clear any previous rotation
|
|
|
|
s_Quaternion.Clear();
|
|
|
|
// Attempt to retrieve the rotation
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->GetObjectRot(m_ID, &s_Quaternion.x, &s_Quaternion.y, &s_Quaternion.z, &s_Quaternion.w);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("@rotation", "get quaternion rotation");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
// Return the rotation that could be retrieved
|
|
|
|
return s_Quaternion;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
const Vector3 & CObject::GetRotationEuler()
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
// Clear any previous rotation
|
|
|
|
s_Vector3.Clear();
|
|
|
|
// Attempt to retrieve the rotation
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->GetObjectRotEuler(m_ID, &s_Vector3.x, &s_Vector3.y, &s_Vector3.z);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("@rotation_euler", "get euler rotation");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
// Return the rotation that could be retrieved
|
|
|
|
return s_Vector3;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
bool CObject::GetShotReport() const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
return _Func->IsObjectShotReport(m_ID);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("@shot_report", "get whether shots are reported");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::SetShotReport(bool toggle) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->SetObjectShotReport(m_ID, toggle);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("@shot_report", "set whether shots are reported");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
bool CObject::GetBumpReport() const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
return _Func->IsObjectBumpReport(m_ID);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("@bump_report", "get whether bumps are reported");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void CObject::SetBumpReport(bool toggle) const
|
2015-10-29 21:10:36 +01:00
|
|
|
{
|
|
|
|
if (VALID_ENTITY(m_ID))
|
|
|
|
{
|
|
|
|
_Func->SetObjectBumpReport(m_ID, toggle);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-11-11 07:57:26 +01:00
|
|
|
BadRef("@bump_report", "set whether bumps are reported");
|
2015-10-29 21:10:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-01 00:31:57 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Reference< CObject > CreateBaseObject_PEF(SQInt32 model, SQInt32 world,
|
|
|
|
SQFloat x, SQFloat y, SQFloat z,
|
2015-11-01 04:48:01 +01:00
|
|
|
SQInt32 alpha)
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
|
|
|
return _Core->NewObject(model, world, x, y, z, alpha,
|
|
|
|
SQMOD_CREATE_DEFAULT, NullData());
|
|
|
|
}
|
|
|
|
|
|
|
|
Reference< CObject > CreateBaseObject_PEF(SQInt32 model, SQInt32 world,
|
|
|
|
SQFloat x, SQFloat y, SQFloat z,
|
|
|
|
SQInt32 alpha,
|
2015-11-01 04:48:01 +01:00
|
|
|
SQInt32 header, SqObj & payload)
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
|
|
|
return _Core->NewObject(model, world, x, y, z, alpha,
|
|
|
|
header, payload);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Reference< CObject > CreateBaseObject_PCF(SQInt32 model, SQInt32 world,
|
2015-11-01 04:48:01 +01:00
|
|
|
const Vector3 & pos, SQInt32 alpha)
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
|
|
|
return _Core->NewObject(model, world, pos.x, pos.y, pos.z, alpha,
|
|
|
|
SQMOD_CREATE_DEFAULT, NullData());
|
|
|
|
}
|
|
|
|
|
|
|
|
Reference< CObject > CreateBaseObject_PCF(SQInt32 model, SQInt32 world,
|
|
|
|
const Vector3 & pos, SQInt32 alpha,
|
2015-11-01 04:48:01 +01:00
|
|
|
SQInt32 header, SqObj & payload)
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
|
|
|
return _Core->NewObject(model, world, pos.x, pos.y, pos.z, alpha,
|
|
|
|
header, payload);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Reference< CObject > CreateBaseObject_EF(const CModel & model, SQInt32 world,
|
|
|
|
SQFloat x, SQFloat y, SQFloat z,
|
2015-11-01 04:48:01 +01:00
|
|
|
SQInt32 alpha)
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
|
|
|
return _Core->NewObject(model, world, x, y, z, alpha,
|
|
|
|
SQMOD_CREATE_DEFAULT, NullData());
|
|
|
|
}
|
|
|
|
|
|
|
|
Reference< CObject > CreateBaseObject_EF(const CModel & model, SQInt32 world,
|
|
|
|
SQFloat x, SQFloat y, SQFloat z,
|
|
|
|
SQInt32 alpha,
|
2015-11-01 04:48:01 +01:00
|
|
|
SQInt32 header, SqObj & payload)
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
|
|
|
return _Core->NewObject(model, world, x, y, z, alpha,
|
|
|
|
header, payload);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Reference< CObject > CreateBaseObject_CF(const CModel & model, SQInt32 world,
|
2015-11-01 04:48:01 +01:00
|
|
|
const Vector3 & pos, SQInt32 alpha)
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
|
|
|
return _Core->NewObject(model, world, pos.x, pos.y, pos.z, alpha,
|
|
|
|
SQMOD_CREATE_DEFAULT, NullData());
|
|
|
|
}
|
|
|
|
|
|
|
|
Reference< CObject > CreateBaseObject_CF(const CModel & model, SQInt32 world,
|
|
|
|
const Vector3 & pos, SQInt32 alpha,
|
2015-11-01 04:48:01 +01:00
|
|
|
SQInt32 header, SqObj & payload)
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
|
|
|
return _Core->NewObject(model, world, pos.x, pos.y, pos.z, alpha,
|
|
|
|
header, payload);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
CObject CreateObject_PEF(SQInt32 model, SQInt32 world,
|
|
|
|
SQFloat x, SQFloat y, SQFloat z,
|
2015-11-01 04:48:01 +01:00
|
|
|
SQInt32 alpha)
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
|
|
|
return _Core->NewObject(model, world, x, y, z, alpha,
|
|
|
|
SQMOD_CREATE_DEFAULT, NullData());
|
|
|
|
}
|
|
|
|
|
|
|
|
CObject CreateObject_PEF(SQInt32 model, SQInt32 world,
|
|
|
|
SQFloat x, SQFloat y, SQFloat z,
|
|
|
|
SQInt32 alpha,
|
2015-11-01 04:48:01 +01:00
|
|
|
SQInt32 header, SqObj & payload)
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
|
|
|
return _Core->NewObject(model, world, x, y, z, alpha,
|
|
|
|
header, payload);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
CObject CreateObject_PCF(SQInt32 model, SQInt32 world,
|
2015-11-01 04:48:01 +01:00
|
|
|
const Vector3 & pos, SQInt32 alpha)
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
|
|
|
return _Core->NewObject(model, world, pos.x, pos.y, pos.z, alpha,
|
|
|
|
SQMOD_CREATE_DEFAULT, NullData());
|
|
|
|
}
|
|
|
|
|
|
|
|
CObject CreateObject_PCF(SQInt32 model, SQInt32 world,
|
|
|
|
const Vector3 & pos, SQInt32 alpha,
|
2015-11-01 04:48:01 +01:00
|
|
|
SQInt32 header, SqObj & payload)
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
|
|
|
return _Core->NewObject(model, world, pos.x, pos.y, pos.z, alpha,
|
|
|
|
header, payload);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
CObject CreateObject_EF(const CModel & model, SQInt32 world,
|
|
|
|
SQFloat x, SQFloat y, SQFloat z,
|
2015-11-01 04:48:01 +01:00
|
|
|
SQInt32 alpha)
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
|
|
|
return _Core->NewObject(model, world, x, y, z, alpha,
|
|
|
|
SQMOD_CREATE_DEFAULT, NullData());
|
|
|
|
}
|
|
|
|
|
|
|
|
CObject CreateObject_EF(const CModel & model, SQInt32 world,
|
|
|
|
SQFloat x, SQFloat y, SQFloat z,
|
|
|
|
SQInt32 alpha,
|
2015-11-01 04:48:01 +01:00
|
|
|
SQInt32 header, SqObj & payload)
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
|
|
|
return _Core->NewObject(model, world, x, y, z, alpha,
|
|
|
|
header, payload);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
CObject CreateObject_CF(const CModel & model, SQInt32 world,
|
2015-11-01 04:48:01 +01:00
|
|
|
const Vector3 & pos, SQInt32 alpha)
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
|
|
|
return _Core->NewObject(model, world, pos.x, pos.y, pos.z, alpha,
|
|
|
|
SQMOD_CREATE_DEFAULT, NullData());
|
|
|
|
}
|
|
|
|
|
|
|
|
CObject CreateObject_CF(const CModel & model, SQInt32 world,
|
|
|
|
const Vector3 & pos, SQInt32 alpha,
|
2015-11-01 04:48:01 +01:00
|
|
|
SQInt32 header, SqObj & payload)
|
2015-11-01 00:31:57 +01:00
|
|
|
{
|
|
|
|
return _Core->NewObject(model, world, pos.x, pos.y, pos.z, alpha,
|
|
|
|
header, payload);
|
|
|
|
}
|
|
|
|
|
2015-10-29 21:10:36 +01:00
|
|
|
// ================================================================================================
|
2015-09-30 02:56:11 +02:00
|
|
|
bool Register_CObject(HSQUIRRELVM vm)
|
|
|
|
{
|
2015-10-29 21:10:36 +01:00
|
|
|
// Attempt to register the base reference type before the actual implementation
|
2015-09-30 02:56:11 +02:00
|
|
|
if (!Register_Reference< CObject >(vm, _SC("BaseObject")))
|
|
|
|
{
|
2015-10-29 21:10:36 +01:00
|
|
|
LogFtl("Unable to register the base class <BaseObject> for <CObject> type");
|
|
|
|
// Registration failed
|
2015-09-30 02:56:11 +02:00
|
|
|
return false;
|
|
|
|
}
|
2015-11-01 00:31:57 +01:00
|
|
|
// Typedef the base reference type for simplicity
|
|
|
|
typedef Reference< CObject > RefType;
|
2015-10-29 21:10:36 +01:00
|
|
|
// Output debugging information
|
2015-09-30 02:56:11 +02:00
|
|
|
LogDbg("Beginning registration of <CObject> type");
|
2015-10-29 21:10:36 +01:00
|
|
|
// Attempt to register the actual reference that implements all of the entity functionality
|
2015-11-01 00:31:57 +01:00
|
|
|
Sqrat::RootTable(vm).Bind(_SC("CObject"), Sqrat::DerivedClass< CObject, RefType >(vm, _SC("CObject"))
|
2015-10-29 21:10:36 +01:00
|
|
|
/* Constructors */
|
2015-09-30 02:56:11 +02:00
|
|
|
.Ctor()
|
|
|
|
.Ctor< SQInt32 >()
|
2015-10-29 21:10:36 +01:00
|
|
|
/* Properties */
|
|
|
|
.Prop(_SC("model"), &CObject::GetModel)
|
|
|
|
.Prop(_SC("model_id"), &CObject::GetModelID)
|
|
|
|
.Prop(_SC("world"), &CObject::GetWorld, &CObject::SetWorld)
|
|
|
|
.Prop(_SC("alpha"), &CObject::GetAlpha, &CObject::SetAlpha)
|
|
|
|
.Prop(_SC("mov_to"), &CObject::MoveToPr)
|
|
|
|
.Prop(_SC("mov_by"), &CObject::MoveByPr)
|
|
|
|
.Prop(_SC("position"), &CObject::GetPosition, &CObject::SetPosition)
|
|
|
|
.Prop(_SC("rot_to"), &CObject::RotateToPr)
|
|
|
|
.Prop(_SC("rot_to_euler"), &CObject::RotateToEulerPr)
|
|
|
|
.Prop(_SC("rot_by"), &CObject::RotateByPr)
|
|
|
|
.Prop(_SC("rot_by_euler"), &CObject::RotateByEulerPr)
|
|
|
|
.Prop(_SC("rotation"), &CObject::GetRotation)
|
|
|
|
.Prop(_SC("rotation_euler"), &CObject::GetRotationEuler)
|
|
|
|
.Prop(_SC("shot_report"), &CObject::GetShotReport, &CObject::SetShotReport)
|
2015-11-11 07:57:26 +01:00
|
|
|
.Prop(_SC("bump_report"), &CObject::GetBumpReport, &CObject::SetBumpReport)
|
2015-10-29 21:10:36 +01:00
|
|
|
/* Functions */
|
|
|
|
.Func(_SC("streamed_for"), &CObject::IsStreamedFor)
|
|
|
|
.Func(_SC("set_alpha"), &CObject::SetAlphaEx)
|
|
|
|
.Func(_SC("set_position"), &CObject::SetPositionEx)
|
|
|
|
/* Overloads */
|
|
|
|
.Overload< void (CObject::*)(const Vector3 &, SQInt32) const >
|
|
|
|
(_SC("move_to"), &CObject::MoveTo)
|
|
|
|
.Overload< void (CObject::*)(SQFloat, SQFloat, SQFloat) const >
|
|
|
|
(_SC("move_to"), &CObject::MoveToEx)
|
|
|
|
.Overload< void (CObject::*)(SQFloat, SQFloat, SQFloat, SQInt32) const >
|
|
|
|
(_SC("move_to"), &CObject::MoveToEx)
|
|
|
|
.Overload< void (CObject::*)(const Vector3 &, SQInt32) const >
|
|
|
|
(_SC("move_by"), &CObject::MoveBy)
|
|
|
|
.Overload< void (CObject::*)(SQFloat, SQFloat, SQFloat) const >
|
|
|
|
(_SC("move_by"), &CObject::MoveByEx)
|
|
|
|
.Overload< void (CObject::*)(SQFloat, SQFloat, SQFloat, SQInt32) const >
|
|
|
|
(_SC("move_by"), &CObject::MoveByEx)
|
|
|
|
.Overload< void (CObject::*)(const Quaternion &, SQInt32) const >
|
|
|
|
(_SC("rotate_to"), &CObject::RotateTo)
|
|
|
|
.Overload< void (CObject::*)(SQFloat, SQFloat, SQFloat, SQFloat) const >
|
|
|
|
(_SC("rotate_to"), &CObject::RotateToEx)
|
|
|
|
.Overload< void (CObject::*)(SQFloat, SQFloat, SQFloat, SQFloat, SQInt32) const >
|
|
|
|
(_SC("rotate_to"), &CObject::RotateToEx)
|
|
|
|
.Overload< void (CObject::*)(const Vector3 &, SQInt32) const >
|
|
|
|
(_SC("rotate_to_euler"), &CObject::RotateToEuler)
|
|
|
|
.Overload< void (CObject::*)(SQFloat, SQFloat, SQFloat) const >
|
|
|
|
(_SC("rotate_to_euler"), &CObject::RotateToEulerEx)
|
|
|
|
.Overload< void (CObject::*)(SQFloat, SQFloat, SQFloat, SQInt32) const >
|
|
|
|
(_SC("rotate_to_euler"), &CObject::RotateToEulerEx)
|
|
|
|
.Overload< void (CObject::*)(const Quaternion &, SQInt32) const >
|
|
|
|
(_SC("rotate_by"), &CObject::RotateBy)
|
|
|
|
.Overload< void (CObject::*)(SQFloat, SQFloat, SQFloat, SQFloat) const >
|
|
|
|
(_SC("rotate_by"), &CObject::RotateByEx)
|
|
|
|
.Overload< void (CObject::*)(SQFloat, SQFloat, SQFloat, SQFloat, SQInt32) const >
|
|
|
|
(_SC("rotate_by"), &CObject::RotateByEx)
|
|
|
|
.Overload< void (CObject::*)(const Vector3 &, SQInt32) const >
|
|
|
|
(_SC("rotate_by_euler"), &CObject::RotateByEuler)
|
|
|
|
.Overload< void (CObject::*)(SQFloat, SQFloat, SQFloat) const >
|
|
|
|
(_SC("rotate_by_euler"), &CObject::RotateByEulerEx)
|
|
|
|
.Overload< void (CObject::*)(SQFloat, SQFloat, SQFloat, SQInt32) const >
|
|
|
|
(_SC("rotate_by_euler"), &CObject::RotateByEulerEx)
|
2015-09-30 02:56:11 +02:00
|
|
|
);
|
2015-10-29 21:10:36 +01:00
|
|
|
// Output debugging information
|
2015-11-01 00:31:57 +01:00
|
|
|
LogDbg("Registration of <Object> type was successful");
|
|
|
|
// Output debugging information
|
2015-11-11 07:57:26 +01:00
|
|
|
LogDbg("Beginning registration of <CObject> functions");
|
2015-11-01 00:31:57 +01:00
|
|
|
// Register global functions related to this entity type
|
|
|
|
Sqrat::RootTable(vm)
|
|
|
|
/* Create BaseObject [P]rimitive [E]xtended [F]Full */
|
|
|
|
.Overload< RefType (*)(SQInt32, SQInt32, SQFloat, SQFloat, SQFloat, SQInt32) >
|
|
|
|
(_SC("CreateBaseObject_PEF"), &CreateBaseObject_PEF)
|
|
|
|
.Overload< RefType (*)(SQInt32, SQInt32, SQFloat, SQFloat, SQFloat, SQInt32, SQInt32, SqObj &) >
|
|
|
|
(_SC("CreateBaseObject_PEF"), &CreateBaseObject_PEF)
|
|
|
|
/* Create BaseObject [P]rimitive [C]ompact [F]ull */
|
|
|
|
.Overload< RefType (*)(SQInt32, SQInt32, const Vector3 &, SQInt32) >
|
|
|
|
(_SC("CreateBaseObject_PCF"), &CreateBaseObject_PCF)
|
|
|
|
.Overload< RefType (*)(SQInt32, SQInt32, const Vector3 &, SQInt32, SQInt32, SqObj &) >
|
|
|
|
(_SC("CreateBaseObject_PCF"), &CreateBaseObject_PCF)
|
|
|
|
/* Create BaseObject [E]xtended [F]Full */
|
|
|
|
.Overload< RefType (*)(const CModel &, SQInt32, SQFloat, SQFloat, SQFloat, SQInt32) >
|
|
|
|
(_SC("CreateBaseObject_EF"), &CreateBaseObject_EF)
|
|
|
|
.Overload< RefType (*)(const CModel &, SQInt32, SQFloat, SQFloat, SQFloat, SQInt32, SQInt32, SqObj &) >
|
|
|
|
(_SC("CreateBaseObject_EF"), &CreateBaseObject_EF)
|
|
|
|
/* Create BaseObject [C]ompact [F]ull */
|
|
|
|
.Overload< RefType (*)(const CModel &, SQInt32, const Vector3 &, SQInt32) >
|
|
|
|
(_SC("CreateBaseObject_CF"), &CreateBaseObject_CF)
|
|
|
|
.Overload< RefType (*)(const CModel &, SQInt32, const Vector3 &, SQInt32, SQInt32, SqObj &) >
|
|
|
|
(_SC("CreateBaseObject_CF"), &CreateBaseObject_CF)
|
|
|
|
/* Create CObject [P]rimitive [E]xtended [F]Full */
|
|
|
|
.Overload< CObject (*)(SQInt32, SQInt32, SQFloat, SQFloat, SQFloat, SQInt32) >
|
|
|
|
(_SC("CreateObject_PEF"), &CreateObject_PEF)
|
|
|
|
.Overload< CObject (*)(SQInt32, SQInt32, SQFloat, SQFloat, SQFloat, SQInt32, SQInt32, SqObj &) >
|
|
|
|
(_SC("CreateObject_PEF"), &CreateObject_PEF)
|
|
|
|
/* Create CObject [P]rimitive [C]ompact [F]ull */
|
|
|
|
.Overload< CObject (*)(SQInt32, SQInt32, const Vector3 &, SQInt32) >
|
|
|
|
(_SC("CreateObject_PCF"), &CreateObject_PCF)
|
|
|
|
.Overload< CObject (*)(SQInt32, SQInt32, const Vector3 &, SQInt32, SQInt32, SqObj &) >
|
|
|
|
(_SC("CreateObject_PCF"), &CreateObject_PCF)
|
|
|
|
/* Create CObject [E]xtended [F]Full */
|
|
|
|
.Overload< CObject (*)(const CModel &, SQInt32, SQFloat, SQFloat, SQFloat, SQInt32) >
|
|
|
|
(_SC("CreateObject_EF"), &CreateObject_EF)
|
|
|
|
.Overload< CObject (*)(const CModel &, SQInt32, SQFloat, SQFloat, SQFloat, SQInt32, SQInt32, SqObj &) >
|
|
|
|
(_SC("CreateObject_EF"), &CreateObject_EF)
|
|
|
|
/* Create CObject [C]ompact [F]ull */
|
|
|
|
.Overload< CObject (*)(const CModel &, SQInt32, const Vector3 &, SQInt32) >
|
|
|
|
(_SC("CreateObject_CF"), &CreateObject_CF)
|
|
|
|
.Overload< CObject (*)(const CModel &, SQInt32, const Vector3 &, SQInt32, SQInt32, SqObj &) >
|
|
|
|
(_SC("CreateObject_CF"), &CreateObject_CF);
|
|
|
|
// Output debugging information
|
2015-11-11 07:57:26 +01:00
|
|
|
LogDbg("Registration of <Object> functions was successful");
|
2015-10-29 21:10:36 +01:00
|
|
|
// Registration succeeded
|
2015-09-30 02:56:11 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // Namespace:: SqMod
|