DALI_PROPERTY( "projectionMatrix", MATRIX, false, false, true, Dali::CameraActor::Property::PROJECTION_MATRIX )
DALI_PROPERTY( "viewMatrix", MATRIX, false, false, true, Dali::CameraActor::Property::VIEW_MATRIX )
DALI_PROPERTY( "invertYAxis", BOOLEAN, true, false, true, Dali::CameraActor::Property::INVERT_Y_AXIS )
-DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX )
+DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX, CameraDefaultProperties )
// calculate the far plane distance for a 16bit depth buffer with 4 bits per unit precision
void CalculateClippingAndZ( float width, float height, float& nearClippingPlane, float& farClippingPlane, float& cameraZ )
return Dali::CameraActor::New();
}
-TypeRegistration mType( typeid( Dali::CameraActor ), typeid( Dali::Actor ), Create );
+TypeRegistration mType( typeid( Dali::CameraActor ), typeid( Dali::Actor ), Create, CameraDefaultProperties );
/**
* Builds the picking ray in the world reference system from an orthographic camera
CameraActorPtr CameraActor::New( const Size& size )
{
- CameraActorPtr actor( new CameraActor() );
+ CameraActorPtr actor( new CameraActor( *CreateNode() ) );
// Second-phase construction
actor->Initialize();
return actor;
}
-CameraActor::CameraActor()
-: Actor( Actor::BASIC ),
+CameraActor::CameraActor( const SceneGraph::Node& node )
+: Actor( Actor::BASIC, node ),
mSceneObject( NULL ),
mTarget( SceneGraph::Camera::DEFAULT_TARGET_POSITION ),
mType( SceneGraph::Camera::DEFAULT_TYPE ),
SceneGraph::Camera* sceneGraphCamera = SceneGraph::Camera::New();
// Store a pointer to this camera node inside the scene-graph camera.
- sceneGraphCamera->SetNode( mNode );
+ sceneGraphCamera->SetNode( &mNode );
mSceneObject = sceneGraphCamera;
OwnerPointer< SceneGraph::Camera > sceneGraphCameraOwner( sceneGraphCamera );
{
// Build a picking ray in the world reference system.
// ray starts from the camera world position
- rayOrigin = mNode->GetWorldMatrix(0).GetTranslation();
+ rayOrigin = mNode.GetWorldMatrix(0).GetTranslation();
rayOrigin.w = 1.0f;
// Transform the touch point from the screen coordinate system to the world coordinates system.
return mSceneObject;
}
-unsigned int CameraActor::GetDefaultPropertyCount() const
-{
- return Actor::GetDefaultPropertyCount() + DEFAULT_PROPERTY_COUNT;
-}
-
-void CameraActor::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
-{
- Actor::GetDefaultPropertyIndices( indices ); // Actor class properties
-
- indices.Reserve( indices.Size() + DEFAULT_PROPERTY_COUNT );
-
- int index = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
- for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i, ++index )
- {
- indices.PushBack( index );
- }
-}
-
-bool CameraActor::IsDefaultPropertyWritable( Property::Index index ) const
-{
- if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
- {
- return Actor::IsDefaultPropertyWritable( index );
- }
-
- return DEFAULT_PROPERTY_DETAILS[index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX].writable;
-}
-
-bool CameraActor::IsDefaultPropertyAnimatable( Property::Index index ) const
-{
- if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
- {
- return Actor::IsDefaultPropertyAnimatable( index );
- }
-
- return DEFAULT_PROPERTY_DETAILS[index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX].animatable;
-}
-
-bool CameraActor::IsDefaultPropertyAConstraintInput( Property::Index index ) const
-{
- if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
- {
- return Actor::IsDefaultPropertyAConstraintInput( index );
- }
-
- return DEFAULT_PROPERTY_DETAILS[index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX].constraintInput;
-}
-
-Property::Type CameraActor::GetDefaultPropertyType( Property::Index index ) const
-{
- if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
- {
- return Actor::GetDefaultPropertyType( index );
- }
- else
- {
- index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
-
- if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
- {
- return DEFAULT_PROPERTY_DETAILS[index].type;
- }
- else
- {
- // index out-of-bounds
- return Property::NONE;
- }
- }
-}
-
-const char* CameraActor::GetDefaultPropertyName( Property::Index index ) const
-{
- if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)
- {
- return Actor::GetDefaultPropertyName(index);
- }
- else
- {
- index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
-
- if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
- {
- return DEFAULT_PROPERTY_DETAILS[index].name;
- }
- return NULL;
- }
-}
-
-Property::Index CameraActor::GetDefaultPropertyIndex(const std::string& name) const
-{
- Property::Index index = Property::INVALID_INDEX;
-
- // Look for name in current class' default properties
- for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
- {
- if( 0 == strcmp( name.c_str(), DEFAULT_PROPERTY_DETAILS[i].name ) ) // dont want to convert rhs to string
- {
- index = i + DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
- break;
- }
- }
-
- // If not found, check in base class
- if( Property::INVALID_INDEX == index )
- {
- index = Actor::GetDefaultPropertyIndex( name );
- }
-
- return index;
-}
-
void CameraActor::SetDefaultProperty( Property::Index index, const Property::Value& propertyValue )
{
if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)