// Copyright (c) 2013- PPSSPP Project. // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, version 2.0 or later versions. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License 2.0 for more details. // A copy of the GPL 2.0 should have been included with the program. // If not, see http://www.gnu.org/licenses/ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #include "TransformUnit.h" #include "../GPUState.h" WorldCoords TransformUnit::ModelToWorld(const ModelCoords& coords) { Mat3x3 world_matrix(gstate.worldMatrix); return WorldCoords(world_matrix * coords) + Vec3(gstate.worldMatrix[9], gstate.worldMatrix[10], gstate.worldMatrix[11]); } ViewCoords TransformUnit::WorldToView(const WorldCoords& coords) { Mat3x3 view_matrix(gstate.viewMatrix); return ViewCoords(view_matrix * coords) + Vec3(gstate.viewMatrix[9], gstate.viewMatrix[10], gstate.viewMatrix[11]); } ClipCoords TransformUnit::ViewToClip(const ViewCoords& coords) { ClipCoords ret; return ret; } ScreenCoords TransformUnit::ClipToScreen(const ClipCoords& coords) { ScreenCoords ret; return ret; } DrawingCoords TransformUnit::ScreenToDrawing(const ScreenCoords& coords) { DrawingCoords ret; return ret; }