Dali 3D User Interface Engine
camera-actor-impl.h
Go to the documentation of this file.
1 #ifndef __DALI_INTERNAL_CAMERA_ACTOR_H__
2 #define __DALI_INTERNAL_CAMERA_ACTOR_H__
3 
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20 
21 // INTERNAL INCLUES
27 
28 namespace Dali
29 {
30 
31 namespace Internal
32 {
33 
37 class CameraActor : public Actor
38 {
39 public:
40 
50  static CameraActorPtr New( const Size& size );
51 
55  void OnInitialize();
56 
62  {
63  return *mCameraAttachment;
64  }
65 
69  void SetType( Dali::Camera::Type type );
70 
75 
80 
85 
89  void SetFieldOfView( float fieldOfView );
90 
94  float GetFieldOfView( ) const;
95 
99  void SetAspectRatio( float aspectRatio );
100 
104  float GetAspectRatio( ) const;
105 
109  void SetNearClippingPlane( float nearClippingPlane );
110 
114  float GetNearClippingPlane( ) const;
115 
119  void SetFarClippingPlane( float farClippingPlane );
120 
124  float GetFarClippingPlane( ) const;
125 
129  void SetTargetPosition( const Vector3& targetPosition );
130 
134  Vector3 GetTargetPosition() const;
135 
139  void SetInvertYAxis(bool invertYAxis);
140 
144  bool GetInvertYAxis() const;
145 
150  void SetPerspectiveProjection( const Size& size, const Vector2& stereoBias = Vector2::ZERO );
151 
155  void SetOrthographicProjection( const Vector2& size );
156 
160  void SetOrthographicProjection( float left, float right, float top, float bottom, float near, float far );
161 
170  bool BuildPickingRay( const Vector2& screenCoordinates, const Viewport& viewport, Vector4& rayOrigin, Vector4& rayDirection );
171 
176  const Matrix& GetViewMatrix() const;
177 
182  const Matrix& GetProjectionMatrix() const;
183 
184 public: // properties
185 
189  virtual unsigned int GetDefaultPropertyCount() const;
190 
194  virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
195 
199  virtual bool IsDefaultPropertyAnimatable( Property::Index index ) const;
200 
204  virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
205 
210 
214  virtual const char* GetDefaultPropertyName( Property::Index index ) const;
215 
219  virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
220 
224  virtual void SetDefaultProperty( Property::Index index, const Property::Value& propertyValue );
225 
229  virtual Property::Value GetDefaultProperty( Property::Index index ) const;
230 
234  virtual bool IsDefaultPropertyWritable( Property::Index index ) const ;
235 
240 
244  virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
245 
246 protected:
247 
251  CameraActor();
252 
256  virtual ~CameraActor();
257 
258 private:
259 
261 
262 };
263 
264 } // namespace Internal
265 
266 // Helpers for public-api forwarding methods
267 
269 {
270  DALI_ASSERT_ALWAYS(camera && "Camera handle is empty");
271 
272  BaseObject& handle = camera.GetBaseObject();
273 
274  return static_cast<Internal::CameraActor&>(handle);
275 }
276 
278 {
279  DALI_ASSERT_ALWAYS(camera && "Camera handle is empty");
280 
281  const BaseObject& handle = camera.GetBaseObject();
282 
283  return static_cast<const Internal::CameraActor&>(handle);
284 }
285 
286 } // namespace Dali
287 
288 #endif // __DALI_INTERNAL_CAMERA_ACTOR_H__
Dali Docs Home
Read more about Dali