jolievivienne

hmmm

May 22nd, 2015
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.42 KB | None | 0 0
  1.         /// Create a new scene UI
  2.         scenePlayerUI_= new Scene(context_);
  3.         scenePlayerUI_-> CreateComponent<Octree>();
  4.         scenePlayerUI_-> CreateComponent<DebugRenderer>();
  5.  
  6.         /// Add a plane
  7.         Node* planeNode = scenePlayerUI_->CreateChild("Plane");
  8.         planeNode->SetScale(Vector3(100.0f, 1.0f, 100.0f));
  9.         StaticModel* planeObject = planeNode->CreateComponent<StaticModel>();
  10.         planeObject->SetModel(cache->GetResource<Model>("Models/Plane.mdl"));
  11.  
  12.         /// Add a lightdelightNode
  13.         Node* lightNode = scenePlayerUI_->CreateChild("DirectionalLight");
  14.         lightNode->SetDirection(Vector3(0.6f, -1.0f, 0.8f)); /// The direction vector does not need to be normalized
  15.         Light* light = lightNode->CreateComponent<Light>();
  16.         light->SetLightType(LIGHT_DIRECTIONAL);
  17.  
  18.         /// Add Camera
  19.         Node * cameraNodePlayerUI_ = scenePlayerUI_->CreateChild("Camera");
  20.         cameraNodePlayerUI_->CreateComponent<Camera>();
  21.  
  22.         /// Set an initial position for the camera scene node above the plane
  23.         cameraNodePlayerUI_->SetPosition(Vector3(0.0f, 5.0f, 0.0f));
  24.  
  25.         /// Get the view window
  26.         View3D * playerViewWindow = (View3D *) HUDFileElement -> GetChild("PlayerViewWindow",true);
  27.  
  28.         /// Add scene and camera to window
  29.         playerViewWindow -> SetView(scenePlayerUI_,(Camera *)cameraNodePlayerUI_->GetComponent<Camera>(),true);
Advertisement
Add Comment
Please, Sign In to add comment