Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/Camera.h
/* Copyright (C) 2013 Wildfire Games. | /* Copyright (C) 2017 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | public: | ||||
CVector3D GetWorldCoordinates(int px, int py, float h) const; | CVector3D GetWorldCoordinates(int px, int py, float h) const; | ||||
// Get the point on the terrain (or water plane) the camera is pointing towards | // Get the point on the terrain (or water plane) the camera is pointing towards | ||||
CVector3D GetFocus() const; | CVector3D GetFocus() const; | ||||
// Build an orientation matrix from camera position, camera focus point, and up-vector | // Build an orientation matrix from camera position, camera focus point, and up-vector | ||||
void LookAt(const CVector3D& camera, const CVector3D& orientation, const CVector3D& up); | void LookAt(const CVector3D& camera, const CVector3D& orientation, const CVector3D& up); | ||||
// Build an orientation matrix from camera position, camera orientation, and up-vector | // Build an orientation matrix from camera position, camera orientation, and up-vector | ||||
void LookAlong(CVector3D camera, CVector3D focus, CVector3D up); | void LookAlong(const CVector3D& camera, CVector3D focus, CVector3D up); | ||||
/** | /** | ||||
* Render: Renders the camera's frustum in world space. | * Render: Renders the camera's frustum in world space. | ||||
* The caller should set the color using glColorXy before calling Render. | * The caller should set the color using glColorXy before calling Render. | ||||
* | * | ||||
* @param intermediates determines how many intermediate distance planes should | * @param intermediates determines how many intermediate distance planes should | ||||
* be hinted at between the near and far planes | * be hinted at between the near and far planes | ||||
*/ | */ | ||||
Show All 20 Lines |
Wildfire Games · Phabricator