Ejemplo n.º 1
0
void TTscene::Initialize(void)
{
	m_pCam = new FreeCamera();
	AddSceneObject(m_pCam);
	SetActiveCamera(m_pCam->GetComponent<CameraComponent>());
	AddSceneObject(new Object3D(_T("Resources/goblin.ttmesh")));
	AddSceneObject(new Object3DStatic(_T("Resources/Models/environment.ttmesh")));
	AddSceneObject(new Skybox());
	
	auto pBlurMat = new BlurMaterial();
	pBlurMat->LoadEffect();
	AddPostProcessingEffect(new PostProcessingEffect(pBlurMat), 0);
	
	//AddSceneObject(new ParticleSystem() );
	AddSceneObject( new Terrain( tt::Vector3(100,30,100), 6, _T("Resources/Textures/HeightMap_128x128x16.raw") ) );

	MyServiceLocator::GetInstance()->GetService<IInputService>()->AddInputAction(InputActionId::ToggleVSync, 'V', KeyState::Pressed);

	g_pScript->Initialize();
}
Ejemplo n.º 2
0
void TLevelScene::loadObjects(const Parameters& info) {
    for (const auto& objectInfo : info.objects) {
        Object object;
        for (const auto& componentInfo : objectInfo.components) {
            const auto componentHandle = CreateComponent(componentInfo.id,
                componentInfo.parameters.get());
            object.AddComponent(componentInfo.name, componentHandle);
        }
        AddSceneObject(objectInfo.name, std::move(object));
    }
}
Ejemplo n.º 3
0
void DecoScene::LoadDeformedObjects(const string& filename)
{
	EraseAllSceneObject();
	DecoSceneObject::gsObjId = 0;
	DecoArchive Ar(filename, AT_Read);


	int numObjs;
	Ar >> numObjs;
	for (int i = 0; i < numObjs; ++i)
	{
		DecoSceneObject* body = new DecoSoftObjectCorotationLinearFEM();
		body->Deserialize(Ar);
		AddSceneObject(body);
	}
}
Ejemplo n.º 4
0
void SceneObjectManager::AddSceneObject(const std::vector<CommonObject>& objVector)
{
	CWaitCursor cursor;
	for(uint32 i=0;i<objVector.size();++i) AddSceneObject(objVector[i]);
}
Ejemplo n.º 5
0
void Scene::AddSceneObject(SceneObject *object)
{
    SceneObject::shared_ptr x(object);
    AddSceneObject(x);
}