1 #ifndef DALI_INTERNAL_EVENT_ACTORS_ACTOR_COORDS_H
2 #define DALI_INTERNAL_EVENT_ACTORS_ACTOR_COORDS_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
20 #include <dali/internal/event/actors/camera-actor-impl.h>
21 #include <dali/internal/event/render-tasks/render-task-impl.h>
22 #include <dali/internal/event/render-tasks/render-task-list-impl.h>
23 #include <dali/public-api/math/matrix.h>
24 #include <dali/public-api/math/vector3.h>
25 #include <dali/public-api/math/viewport.h>
27 namespace Dali::Internal
30 * Convert screen coordinates to local coordinates
32 * @param[in] viewMatrix The view matrix used to display this entity
33 * @param[in] projectionMatrix The projection matrix used to display this entity
34 * @param[in] worldMatrix The world matrix of this entity
35 * @param[in] viewport The viewport used for drawing
36 * @param[in] currentSize The 2d bounding box for this entity
37 * @param[out] localX The local X coordinate
38 * @param[out] localY The local Y coordinate
39 * @param[in] screenX The screen X coordinate
40 * @param[in] screenY The screen Y coordinate
41 * @return true if the conversion was successful
43 bool ConvertScreenToLocal(const Matrix& viewMatrix,
44 const Matrix& projectionMatrix,
45 const Matrix& worldMatrix,
46 const Vector3& currentSize,
47 const Viewport& viewport,
54 * Convert screen coordinates to local coordinates
56 * @param[in] renderTask The render task used to display this entity
57 * @param[in] worldMatrix The world matrix of this entity
58 * @param[in] currentSize The 2d bounding box for this entity
59 * @param[out] localX The local X coordinate
60 * @param[out] localY The local Y coordinate
61 * @param[in] screenX The screen X coordinate
62 * @param[in] screenY The screen Y coordinate
63 * @return true if the conversion was successful
65 bool ConvertScreenToLocalRenderTask(
66 const RenderTask& renderTask,
67 const Matrix& worldMatrix,
68 const Vector3& currentSize,
75 * Convert screen coordinates to local coordinates
76 * Search through the given renderTaskList to check if this entity can be converted
78 * @param[in] renderTaskList The render task list to search
79 * @param[in] worldMatrix The world matrix of this entity
80 * @param[in] currentSize The 2d bounding box for this entity
81 * @param[out] localX The local X coordinate
82 * @param[out] localY The local Y coordinate
83 * @param[in] screenX The screen X coordinate
84 * @param[in] screenY The screen Y coordinate
85 * @return true if the conversion was successful
87 bool ConvertScreenToLocalRenderTaskList(
88 const RenderTaskList& renderTaskList,
89 const Matrix& worldMatrix,
90 const Vector3& currentSize,
96 } // namespace Dali::Internal
98 #endif // DALI_INTERNAL_EVENT_ACTORS_ACTOR_COORDS_H