FixedCamera.cpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //===========================================================================================================================
  2. // Spirenkov Maxim, 2003
  3. //===========================================================================================================================//
  4. //
  5. //===========================================================================================================================
  6. // MissionFixedCamera
  7. //============================================================================================
  8. #include "FixedCamera.h"
  9. //============================================================================================
  10. //MissionFixedCamera
  11. //============================================================================================
  12. //Прочитать параметры идущие после стандартных
  13. bool MissionFixedCamera::CameraPreCreate(MOPReader & reader)
  14. {
  15. dir = Matrix(reader.Angles()).vz;
  16. float dist = reader.Float();
  17. dir = dir*dist;
  18. return true;
  19. }
  20. //Получить позицию камеры
  21. void MissionFixedCamera::GetCameraPosition(Vector & position)
  22. {
  23. if(!BaseCamera::GetCameraTarget(Vector(0.0f), position, Vector(0.0f, 1.0f, 0.0f)))
  24. {
  25. position = 0.0f;
  26. return;
  27. }
  28. position -= dir;
  29. }
  30. MOP_BEGINLISTCG(MissionFixedCamera, "Fixed view camera", '1.00', 0, CAMERA_COMMENT("Fixed view camera\n\n"), "Cameras")
  31. MOP_ANGLESC("Angles", Vector(0.6f, 0.0f, 0.0f), "Fixed camera's orientation angles")
  32. MOP_FLOATEXC("Distance", 3.0f, 0.5f, 195.0f, "Distance to target point in meters")
  33. MOP_CAM_STD
  34. MOP_ENDLIST(MissionFixedCamera)