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/public-api/dynamics/dynamics-joint.h>
22 #include <dali/internal/event/actors/actor-impl.h>
24 #ifdef DYNAMICS_SUPPORT
25 #include <dali/internal/event/dynamics/dynamics-joint-impl.h>
31 DynamicsJoint::DynamicsJoint()
35 DynamicsJoint::~DynamicsJoint()
39 void DynamicsJoint::SetLinearLimit( const int axisIndex, const float lowerLimit, const float upperLimit )
41 #ifdef DYNAMICS_SUPPORT
42 GetImplementation(*this).SetLinearLimit(axisIndex, lowerLimit, upperLimit);
46 void DynamicsJoint::SetAngularLimit( const int axisIndex, const Degree& lowerLimit, const Degree& upperLimit )
48 #ifdef DYNAMICS_SUPPORT
49 GetImplementation(*this).SetAngularLimit( axisIndex, Radian(lowerLimit), Radian(upperLimit) );
53 void DynamicsJoint::EnableSpring(const int axisIndex, const bool flag)
55 #ifdef DYNAMICS_SUPPORT
56 GetImplementation(*this).EnableSpring(axisIndex, flag);
60 void DynamicsJoint::SetSpringStiffness(const int axisIndex, const float stiffness)
62 #ifdef DYNAMICS_SUPPORT
63 GetImplementation(*this).SetSpringStiffness(axisIndex, stiffness);
67 void DynamicsJoint::SetSpringDamping(const int axisIndex, const float damping)
69 #ifdef DYNAMICS_SUPPORT
70 GetImplementation(*this).SetSpringDamping(axisIndex, damping);
74 void DynamicsJoint::SetSpringCenterPoint(const int axisIndex, const float ratio)
76 #ifdef DYNAMICS_SUPPORT
77 GetImplementation(*this).SetSpringCenterPoint(axisIndex, ratio);
81 void DynamicsJoint::EnableMotor(const int axisIndex, const bool flag)
83 #ifdef DYNAMICS_SUPPORT
84 GetImplementation(*this).EnableMotor(axisIndex, flag);
88 void DynamicsJoint::SetMotorVelocity(const int axisIndex, const float velocity)
90 #ifdef DYNAMICS_SUPPORT
91 GetImplementation(*this).SetMotorVelocity(axisIndex, velocity);
95 void DynamicsJoint::SetMotorForce(const int axisIndex, const float force)
97 #ifdef DYNAMICS_SUPPORT
98 GetImplementation(*this).SetMotorForce(axisIndex, force);
102 Actor DynamicsJoint::GetActor( const bool first ) const
104 #ifdef DYNAMICS_SUPPORT
105 Internal::ActorPtr internal( GetImplementation(*this).GetActor(first) );
107 return Actor(internal.Get());
113 DynamicsJoint::DynamicsJoint(Internal::DynamicsJoint* internal)
114 #ifdef DYNAMICS_SUPPORT
115 : BaseHandle(internal)