当前位置: 首页>>代码示例>>C++>>正文


C++ Origin::init方法代码示例

本文整理汇总了C++中Origin::init方法的典型用法代码示例。如果您正苦于以下问题:C++ Origin::init方法的具体用法?C++ Origin::init怎么用?C++ Origin::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Origin的用法示例。


在下文中一共展示了Origin::init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

JNIEXPORT void JNICALL Java_org_nzdis_example03_GLESView_mySurfaceChanged
(JNIEnv *env, jclass c, jint width, jint height)
{
	glViewport(0, 0, width, height);
	aspect = (float)width / (float)height;
	// Generate a perspective matrix with a 60 degree FOV
	esMatrixLoadIdentity(&perspective);
    //LOGI("%f %d %d", aspect, width, height);
	esPerspective(&perspective, 60.0f, aspect, 1.0f, 30.0f);
	esTranslate(&perspective, 0.0f, 0.0f, -5.0f);
	//esRotate(&perspective, 45.0f, 1.0f, 0.0f, 0.0f);
	//esRotate(&perspective, -5.0f, 0.0f, 1.0f, 0.0f);

	origin.init(width, height);
	sphere.init(width, height);
	terrain.init(width, height);
}
开发者ID:marni,项目名称:roll-the-ball,代码行数:17,代码来源:simple.cpp

示例2: initApp

void ColoredCubeApp::initApp()
{
	D3DApp::initApp();
	
	buildFX();
	buildVertexLayouts();

	mBox.init(md3dDevice, 1.0f, D3DXCOLOR(0.5,0.5,0.5,1));
	redBox.init(md3dDevice, 1.0f, DARKBROWN);
	greenBox.init(md3dDevice, 1.0f, D3DXCOLOR(0.1,0.1,0.8,1));
	shootBox.init(md3dDevice, 1.0f, BEACH_SAND);

	line.init(md3dDevice, 1.0f, DARKBROWN);
	line2.init(md3dDevice, 1.0f, RED);
	line3.init(md3dDevice, 1.0f, GREEN);

	/*xLine.init(&line, mfxWVPVar, Vector3(0,0,0), 1);
	xLine.setPosition(Vector3(0,0,0));
	yLine.init(&line, mfxWVPVar, Vector3(0,0,0), 1);
	yLine.setPosition(Vector3(0,0,0));
	yLine.setRotationZ(ToRadian(90));
	zLine.init(&line, mfxWVPVar, Vector3(0,0,0), 1);
	zLine.setPosition(Vector3(0,0,0));
	zLine.setRotationY(ToRadian(90));*/

	shootCube.init(&shootBox,mfxWVPVar,sqrt(2.0f),Vector3(10,0,10),Vector3(0,0,0),0,Vector3(1,1,1));
	//shootCube.setRotation(Vector3(ToRadian(-20),ToRadian(45),0));

	leftWall.init(&redBox,mfxWVPVar,sqrt(2.0f),Vector3(20,0,0),Vector3(0,0,0),0,Vector3(0.5,20,100));
	//leftWall.setRotation(Vector3(ToRadian(-20),ToRadian(45),0));

	floor.init(&redBox,mfxWVPVar,sqrt(2.0f),Vector3(0,-5,0),Vector3(0,0,0),0,Vector3(20,0.2,20));
	//floor.setRotation(Vector3(ToRadian(-26),ToRadian(45),0));

	ceiling.init(&mBox,mfxWVPVar,sqrt(2.0f),Vector3(0,20,0),Vector3(0,0,0),0,Vector3(20,0.2,100));
	ceiling.setRotation(Vector3(ToRadian(-20),ToRadian(45),0));

	rightWall.init(&redBox,mfxWVPVar,sqrt(2.0f),Vector3(-20,0,0),Vector3(0,0,0),0,Vector3(0.5,20,100));
	//rightWall.setRotation(Vector3(ToRadian(-20),ToRadian(45),0));

	//srand(time(0));

	for(int i = 0; i < 20; i++)
	{
		tiles[i].init(&greenBox,mfxWVPVar,sqrt(2.0f),Vector3((-5+rand()%10)*3,-100,(-5+rand()%10)*3),Vector3(0,0,0),0,Vector3(1,1,1));
	}

	origin.init(&line,&line2,&line3,mfxWVPVar,10);

	quad1.init(md3dDevice, 10, CYAN);
	quad1.setPosition(Vector3(0,0,0));

	spinAmount = 0;

	// init sound system
    audio = new Audio();
    if (*WAVE_BANK != '\0' && *SOUND_BANK != '\0')  // if sound files defined
    {
        if( FAILED( hr = audio->initialize() ) )
        {
			exit(1);
            //if( hr == HRESULT_FROM_WIN32( ERROR_FILE_NOT_FOUND ) )
            //    throw(GameError(gameErrorNS::FATAL_ERROR, "Failed to initialize sound system because media file not found."));
            //else
            //    throw(GameError(gameErrorNS::FATAL_ERROR, "Failed to initialize sound system."));
        }
    }

	hitCubes = new CubeHoard(100,10,5,5,1,-15,15,-15,15,-100,40);
	hitCubes->init(&redBox,mfxWVPVar,sqrt(4.0f),Vector3(0,0,0),Vector3(0,100,0),70,Vector3(2,2,2));

	avoidCubes = new CubeHoard(100,20,10,10,1,-20,20,-20,20,-100,50);
	avoidCubes->init(&greenBox,mfxWVPVar,sqrt(4.0f),Vector3(0,0,0),Vector3(0,100,0),70,Vector3(2,2,2));

	audio->playCue(MUSIC);

	//input->initialize(this->getMainWnd(), false);  

}
开发者ID:,项目名称:,代码行数:79,代码来源:


注:本文中的Origin::init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。