genesis-3d_engine/Engine/players/Demo/Common/PageExportFunction.cc
zhongdaohuan 6e8fbca745 genesis-3d engine version 1.3.
match the genesis editor version 1.3.0.653.
2014-05-05 14:50:33 +08:00

39 lines
936 B
C++

/** \file: PageExportFunction.cc
* \brief:
* Copyright (c) 2011,WebJet Enterprise Department.ChangYou
* All rights reserved.
* Date Ver Who Comment
* 2011/11/21 1.0 SunHao
*/
#include "stdneb.h"
#include "PageExportFunction.h"
#include "GameLogic.h"
#include "appframework/app_fwd_decl.h"
#include "app/graphicfeature/graphicsfeature.h"
namespace Demo
{
void Toggle( int iNum )
{
GameLogic::Instance()->PrepareToBuild( iNum );
}
char* GetCarmerPos( void )
{
static char s_StrPos[64];
App::TActorPtr pCamera = App::GraphicsFeature::Instance()->GetDefaultCameraActor();
Math::vector pos = pCamera->GetPosition();
memset( s_StrPos, 0, 64 );
sprintf_s( s_StrPos, "%f %f %f", pos.x(), pos.y(), pos.z() );
return s_StrPos;
}
void LoadLogic(const char* pFilePath/*="logic:preBuild.glogic"*/ )
{
Util::String sFilePath( pFilePath );
GameLogic::Instance()->LoadLogic( sFilePath );
}
}