License conversion from Flora to Apache 2.0
[platform/core/uifw/dali-core.git] / dali / integration-api / dynamics / dynamics-joint-intf.h
1 #ifndef __DALI_INTEGRATION_DYNAMICS_JOINT_INTF_H__
2 #define __DALI_INTEGRATION_DYNAMICS_JOINT_INTF_H__
3
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/common/dali-common.h>
23
24 namespace Dali
25 {
26
27 struct Vector3;
28 class  Quaternion;
29
30 namespace Integration
31 {
32
33 class DynamicsBody;
34
35 /**
36  *
37  */
38 class DALI_IMPORT_API DynamicsJoint
39 {
40 public:
41   /**
42    * Destructor
43    */
44   virtual ~DynamicsJoint() {}
45
46   /**
47    * Initialize the joint
48    * @param[in] bodyA   First body
49    * @param[in] positionA Position of first body
50    * @param[in] rotationA Orientation of first body
51    * @param[in] offsetA The offset (relative to bodyA) to the origin of the joint
52    * @param[in] bodyB   Second body
53    * @param[in] positionA Position of second body
54    * @param[in] rotationA Orientation of second body
55    * @param[in] offsetB The offset (relative to bodyB) to the origin of the joint
56    */
57   virtual void Initialize( DynamicsBody* bodyA, const Vector3& positionA, const Quaternion& rotationA, const Vector3& offsetA,
58                            DynamicsBody* bodyB, const Vector3& positionB, const Quaternion& rotationB, const Vector3& offsetB ) = 0;
59
60   /**
61    * Set the limits for the joint constraint
62    * @param[in] axisMask A number between 0 and 5 with 0 to 2 being Linear axis X, Y and Z and
63    *                     3 to 5 being Angular axis X, Y and Z
64    * @param[in] low
65    */
66   virtual void SetLimit( int axisIndex, float lowerLimit, float upperLimit ) = 0;
67
68   /// @copydoc Dali::Internal::DynamicsJoint::EnableSpring
69   virtual void EnableSpring( int axisIndex, bool flag ) = 0;
70
71   /// @copydoc Dali::Internal::DynamicsJoint::SetSpringStiffness
72   virtual void SetSpringStiffness( int axisIndex, float stiffness ) = 0;
73
74   /// @copydoc Dali::Internal::DynamicsJoint::SetSpringDamping
75   virtual void SetSpringDamping( int axisIndex, float damping ) = 0;
76
77   /// @copydoc Dali::Internal::DynamicsJoint::SetSpringCenterPoint
78   virtual void SetSpringCenterPoint( int axisIndex, float ratio ) = 0;
79
80   /// @copydoc Dali::Internal::DynamicsJoint::EnableMotor
81   virtual void EnableMotor( int axisIndex, bool flag ) = 0;
82
83   /// @copydoc Dali::Internal::DynamicsJoint::SetMotorVelocity
84   virtual void SetMotorVelocity( int axisIndex, float velocity ) = 0;
85
86   /// @copydoc Dali::Internal::DynamicsJoint::SetMotorForce
87   virtual void SetMotorForce( int axisIndex, float force ) = 0;
88 }; // class DynamicsJoint
89
90 } // namespace Integration
91
92 } // namespace Dali
93
94 #endif // __DALI_INTEGRATION_DYNAMICS_JOINT_INTF_H__