2 * Copyright(c) 2022 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.
18 using System.ComponentModel;
19 using Tizen.NUI.Binding;
21 namespace Tizen.NUI.Scene3D
23 public partial class Camera
26 /// ProjectionModeProperty
28 internal static readonly BindableProperty ProjectionProperty = BindableProperty.Create(nameof(ProjectionMode), typeof(ProjectionModeType), typeof(Tizen.NUI.Scene3D.Camera), ProjectionModeType.Perspective, propertyChanged: (bindable, oldValue, newValue) =>
30 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
33 instance.InternalProjectionMode = (ProjectionModeType)newValue;
36 defaultValueCreator: (bindable) =>
38 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
39 return instance.InternalProjectionMode;
43 /// ProjectionDirectionProperty
45 internal static readonly BindableProperty ProjectionDirectionProperty = BindableProperty.Create(nameof(ProjectionDirection), typeof(ProjectionDirectionType), typeof(Tizen.NUI.Scene3D.Camera), ProjectionDirectionType.Vertical, propertyChanged: (bindable, oldValue, newValue) =>
47 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
50 // Keep previous orthographicSize.
51 float orthographicSize = instance.OrthographicSize;
52 instance.InternalProjectionDirection = (ProjectionDirectionType)newValue;
54 // Recalculate orthographicSize by changed direction.
55 instance.OrthographicSize = orthographicSize;
58 defaultValueCreator: (bindable) =>
60 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
61 return instance.InternalProjectionDirection;
65 /// FieldOfViewProperty
67 internal static readonly BindableProperty FieldOfViewProperty = BindableProperty.Create(nameof(FieldOfView), typeof(float), typeof(Tizen.NUI.Scene3D.Camera), default(float), propertyChanged: (bindable, oldValue, newValue) =>
69 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
72 instance.InternalFieldOfView = (float)newValue;
75 defaultValueCreator: (bindable) =>
77 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
78 return instance.InternalFieldOfView;
82 /// OrthographicSizeProperty
84 internal static readonly BindableProperty OrthographicSizeProperty = BindableProperty.Create(nameof(OrthographicSize), typeof(float), typeof(Tizen.NUI.Scene3D.Camera), default(float), propertyChanged: (bindable, oldValue, newValue) =>
86 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
89 instance.InternalOrthographicSize = (float)newValue;
92 defaultValueCreator: (bindable) =>
94 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
95 return instance.InternalOrthographicSize;
99 /// AspectRatioProperty
101 internal static readonly BindableProperty AspectRatioProperty = BindableProperty.Create(nameof(AspectRatio), typeof(float), typeof(Tizen.NUI.Scene3D.Camera), default(float), propertyChanged: (bindable, oldValue, newValue) =>
103 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
104 if (newValue != null)
106 instance.InternalAspectRatio = (float)newValue;
109 defaultValueCreator: (bindable) =>
111 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
112 return instance.InternalAspectRatio;
116 /// NearPlaneDistanceProperty
118 internal static readonly BindableProperty NearPlaneDistanceProperty = BindableProperty.Create(nameof(NearPlaneDistance), typeof(float), typeof(Tizen.NUI.Scene3D.Camera), default(float), propertyChanged: (bindable, oldValue, newValue) =>
120 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
121 if (newValue != null)
123 instance.InternalNearPlaneDistance = (float)newValue;
126 defaultValueCreator: (bindable) =>
128 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
129 return instance.InternalNearPlaneDistance;
133 /// FarPlaneDistanceProperty
135 internal static readonly BindableProperty FarPlaneDistanceProperty = BindableProperty.Create(nameof(FarPlaneDistance), typeof(float), typeof(Tizen.NUI.Scene3D.Camera), default(float), propertyChanged: (bindable, oldValue, newValue) =>
137 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
138 if (newValue != null)
140 instance.InternalFarPlaneDistance = (float)newValue;
143 defaultValueCreator: (bindable) =>
145 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
146 return instance.InternalFarPlaneDistance;
150 /// LeftPlaneDistanceProperty
152 internal static readonly BindableProperty LeftPlaneDistanceProperty = BindableProperty.Create(nameof(LeftPlaneDistance), typeof(float), typeof(Tizen.NUI.Scene3D.Camera), default(float), propertyChanged: (bindable, oldValue, newValue) =>
154 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
155 if (newValue != null)
157 instance.InternalLeftPlaneDistance = (float)newValue;
160 defaultValueCreator: (bindable) =>
162 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
163 return instance.InternalLeftPlaneDistance;
167 /// RightPlaneDistanceProperty
169 internal static readonly BindableProperty RightPlaneDistanceProperty = BindableProperty.Create(nameof(RightPlaneDistance), typeof(float), typeof(Tizen.NUI.Scene3D.Camera), default(float), propertyChanged: (bindable, oldValue, newValue) =>
171 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
172 if (newValue != null)
174 instance.InternalRightPlaneDistance = (float)newValue;
177 defaultValueCreator: (bindable) =>
179 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
180 return instance.InternalRightPlaneDistance;
184 /// TopPlaneDistanceProperty
186 internal static readonly BindableProperty TopPlaneDistanceProperty = BindableProperty.Create(nameof(TopPlaneDistance), typeof(float), typeof(Tizen.NUI.Scene3D.Camera), default(float), propertyChanged: (bindable, oldValue, newValue) =>
188 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
189 if (newValue != null)
191 instance.InternalTopPlaneDistance = (float)newValue;
194 defaultValueCreator: (bindable) =>
196 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
197 return instance.InternalTopPlaneDistance;
201 /// BottomPlaneDistanceProperty
203 internal static readonly BindableProperty BottomPlaneDistanceProperty = BindableProperty.Create(nameof(BottomPlaneDistance), typeof(float), typeof(Tizen.NUI.Scene3D.Camera), default(float), propertyChanged: (bindable, oldValue, newValue) =>
205 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
206 if (newValue != null)
208 instance.InternalBottomPlaneDistance = (float)newValue;
211 defaultValueCreator: (bindable) =>
213 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
214 return instance.InternalBottomPlaneDistance;
218 /// InvertYAxisProperty
220 internal static readonly BindableProperty InvertYAxisProperty = BindableProperty.Create(nameof(InvertYAxis), typeof(bool), typeof(Tizen.NUI.Scene3D.Camera), false, propertyChanged: (bindable, oldValue, newValue) =>
222 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
223 if (newValue != null)
225 instance.InternalInvertYAxis = (bool)newValue;
228 defaultValueCreator: (bindable) =>
230 var instance = (Tizen.NUI.Scene3D.Camera)bindable;
231 return instance.InternalInvertYAxis;