*/
// clang-format off
DALI_PROPERTY_TABLE_BEGIN
-DALI_PROPERTY( "type", STRING, true, false, true, Dali::CameraActor::Property::TYPE )
-DALI_PROPERTY( "projectionMode", STRING, true, false, true, Dali::CameraActor::Property::PROJECTION_MODE )
+DALI_PROPERTY( "type", INTEGER, true, false, true, Dali::CameraActor::Property::TYPE )
+DALI_PROPERTY( "projectionMode", INTEGER, true, false, true, Dali::CameraActor::Property::PROJECTION_MODE )
DALI_PROPERTY( "fieldOfView", FLOAT, true, false, true, Dali::CameraActor::Property::FIELD_OF_VIEW )
DALI_PROPERTY( "aspectRatio", FLOAT, true, false, true, Dali::CameraActor::Property::ASPECT_RATIO )
DALI_PROPERTY( "nearPlaneDistance", FLOAT, true, false, true, Dali::CameraActor::Property::NEAR_PLANE_DISTANCE )
mRightClippingPlane(SceneGraph::Camera::DEFAULT_RIGHT_CLIPPING_PLANE),
mTopClippingPlane(SceneGraph::Camera::DEFAULT_TOP_CLIPPING_PLANE),
mBottomClippingPlane(SceneGraph::Camera::DEFAULT_BOTTOM_CLIPPING_PLANE),
- mInvertYAxis(SceneGraph::Camera::DEFAULT_INVERT_Y_AXIS)
+ mInvertYAxis(SceneGraph::Camera::DEFAULT_INVERT_Y_AXIS),
+ mPropertyChanged(false)
{
}
{
// If the canvas size has not been set, then use the size of the scene to which we've been added
// in order to set up the current projection
- if((mCanvasSize.width < Math::MACHINE_EPSILON_1000) || (mCanvasSize.height < Math::MACHINE_EPSILON_1000))
+ if(!mPropertyChanged && ((mCanvasSize.width < Math::MACHINE_EPSILON_1000) || (mCanvasSize.height < Math::MACHINE_EPSILON_1000)))
{
if(mProjectionMode == Dali::Camera::ORTHOGRAPHIC_PROJECTION)
{
void CameraActor::SetTarget(const Vector3& target)
{
+ mPropertyChanged = true;
if(target != mTarget) // using range epsilon
{
mTarget = target;
void CameraActor::SetFieldOfView(float fieldOfView)
{
+ mPropertyChanged = true;
if(!Equals(fieldOfView, mFieldOfView))
{
mFieldOfView = fieldOfView;
void CameraActor::SetAspectRatio(float aspectRatio)
{
+ mPropertyChanged = true;
if(!Equals(aspectRatio, mAspectRatio))
{
mAspectRatio = aspectRatio;
void CameraActor::SetNearClippingPlane(float nearClippingPlane)
{
+ mPropertyChanged = true;
if(!Equals(nearClippingPlane, mNearClippingPlane))
{
mNearClippingPlane = nearClippingPlane;
void CameraActor::SetFarClippingPlane(float farClippingPlane)
{
+ mPropertyChanged = true;
if(!Equals(farClippingPlane, mFarClippingPlane))
{
mFarClippingPlane = farClippingPlane;
void CameraActor::SetLeftClippingPlane(float leftClippingPlane)
{
+ mPropertyChanged = true;
if(!Equals(leftClippingPlane, mLeftClippingPlane))
{
mLeftClippingPlane = leftClippingPlane;
void CameraActor::SetRightClippingPlane(float rightClippingPlane)
{
+ mPropertyChanged = true;
if(!Equals(rightClippingPlane, mRightClippingPlane))
{
mRightClippingPlane = rightClippingPlane;
void CameraActor::SetTopClippingPlane(float topClippingPlane)
{
+ mPropertyChanged = true;
if(!Equals(topClippingPlane, mTopClippingPlane))
{
mTopClippingPlane = topClippingPlane;
void CameraActor::SetBottomClippingPlane(float bottomClippingPlane)
{
+ mPropertyChanged = true;
if(!Equals(bottomClippingPlane, mBottomClippingPlane))
{
mBottomClippingPlane = bottomClippingPlane;
{
case Dali::CameraActor::Property::TYPE:
{
- std::string s(propertyValue.Get<std::string>());
- if(s == "LOOK_AT_TARGET")
- {
- SetType(Dali::Camera::LOOK_AT_TARGET);
- }
- else if(s == "FREE_LOOK")
- {
- SetType(Dali::Camera::FREE_LOOK);
- }
+ Dali::Camera::Type cameraType = Dali::Camera::Type(propertyValue.Get<int>());
+ SetType(cameraType);
break;
}
case Dali::CameraActor::Property::PROJECTION_MODE:
{
- std::string s(propertyValue.Get<std::string>());
- if(s == "PERSPECTIVE_PROJECTION")
- {
- SetProjectionMode(Dali::Camera::PERSPECTIVE_PROJECTION);
- }
- else if(s == "ORTHOGRAPHIC_PROJECTION")
- {
- SetProjectionMode(Dali::Camera::ORTHOGRAPHIC_PROJECTION);
- }
+ Dali::Camera::ProjectionMode projectionMode = Dali::Camera::ProjectionMode(propertyValue.Get<int>());
+ SetProjectionMode(projectionMode);
break;
}
case Dali::CameraActor::Property::FIELD_OF_VIEW:
{
case Dali::CameraActor::Property::TYPE:
{
- if(Dali::Camera::LOOK_AT_TARGET == mType)
- {
- ret = "LOOK_AT_TARGET";
- }
- else if(Dali::Camera::FREE_LOOK == mType)
- {
- ret = "FREE_LOOK";
- }
+ ret = mType;
break;
}
case Dali::CameraActor::Property::PROJECTION_MODE:
{
- if(Dali::Camera::PERSPECTIVE_PROJECTION == mProjectionMode)
- {
- ret = "PERSPECTIVE_PROJECTION";
- }
- else if(Dali::Camera::ORTHOGRAPHIC_PROJECTION == mProjectionMode)
- {
- ret = "ORTHOGRAPHIC_PROJECTION";
- }
+ ret = mProjectionMode;
break;
}
case Dali::CameraActor::Property::FIELD_OF_VIEW:
return property;
}
+void CameraActor::OnPropertySet(Property::Index index, const Property::Value& propertyValue)
+{
+ // If Position or Orientation are explicitly set, make mPropertyChanged flag true.
+ if(index == Dali::Actor::Property::POSITION ||
+ index == Dali::Actor::Property::POSITION_X ||
+ index == Dali::Actor::Property::POSITION_Y ||
+ index == Dali::Actor::Property::POSITION_Z ||
+ index == Dali::Actor::Property::ORIENTATION)
+ {
+ mPropertyChanged = true;
+ }
+}
+
} // namespace Internal
} // namespace Dali