1 #ifndef __DALI_INTEGRATION_DYNAMICS_JOINT_INTF_H__
2 #define __DALI_INTEGRATION_DYNAMICS_JOINT_INTF_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/public-api/common/dali-common.h>
38 class DALI_IMPORT_API DynamicsJoint
44 virtual ~DynamicsJoint() {}
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
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;
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
66 virtual void SetLimit( int axisIndex, float lowerLimit, float upperLimit ) = 0;
68 /// @copydoc Dali::Internal::DynamicsJoint::EnableSpring
69 virtual void EnableSpring( int axisIndex, bool flag ) = 0;
71 /// @copydoc Dali::Internal::DynamicsJoint::SetSpringStiffness
72 virtual void SetSpringStiffness( int axisIndex, float stiffness ) = 0;
74 /// @copydoc Dali::Internal::DynamicsJoint::SetSpringDamping
75 virtual void SetSpringDamping( int axisIndex, float damping ) = 0;
77 /// @copydoc Dali::Internal::DynamicsJoint::SetSpringCenterPoint
78 virtual void SetSpringCenterPoint( int axisIndex, float ratio ) = 0;
80 /// @copydoc Dali::Internal::DynamicsJoint::EnableMotor
81 virtual void EnableMotor( int axisIndex, bool flag ) = 0;
83 /// @copydoc Dali::Internal::DynamicsJoint::SetMotorVelocity
84 virtual void SetMotorVelocity( int axisIndex, float velocity ) = 0;
86 /// @copydoc Dali::Internal::DynamicsJoint::SetMotorForce
87 virtual void SetMotorForce( int axisIndex, float force ) = 0;
88 }; // class DynamicsJoint
90 } // namespace Integration
94 #endif // __DALI_INTEGRATION_DYNAMICS_JOINT_INTF_H__