本文整理汇总了C++中CrtRender::SetShowHiearchy方法的典型用法代码示例。如果您正苦于以下问题:C++ CrtRender::SetShowHiearchy方法的具体用法?C++ CrtRender::SetShowHiearchy怎么用?C++ CrtRender::SetShowHiearchy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CrtRender
的用法示例。
在下文中一共展示了CrtRender::SetShowHiearchy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessInput
// Call ProcessInput once per frame to process input keys
void ProcessInput( bool keys[] )
{
// These keys we don't want to auto-repeat, so we clear them in "keys" after handling them once
if (keys['E'] && amplitudeGlobalParameter)
{
float value;
cgGetParameterValuefc(amplitudeGlobalParameter, 1, &value);
value += 0.1f;
cgSetParameter1f(amplitudeGlobalParameter, value);
keys['E'] = false;
}
if (keys['R'] && amplitudeGlobalParameter)
{
float value;
cgGetParameterValuefc(amplitudeGlobalParameter,1, &value);
value -= 0.1f;
cgSetParameter1f(amplitudeGlobalParameter, value);
keys['R'] = false;
}
if (keys[VK_TAB] )
{
// When 'C' is pressed, change cameras
_CrtRender.SetNextCamera();
keys[VK_TAB] = false;
}
if ( keys['M'] )
{
// Speed up UI by 25%
AdjustUISpeed(1.25f);
keys['M'] = false;
}
if ( keys['N'] )
{
// Slow down UI by 25%
AdjustUISpeed(0.75f); // Go 25% slower
keys['N'] = false;
}
if (keys['Q'])
{
if (togglewireframe) {
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
togglewireframe = FALSE;
} else {
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
togglewireframe = TRUE;
}
keys['Q'] = false;
}
if (keys['K'])
{
if (togglehiearchy) {
_CrtRender.SetShowHiearchy(CrtTrue);
togglehiearchy = FALSE;
} else {
_CrtRender.SetShowHiearchy(CrtFalse);
togglehiearchy = TRUE;
}
keys['K'] = false;
}
if (keys['L'])
{
if (togglelighting) {
glDisable(GL_LIGHTING);
togglelighting = FALSE;
} else {
glEnable(GL_LIGHTING);
togglelighting = TRUE;
}
keys['L'] = false;
}
if (keys['P'] )
{
if (sAnimationEnable) {
_CrtRender.SetAnimationPaused( CrtTrue );
sAnimationEnable = false;
}
else {
_CrtRender.SetAnimationPaused( CrtFalse );
sAnimationEnable = true;
}
keys['P'] = false;
}
if (keys[VK_F1])
{
keys[VK_F1]=FALSE;
_CrtRender.Destroy();
DestroyGLWindow();
fullscreen=!fullscreen;
// Recreate Our OpenGL Window
if (!CreateGLWindow("Collada Viewer for PC", _CrtRender.GetScreenWidth(), _CrtRender.GetScreenHeight(),32,fullscreen))
{
exit(1);
}
if ( !_CrtRender.Load( cleaned_file_name ))
{
exit(0);
//.........这里部分代码省略.........
示例2: onInit
bool COLLADA_Viewer::onInit(int argc, char **ppArgv)
{
FWGLApplication::onInit(argc, ppArgv);
glClearColor(0.3f,0.3f,0.7f, 0.0f);
glClearDepthf(1.0f);
glEnable(GL_DEPTH_TEST);
FWDebugFont::setColor(1.f, 1.f, 1.f, 1.f);
InitFS();
Browser.Init();
psglLoadShaderLibrary("/app_home/shaders.bin");
// Initialize the renderer
_CrtRender.Init();
_CrtRender.SetUsingVBOs(CrtTrue);
_CrtRender.SetShowHiearchy(CrtTrue);
glEnable(GL_TEXTURE_2D);
glShadeModel(GL_SMOOTH);
glClearColor(0.0f, 0.0f, 1.0f, 0.5f);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glEnable(GL_LIGHT0);
glEnable(GL_LIGHTING);
glEnable( GL_CULL_FACE );
glCullFace( GL_BACK );
cgRTCgcInit();
ParseDir("/app_home/");
// Load the target file
Browser.onUpdate();
if (argc > 0)
{
char path_name[1024];
mCurrentFile = ppArgv[0];
sprintf(path_name, "%s%s", "/app_home/", ppArgv[0]);
printf(path_name);
load_ok = _CrtRender.Load(path_name, NULL);
if ( !load_ok )
return false;
}
else if (Browser.GetSize() > 0)
{
mCurrentFile = Browser.GetThumbnail(0)->GetDocument();
load_ok = _CrtRender.Load(mCurrentFile, NULL);
if ( !load_ok )
return false;
}
// Get the gamepad so we can read it later
mpPad = FWInput::getDevice(FWInput::DeviceType_Pad,0);
if(mpPad==NULL)
{
printf("Error, couldn't get a pad\n");
exit(0);
}
mpInputX0 = mpPad->bindFilter();
mpInputX0->setChannel(FWInput::Channel_XAxis_0);
mpInputX0->setGain( 1.0f );
mpInputX0->setDeadzone( 0.3f );
mpInputY0 = mpPad->bindFilter();
mpInputY0->setChannel(FWInput::Channel_YAxis_0);
mpInputY0->setGain( 1.0f );
mpInputY0->setDeadzone( 0.3f );
mpInputX1 = mpPad->bindFilter();
mpInputX1->setChannel(FWInput::Channel_XAxis_1);
mpInputX1->setGain( 1.0f );
mpInputX1->setDeadzone( 0.3f );
mpInputY1 = mpPad->bindFilter();
mpInputY1->setChannel(FWInput::Channel_YAxis_1);
mpInputY1->setGain( 1.0f );
mpInputY1->setDeadzone( 0.3f );
// initialize debug font library, then open console.
int ret;
CellDbgFontConfig cfg;
memset(&cfg, 0, sizeof(CellDbgFontConfig));
cfg.bufSize = 512;
cfg.screenWidth = mDispInfo.mWidth;
cfg.screenHeight = mDispInfo.mHeight;
ret = cellDbgFontInit(&cfg);
if (ret != CELL_OK) {
printf("cellDbgFontInit() failed %x\n", ret);
return true;
}
CellDbgFontConsoleConfig ccfg;
memset(&ccfg, 0, sizeof(CellDbgFontConsoleConfig));
ccfg.posLeft = 0.1f;
ccfg.posTop = 0.6f;
ccfg.cnsWidth = 16;
ccfg.cnsHeight = 4;
//.........这里部分代码省略.........
示例3: KeyboardCallback
static void KeyboardCallback(const unsigned char key, const int x, const int y)
{
(void)x;
(void)y;
switch (key)
{
case 9 : /* TAB key */
_CrtRender.SetNextCamera();
break;
case 'k' :
case 'K' :
sHierarchy = !sHierarchy;
if (!sHierarchy) {
_CrtRender.SetShowHiearchy( CrtFalse );
}
else {
_CrtRender.SetShowHiearchy( CrtTrue );
}
break;
case 'l' :
case 'L' :
sGlLighting = !sGlLighting;
if (sGlLighting) {
glEnable(GL_LIGHTING);
} else {
glDisable(GL_LIGHTING);
}
break;
case 'm' :
case 'M' :
AdjustUISpeed(1.25f);
break;
case 'n' :
case 'N' :
AdjustUISpeed(0.75f);
break;
case 'p' :
case 'P' :
sAnimation = !sAnimation;
if (!sAnimation) {
_CrtRender.SetAnimationPaused( CrtTrue );
}
else {
_CrtRender.SetAnimationPaused( CrtFalse );
}
break;
case 'q' :
case 'Q' :
sWireframe = !sWireframe;
if (sWireframe) {
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
} else {
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
}
break;
case 's' : //zoom in
case 'S' :
_CrtRender.ActiveInstanceCamera->MoveTransform(_CrtRender.GetAnimDelta() * KeyboardTranslateSpeed *0.5f, 0.0f, 0.0f);
break;
case 'w' : // zoom out
case 'W' :
_CrtRender.ActiveInstanceCamera->MoveTransform(- _CrtRender.GetAnimDelta() * KeyboardTranslateSpeed * 0.5f, 0.0f, 0.0f);
break;
case 32 : // space key, UP
// UI code to move the camera farther up
_CrtRender.ActiveInstanceCamera->MoveTransform(0.0f, 0.0f, _CrtRender.GetAnimDelta() * KeyboardTranslateSpeed);
break;
case 'x' : // down
case 'X' :
_CrtRender.ActiveInstanceCamera->MoveTransform(0.0f, 0.0f, - _CrtRender.GetAnimDelta() * KeyboardTranslateSpeed);
break;
case 'd' : // right
case 'D' :
_CrtRender.ActiveInstanceCamera->MoveTransform(0.0f, - _CrtRender.GetAnimDelta() * KeyboardTranslateSpeed, 0.0f);
break;
case 'a' : // left
case 'A' :
_CrtRender.ActiveInstanceCamera->MoveTransform(0.0f, _CrtRender.GetAnimDelta() * KeyboardTranslateSpeed, 0.0f);
break;
case 'f' :
case 'F' :
if(sCulling == 0)
{ // turn it front
glEnable( GL_CULL_FACE );
glCullFace(GL_FRONT);
sCulling = 1;
} else if(sCulling == 1)
{ // turn it both
glDisable( GL_CULL_FACE );
sCulling = 2;
} else
{ // turn it back
glEnable( GL_CULL_FACE );
glCullFace(GL_BACK);
sCulling = 0;
}
break;
default:
printf("unused key : %i\n", key );
//.........这里部分代码省略.........