Merge "Combine Internal::ProxyObject & Internal::Object" into tizen
[platform/core/uifw/dali-core.git] / dali / internal / event / modeling / light-impl.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/internal/event/modeling/light-impl.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/common/constants.h>
23
24 namespace
25 {
26 const float DEFAULT_FALLOFF_START = 0.0f;
27 const float DEFAULT_FALLOFF_END   = 10000.0f;
28 const float DEFAULT_SPOT_CONE     = 90.0f;
29 }
30
31 namespace Dali
32 {
33
34 namespace Internal
35 {
36
37 Light::Light(const std::string& name)
38 : mName(name),
39   mType(POINT),
40   mFallOff(DEFAULT_FALLOFF_START, DEFAULT_FALLOFF_END),
41   mSpotAngle(DEFAULT_SPOT_CONE, DEFAULT_SPOT_CONE),
42   mAmbientColor(Color::BLACK),
43   mDiffuseColor(Color::WHITE),
44   mSpecularColor(Color::WHITE),
45   mDirection(Vector3::NEGATIVE_ZAXIS)
46 {
47 }
48
49 /**
50  * Copy Constructor
51  */
52 Light::Light(const Light& rhs)
53 : mName(rhs.mName),
54   mType(rhs.mType),
55   mFallOff(rhs.mFallOff),
56   mSpotAngle(rhs.mSpotAngle),
57   mAmbientColor(rhs.mAmbientColor),
58   mDiffuseColor(rhs.mDiffuseColor),
59   mSpecularColor(rhs.mSpecularColor),
60   mDirection(rhs.mDirection)
61 {
62 }
63
64 /**
65  * Assignment operator
66  */
67 Light& Light::operator=(const Light& rhs)
68 {
69   if( this != &rhs)
70   {
71     mName           = rhs.mName;
72     mType           = rhs.mType;
73     mFallOff        = rhs.mFallOff;
74     mSpotAngle      = rhs.mSpotAngle;
75     mAmbientColor   = rhs.mAmbientColor;
76     mDiffuseColor   = rhs.mDiffuseColor;
77     mSpecularColor  = rhs.mSpecularColor;
78     mDirection      = rhs.mDirection;
79   }
80
81   return *this;
82 }
83
84 Light::~Light()
85 {
86 }
87
88 } // namespace Internal
89
90 } // namespace Dali