Exemplo n.º 1
0
EXTERN_FORM DLL_API Dvoid __cdecl coold_SetViewFactor(Dfloat* eye, Dfloat* lookat, Dfloat* up)
{
	//시점 이동
	if (!cc_use_camera.Bool())
	{
		if (cc_x_eye.Bool()) eye[0] += cc_x_eye.Float();
		if (cc_y_eye.Bool()) eye[1] += cc_y_eye.Float();
		if (cc_z_eye.Bool()) eye[2] += cc_z_eye.Float();

		g_matView = TransformHelper::CreateView(Vector3(eye), Vector3(lookat), Vector3(up));
	}
}
Exemplo n.º 2
0
	Dbool RenderModule::FrustumCulling(const BaseFace& currentface)
	{			
		Duint faceSize = currentface.vecIndex.size();
		Dbool isCulling = false;

		Dfloat boundary = 1.0f + cc_frustum_bias.Float();

		for( Duint i = 0; i < faceSize; ++i )
		{
			Dint index = currentface.vecIndex[ i ];
			Vector3 Vertex = m_trasnformVertex[ index - 1 ];

			if( Vertex.x < -boundary || boundary < Vertex.x ||
				Vertex.y < -boundary || boundary < Vertex.y ||
				Vertex.z < -boundary || boundary < Vertex.z )
			{	//시야 범위를 넘어감 즉, 제외 됨
				isCulling = true;
			}
			else
			{
				isCulling = false;
			}
		}

		return isCulling;
	}
Exemplo n.º 3
0
EXTERN_FORM DLL_API Dvoid __cdecl coold_SetTransform(Dint transformType, const Dfloat* matrix4x4)
{	//월드만 넘겨 받는다.
	switch( transformType )
	{
	case 0:	//World
		{
			Matrix44 matWorld(matrix4x4);								
			g_matWorld = matWorld.Transpose();

			//원점 기준으로 이동
			if (cc_x_move.Bool())	g_matWorld[12] = cc_x_move.Float();
			if (cc_y_move.Bool())	g_matWorld[13] = cc_y_move.Float();
			if (cc_z_move.Bool())	g_matWorld[14] = cc_z_move.Float();								
		}
		break;
	default:
		break;
	}
}
Exemplo n.º 4
0
EXTERN_FORM DLL_API Dvoid __cdecl coold_SetPerspectiveFactor(Dfloat fovY, Dfloat aspect, Dfloat zn, Dfloat zf)
{	
	if ( !cc_use_camera.Bool() )
		g_matPers = TransformHelper::CreatePerspective(kPI / fovY, aspect, zn + cc_adjust_zn.Float(), zf + cc_adjust_zf.Float());
}