本文整理汇总了C++中luaplus::LuaObject::SetObject方法的典型用法代码示例。如果您正苦于以下问题:C++ LuaObject::SetObject方法的具体用法?C++ LuaObject::SetObject怎么用?C++ LuaObject::SetObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类luaplus::LuaObject
的用法示例。
在下文中一共展示了LuaObject::SetObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RegisterScriptFunctions
void LuaScriptComponent::RegisterScriptFunctions()
{
// create the meta table
LuaPlus::LuaObject metaTableObj = LuaStateManager::Get()->GetGlobalVars().CreateTable(LUA_METATABLE_NAME);
metaTableObj.SetObject("__index", metaTableObj);
// bind functions to lua object
metaTableObj.RegisterObjectDirect("GetObjectId", (LuaScriptComponent*)0, &LuaScriptComponent::GetObjectId);
metaTableObj.RegisterObjectDirect("GetPos", (LuaScriptComponent*)0, &LuaScriptComponent::GetPos);
metaTableObj.RegisterObjectDirect("SetPos", (LuaScriptComponent*)0, &LuaScriptComponent::SetPos);
metaTableObj.RegisterObjectDirect("GetLookAt", (LuaScriptComponent*)0, &LuaScriptComponent::GetLookAt);
metaTableObj.RegisterObjectDirect("GetYOrientationRadians", (LuaScriptComponent*)0, &LuaScriptComponent::GetYOrientationRadians);
metaTableObj.RegisterObjectDirect("RotateY", (LuaScriptComponent*)0, &LuaScriptComponent::RotateY);
metaTableObj.RegisterObjectDirect("Stop", (LuaScriptComponent*)0, &LuaScriptComponent::Stop);
metaTableObj.RegisterObjectDirect("SetPosition", (LuaScriptComponent*)0, &LuaScriptComponent::SetPosition);
}
示例2: RegisterScriptFunctions
void BaseScriptComponent::RegisterScriptFunctions(void)
{
// create the metatable
LuaPlus::LuaObject metaTableObj = LuaStateManager::Get()->GetGlobalVars().CreateTable(METATABLE_NAME);
metaTableObj.SetObject("__index", metaTableObj);
// transform component functions
metaTableObj.RegisterObjectDirect("GetActorId", (BaseScriptComponent*)0, &BaseScriptComponent::GetActorId);
metaTableObj.RegisterObjectDirect("GetPos", (BaseScriptComponent*)0, &BaseScriptComponent::GetPos);
metaTableObj.RegisterObjectDirect("SetPos", (BaseScriptComponent*)0, &BaseScriptComponent::SetPos);
metaTableObj.RegisterObjectDirect("GetLookAt", (BaseScriptComponent*)0, &BaseScriptComponent::GetLookAt);
metaTableObj.RegisterObjectDirect("GetYOrientationRadians", (BaseScriptComponent*)0, &BaseScriptComponent::GetYOrientationRadians);
//metaTableObj.RegisterObjectDirect("RotateY", (BaseScriptComponent*)0, &BaseScriptComponent::RotateY);
//metaTableObj.RegisterObjectDirect("Stop", (BaseScriptComponent*)0, &BaseScriptComponent::Stop);
//metaTableObj.RegisterObjectDirect("SetPosition", (BaseScriptComponent*)0, &BaseScriptComponent::SetPosition);
}
示例3: RegisterScriptFunction
void TransformationComponent::RegisterScriptFunction()
{
LuaPlus::LuaObject metaTable = LuaManager::GetSingleton().GetGlobalVars().CreateTable("TransformationComponentMetatable");
metaTable.SetObject("__index", metaTable);
//TODO -> Studente MGD
//Esempio: metaTable.RegisterObjectDirect("NomeFunzioneInLua", (NomeClass*)0, Puntatore a funzione);
// Esporre SetPosition
// Esporre GetPosition
// Esporre Translate
// Esporre LookAt
// Esporre Rotate
// Esporre GetRotateX
// Esporre GetRotateY
// Esporre GetRotateZ
}