2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/event/actors/camera-actor-impl.h>
25 #include <dali/public-api/common/stage.h>
26 #include <dali/public-api/object/type-registry.h>
27 #include <dali/internal/event/actor-attachments/camera-attachment-impl.h>
28 #include <dali/internal/event/common/property-index-ranges.h>
29 #include <dali/internal/event/common/stage-impl.h>
30 #include <dali/internal/event/render-tasks/render-task-impl.h>
31 #include <dali/internal/event/render-tasks/render-task-list-impl.h>
32 #include <dali/internal/event/common/projection.h>
33 #include <dali/integration-api/debug.h>
38 const Property::Index CameraActor::TYPE = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT;
39 const Property::Index CameraActor::PROJECTION_MODE = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 1;
40 const Property::Index CameraActor::FIELD_OF_VIEW = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 2;
41 const Property::Index CameraActor::ASPECT_RATIO = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 3;
42 const Property::Index CameraActor::NEAR_PLANE_DISTANCE = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 4;
43 const Property::Index CameraActor::FAR_PLANE_DISTANCE = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 5;
44 const Property::Index CameraActor::LEFT_PLANE_DISTANCE = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 6;
45 const Property::Index CameraActor::RIGHT_PLANE_DISTANCE = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 7;
46 const Property::Index CameraActor::TOP_PLANE_DISTANCE = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 8;
47 const Property::Index CameraActor::BOTTOM_PLANE_DISTANCE = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 9;
48 const Property::Index CameraActor::TARGET_POSITION = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 10;
49 const Property::Index CameraActor::PROJECTION_MATRIX = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 11;
50 const Property::Index CameraActor::VIEW_MATRIX = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 12;
51 const Property::Index CameraActor::INVERT_Y_AXIS = Internal::DEFAULT_ACTOR_PROPERTY_MAX_COUNT + 13;
55 bool CameraActor::mFirstInstance = true;
56 Actor::DefaultPropertyLookup* CameraActor::mDefaultCameraActorPropertyLookup = NULL;
61 // calculate the far plane distance for a 16bit depth buffer with 4 bits per unit precision
62 void CalculateClippingAndZ( float width, float height, float& nearClippingPlane, float& farClippingPlane, float& cameraZ )
64 nearClippingPlane = std::max( width, height );
65 farClippingPlane = nearClippingPlane + static_cast<float>( 0xFFFF >> 4 );
66 cameraZ = 2.0f * nearClippingPlane;
71 return Dali::CameraActor::New();
74 TypeRegistration mType( typeid(Dali::CameraActor), typeid(Dali::Actor), Create );
76 const std::string DEFAULT_CAMERA_ACTOR_PROPERTY_NAMES[] =
82 "near-plane-distance",
84 "left-plane-distance",
85 "right-plane-distance",
87 "bottom-plane-distance",
93 const int DEFAULT_CAMERA_ACTOR_PROPERTY_COUNT = sizeof( DEFAULT_CAMERA_ACTOR_PROPERTY_NAMES ) / sizeof( std::string );
95 const Property::Type DEFAULT_CAMERA_ACTOR_PROPERTY_TYPES[DEFAULT_CAMERA_ACTOR_PROPERTY_COUNT] =
97 Property::STRING, // "type",
98 Property::STRING, // "projection-mode",
99 Property::FLOAT, // "field-of-view",
100 Property::FLOAT, // "aspect-ratio",
101 Property::FLOAT, // "near-plane-distance",
102 Property::FLOAT, // "far-plane-distance",
103 Property::FLOAT, // "left-plane-distance",
104 Property::FLOAT, // "right-plane-distance",
105 Property::FLOAT, // "top-plane-distance",
106 Property::FLOAT, // "bottom-plane-distance",
107 Property::VECTOR3, // "target-position",
108 Property::MATRIX, // "projection-matrix",
109 Property::MATRIX, // "view-matrix",
110 Property::BOOLEAN, // "invert-y-axis",
114 * Builds the picking ray in the world reference system from an orthographic camera
115 * The ray origin is the screen coordinate in the near plane translated to a parallel
116 * plane at the camera origin. The ray direction is the direction the camera is facing
117 * (i.e. Z=-1 in view space).
119 void BuildOrthoPickingRay( const Matrix& viewMatrix,
120 const Matrix& projectionMatrix,
121 const Viewport& viewport,
126 float nearPlaneDistance )
128 // inv( modelMatrix ) inv( viewMatrix ) inv( projectionMatrix ) normalize
129 // <----------------- <----------------- <-------------- <-------------
130 // Local World Camera Normalized Screen
131 // reference reference reference clip coordinates
132 // system system system coordinates
133 // -----------------> -----------------> --------------> ------------->
134 // modelMatrix viewMatrix projectionMatrix viewport
136 // Transforms the touch point from the screen reference system to the world reference system.
137 Matrix invViewProjection( false ); // Don't initialize.
138 Matrix::Multiply( invViewProjection, viewMatrix, projectionMatrix );
139 if( !invViewProjection.Invert() )
141 DALI_ASSERT_DEBUG( false );
144 Vector4 near( screenX - viewport.x, viewport.height - (screenY - viewport.y), 0.f, 1.f );
145 if( !Unproject( near, invViewProjection, viewport.width, viewport.height, rayOrigin ) )
147 DALI_ASSERT_DEBUG( false );
150 Matrix invView = viewMatrix;
151 if( !invView.Invert() )
153 DALI_ASSERT_DEBUG( false );
156 Vector4 cameraOrigin = invView * Vector4( 0.f, 0.f, 0.f, 1.f );
157 Vector4 nearPlaneOrigin = invView * Vector4( 0.0f, 0.0f, -nearPlaneDistance, 1.0f);
159 // Vector pointing from the camera to the near plane
160 rayDir = cameraOrigin - nearPlaneOrigin;
168 CameraActorPtr CameraActor::New( const Size& size )
170 CameraActorPtr actor(new CameraActor());
172 // Second-phase construction
176 actor->SetName("DefaultCamera");
178 // Create the attachment
179 actor->mCameraAttachment = CameraAttachment::New( *actor->mNode );
181 actor->Attach(*actor->mCameraAttachment);
183 actor->SetPerspectiveProjection( size );
185 // By default Actors face in the positive Z direction in world space
186 // CameraActors should face in the negative Z direction, towards the other actors
187 actor->SetRotation( Quaternion( Math::PI, Vector3::YAXIS ) );
192 void CameraActor::OnInitialize()
194 if(CameraActor::mFirstInstance)
196 mDefaultCameraActorPropertyLookup = new DefaultPropertyLookup();
197 const int start = DEFAULT_ACTOR_PROPERTY_MAX_COUNT;
198 for ( int i = 0; i < DEFAULT_CAMERA_ACTOR_PROPERTY_COUNT; ++i )
200 (*mDefaultCameraActorPropertyLookup)[DEFAULT_CAMERA_ACTOR_PROPERTY_NAMES[i]] = i + start;
202 CameraActor::mFirstInstance = false;
206 CameraActor::CameraActor()
207 : Actor( Actor::BASIC )
211 CameraActor::~CameraActor()
215 void CameraActor::SetType( Dali::Camera::Type type )
217 mCameraAttachment->SetType(type);
220 Dali::Camera::Type CameraActor::GetType() const
222 return mCameraAttachment->GetType();
225 void CameraActor::SetProjectionMode( Dali::Camera::ProjectionMode mode )
227 mCameraAttachment->SetProjectionMode(mode);
230 Dali::Camera::ProjectionMode CameraActor::GetProjectionMode() const
232 return mCameraAttachment->GetProjectionMode();
235 void CameraActor::SetFieldOfView( float fieldOfView )
237 mCameraAttachment->SetFieldOfView(fieldOfView);
240 float CameraActor::GetFieldOfView( ) const
242 return mCameraAttachment->GetFieldOfView();
245 void CameraActor::SetAspectRatio( float aspectRatio )
247 mCameraAttachment->SetAspectRatio(aspectRatio);
250 float CameraActor::GetAspectRatio( ) const
252 return mCameraAttachment->GetAspectRatio();
255 void CameraActor::SetNearClippingPlane( float nearClippingPlane )
257 mCameraAttachment->SetNearClippingPlane(nearClippingPlane);
260 float CameraActor::GetNearClippingPlane( ) const
262 return mCameraAttachment->GetNearClippingPlane();
265 void CameraActor::SetFarClippingPlane( float farClippingPlane )
267 mCameraAttachment->SetFarClippingPlane(farClippingPlane);
270 float CameraActor::GetFarClippingPlane( ) const
272 return mCameraAttachment->GetFarClippingPlane();
275 void CameraActor::SetTargetPosition(const Vector3& target)
277 mCameraAttachment->SetTargetPosition(target);
280 Vector3 CameraActor::GetTargetPosition() const
282 return mCameraAttachment->GetTargetPosition();
285 void CameraActor::SetInvertYAxis(bool invertYAxis)
287 mCameraAttachment->SetInvertYAxis(invertYAxis);
290 bool CameraActor::GetInvertYAxis() const
292 return mCameraAttachment->GetInvertYAxis();
295 void CameraActor::SetPerspectiveProjection( const Size& size, float stereoBias /* = 0.0f */ )
297 float width = size.width;
298 float height = size.height;
300 if( Size::ZERO == size )
302 if( Stage::IsInstalled() )
304 const Size& stageSize = mStage->GetSize();
306 width = stageSize.width;
307 height = stageSize.height;
311 if( ( width < Math::MACHINE_EPSILON_1000 ) || ( height < Math::MACHINE_EPSILON_1000 ) )
313 // On the stage initialization this method is called but the size has not been set.
314 // There is no point to set any value if width or height is zero.
318 float nearClippingPlane;
319 float farClippingPlane;
321 CalculateClippingAndZ( width, height, nearClippingPlane, farClippingPlane, cameraZ );
323 // calculate the position of the camera to have the desired aspect ratio
324 const float fieldOfView = 2.0f * std::atan( height * 0.5f / cameraZ );
326 // unless it is too small, we want at least as much space to the back as we have torwards the front
327 const float minClippingFarPlane = 2.f * nearClippingPlane;
328 if ( farClippingPlane < minClippingFarPlane )
330 farClippingPlane = minClippingFarPlane;
333 const float aspectRatio = width / height;
335 SetProjectionMode(Dali::Camera::PERSPECTIVE_PROJECTION);
336 SetFieldOfView( fieldOfView );
337 SetNearClippingPlane( nearClippingPlane );
338 SetFarClippingPlane( farClippingPlane );
339 SetAspectRatio( aspectRatio );
340 mCameraAttachment->SetStereoBias( stereoBias );
345 void CameraActor::SetOrthographicProjection( const Vector2& size )
347 // Choose near, far and Z parameters to match the SetPerspectiveProjection above.
348 float nearClippingPlane;
349 float farClippingPlane;
351 CalculateClippingAndZ( size.width, size.height, nearClippingPlane, farClippingPlane, cameraZ );
352 SetOrthographicProjection( -size.x*0.5f, size.x*0.5f, size.y*0.5f, -size.y*0.5f,
353 nearClippingPlane, farClippingPlane );
357 void CameraActor::SetOrthographicProjection( float left, float right, float top, float bottom, float near, float far )
359 mCameraAttachment->SetLeftClippingPlane(left);
360 mCameraAttachment->SetRightClippingPlane(right);
361 mCameraAttachment->SetTopClippingPlane(top);
362 mCameraAttachment->SetBottomClippingPlane(bottom);
363 SetNearClippingPlane( near );
364 SetFarClippingPlane( far );
365 SetProjectionMode(Dali::Camera::ORTHOGRAPHIC_PROJECTION);
368 bool CameraActor::BuildPickingRay( const Vector2& screenCoordinates,
369 const Viewport& viewport,
371 Vector4& rayDirection )
374 if( GetProjectionMode() == Dali::Camera::PERSPECTIVE_PROJECTION )
376 // Build a picking ray in the world reference system.
377 // ray starts from the camera world position
378 rayOrigin = mNode->GetWorldPosition( mStage->GetEventBufferIndex() );
381 // Transform the touch point from the screen coordinate system to the world coordinates system.
382 Vector4 near( screenCoordinates.x - viewport.x, viewport.height - (screenCoordinates.y - viewport.y), 0.f, 1.f );
383 if( !Unproject( near, mCameraAttachment->GetInverseViewProjectionMatrix(), viewport.width, viewport.height, near ) )
385 // unproject failed so no picking ray possible
389 // Compute the ray's director vector.
390 rayDirection.x = near.x - rayOrigin.x;
391 rayDirection.y = near.y - rayOrigin.y;
392 rayDirection.z = near.z - rayOrigin.z;
393 rayDirection.Normalize();
394 rayDirection.w = 1.f;
398 float nearPlaneDistance = GetNearClippingPlane();
399 BuildOrthoPickingRay( GetViewMatrix(),
400 GetProjectionMatrix(),
401 viewport, screenCoordinates.x,
411 const Matrix& CameraActor::GetViewMatrix() const
415 return mCameraAttachment->GetViewMatrix();
419 return Matrix::IDENTITY;
423 const Matrix& CameraActor::GetProjectionMatrix() const
427 return mCameraAttachment->GetProjectionMatrix();
431 return Matrix::IDENTITY;
435 unsigned int CameraActor::GetDefaultPropertyCount() const
437 return Actor::GetDefaultPropertyCount() + DEFAULT_CAMERA_ACTOR_PROPERTY_COUNT;
440 void CameraActor::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
442 Actor::GetDefaultPropertyIndices( indices ); // Actor class properties
444 indices.reserve( indices.size() + DEFAULT_CAMERA_ACTOR_PROPERTY_COUNT );
446 int index = DEFAULT_ACTOR_PROPERTY_MAX_COUNT;
447 for ( int i = 0; i < DEFAULT_CAMERA_ACTOR_PROPERTY_COUNT; ++i, ++index )
449 indices.push_back( index );
453 bool CameraActor::IsDefaultPropertyWritable( Property::Index index ) const
455 if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)
457 return Actor::IsDefaultPropertyWritable(index);
461 if( Dali::CameraActor::PROJECTION_MATRIX == index || Dali::CameraActor::VIEW_MATRIX == index )
472 bool CameraActor::IsDefaultPropertyAnimatable( Property::Index index ) const
474 bool animatable = false; // Our properties are not animatable.
476 if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
478 animatable = Actor::IsDefaultPropertyAnimatable(index);
483 bool CameraActor::IsDefaultPropertyAConstraintInput( Property::Index index ) const
485 bool animatable = true; // Our properties can be used as inputs to constraints.
487 if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
489 animatable = Actor::IsDefaultPropertyAConstraintInput(index);
494 Property::Type CameraActor::GetDefaultPropertyType( Property::Index index ) const
496 if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)
498 return Actor::GetDefaultPropertyType(index);
502 index -= DEFAULT_ACTOR_PROPERTY_MAX_COUNT;
504 if ( ( index >= 0 ) && ( index < DEFAULT_CAMERA_ACTOR_PROPERTY_COUNT ) )
506 return DEFAULT_CAMERA_ACTOR_PROPERTY_TYPES[index];
510 // index out-of-bounds
511 return Property::NONE;
516 const std::string& CameraActor::GetDefaultPropertyName( Property::Index index ) const
518 if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)
520 return Actor::GetDefaultPropertyName(index);
524 index -= DEFAULT_ACTOR_PROPERTY_MAX_COUNT;
526 if ( ( index >= 0 ) && ( index < DEFAULT_CAMERA_ACTOR_PROPERTY_COUNT ) )
528 return DEFAULT_CAMERA_ACTOR_PROPERTY_NAMES[index];
532 // index out-of-bounds
533 static const std::string INVALID_PROPERTY_NAME;
534 return INVALID_PROPERTY_NAME;
539 Property::Index CameraActor::GetDefaultPropertyIndex(const std::string& name) const
541 Property::Index index = Property::INVALID_INDEX;
543 DALI_ASSERT_DEBUG( NULL != mDefaultCameraActorPropertyLookup );
545 // Look for name in current class' default properties
546 DefaultPropertyLookup::const_iterator result = mDefaultCameraActorPropertyLookup->find( name );
547 if ( mDefaultCameraActorPropertyLookup->end() != result )
549 index = result->second;
553 // If not found, check in base class
554 index = Actor::GetDefaultPropertyIndex( name );
560 void CameraActor::SetDefaultProperty( Property::Index index, const Property::Value& propertyValue )
562 if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)
564 Actor::SetDefaultProperty(index, propertyValue);
568 DALI_ASSERT_DEBUG(mCameraAttachment && "where is the camera?");
571 case Dali::CameraActor::TYPE:
573 std::string s(propertyValue.Get<std::string>());
574 if(s == "LOOK_AT_TARGET")
576 mCameraAttachment->SetType(Dali::Camera::LOOK_AT_TARGET);
578 else if(s == "FREE_LOOK")
580 mCameraAttachment->SetType(Dali::Camera::FREE_LOOK);
584 DALI_LOG_WARNING("Unknown camera type\n");
588 case Dali::CameraActor::PROJECTION_MODE:
590 std::string s(propertyValue.Get<std::string>());
591 if(s == "PERSPECTIVE_PROJECTION")
593 mCameraAttachment->SetProjectionMode(Dali::Camera::PERSPECTIVE_PROJECTION);
595 else if(s == "ORTHOGRAPHIC_PROJECTION")
597 mCameraAttachment->SetProjectionMode(Dali::Camera::ORTHOGRAPHIC_PROJECTION);
601 DALI_LOG_WARNING("Unknown projection mode\n");
605 case Dali::CameraActor::FIELD_OF_VIEW:
607 mCameraAttachment->SetFieldOfView(propertyValue.Get<float>());
610 case Dali::CameraActor::ASPECT_RATIO:
612 mCameraAttachment->SetAspectRatio(propertyValue.Get<float>());
615 case Dali::CameraActor::LEFT_PLANE_DISTANCE:
617 mCameraAttachment->SetLeftClippingPlane(propertyValue.Get<float>());
620 case Dali::CameraActor::RIGHT_PLANE_DISTANCE:
622 mCameraAttachment->SetRightClippingPlane(propertyValue.Get<float>());
625 case Dali::CameraActor::TOP_PLANE_DISTANCE:
627 mCameraAttachment->SetTopClippingPlane(propertyValue.Get<float>());
630 case Dali::CameraActor::BOTTOM_PLANE_DISTANCE:
632 mCameraAttachment->SetBottomClippingPlane(propertyValue.Get<float>());
635 case Dali::CameraActor::NEAR_PLANE_DISTANCE:
637 mCameraAttachment->SetNearClippingPlane(propertyValue.Get<float>());
640 case Dali::CameraActor::FAR_PLANE_DISTANCE:
642 mCameraAttachment->SetFarClippingPlane(propertyValue.Get<float>());
645 case Dali::CameraActor::TARGET_POSITION:
647 mCameraAttachment->SetTargetPosition(propertyValue.Get<Vector3>());
650 case Dali::CameraActor::PROJECTION_MATRIX:
652 DALI_LOG_WARNING("projection-matrix property is not animatable \n");
655 case Dali::CameraActor::VIEW_MATRIX:
657 DALI_LOG_WARNING("view-matrix property is not animatable \n");
660 case Dali::CameraActor::INVERT_Y_AXIS:
662 mCameraAttachment->SetInvertYAxis(propertyValue.Get<bool>());
667 DALI_LOG_WARNING("Unknown property (%d)\n", index);
675 Property::Value CameraActor::GetDefaultProperty( Property::Index index ) const
678 if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)
680 ret = Actor::GetDefaultProperty(index);
684 DALI_ASSERT_DEBUG(mCameraAttachment && "where is the camera?");
688 case Dali::CameraActor::TYPE:
690 if(mCameraAttachment->GetType() == Dali::Camera::LOOK_AT_TARGET)
692 ret = "LOOK_AT_TARGET";
694 else if(mCameraAttachment->GetType() == Dali::Camera::FREE_LOOK)
701 DALI_ASSERT_DEBUG("Unknown camera type\n");
707 case Dali::CameraActor::PROJECTION_MODE:
709 if(mCameraAttachment->GetProjectionMode() == Dali::Camera::PERSPECTIVE_PROJECTION)
711 ret = "PERSPECTIVE_PROJECTION";
713 else if(mCameraAttachment->GetProjectionMode() == Dali::Camera::ORTHOGRAPHIC_PROJECTION)
715 ret = "ORTHOGRAPHIC_PROJECTION";
720 DALI_ASSERT_DEBUG("Unknown projection mode\n");
724 case Dali::CameraActor::FIELD_OF_VIEW:
726 ret = mCameraAttachment->GetFieldOfView();
729 case Dali::CameraActor::ASPECT_RATIO:
731 ret = mCameraAttachment->GetAspectRatio();
734 case Dali::CameraActor::LEFT_PLANE_DISTANCE:
736 ret = mCameraAttachment->GetLeftClippingPlane();
739 case Dali::CameraActor::RIGHT_PLANE_DISTANCE:
741 ret = mCameraAttachment->GetRightClippingPlane();
744 case Dali::CameraActor::TOP_PLANE_DISTANCE:
746 ret = mCameraAttachment->GetTopClippingPlane();
749 case Dali::CameraActor::BOTTOM_PLANE_DISTANCE:
751 ret = mCameraAttachment->GetBottomClippingPlane();
754 case Dali::CameraActor::NEAR_PLANE_DISTANCE:
756 ret = mCameraAttachment->GetNearClippingPlane();
759 case Dali::CameraActor::FAR_PLANE_DISTANCE:
761 ret = mCameraAttachment->GetFarClippingPlane();
764 case Dali::CameraActor::TARGET_POSITION:
766 ret = mCameraAttachment->GetTargetPosition();
769 case Dali::CameraActor::PROJECTION_MATRIX:
771 ret = mCameraAttachment->GetProjectionMatrix();
774 case Dali::CameraActor::VIEW_MATRIX:
776 ret = mCameraAttachment->GetViewMatrix();
779 case Dali::CameraActor::INVERT_Y_AXIS:
781 ret = mCameraAttachment->GetInvertYAxis();
786 DALI_LOG_WARNING("Unknown property (%d)\n", index);
795 const SceneGraph::PropertyBase* CameraActor::GetSceneObjectAnimatableProperty( Property::Index index ) const
797 DALI_ASSERT_ALWAYS( IsPropertyAnimatable(index) && "Property is not animatable" );
799 const SceneGraph::PropertyBase* property( NULL );
801 // This method should only return a property of an object connected to the scene-graph
807 // let actor handle animatable properties, we have no animatable properties
808 if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
810 property = Actor::GetSceneObjectAnimatableProperty(index);
816 const PropertyInputImpl* CameraActor::GetSceneObjectInputProperty( Property::Index index ) const
818 const PropertyInputImpl* property( NULL );
820 // This method should only return a property of an object connected to the scene-graph
826 // if its an actor default property or a custom property (actor already handles custom properties)
827 if( ( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT ) || ( index >= DEFAULT_PROPERTY_MAX_COUNT ) )
829 property = Actor::GetSceneObjectInputProperty(index);
835 case Dali::CameraActor::PROJECTION_MATRIX:
837 property = mCameraAttachment->GetProjectionMatrixProperty();
840 case Dali::CameraActor::VIEW_MATRIX:
842 property = mCameraAttachment->GetViewMatrixProperty();
846 DALI_LOG_WARNING("Not an input property (%d)\n", index);
855 } // namespace Internal