7759b2e9fe74ea9c20390a26ad94c3cff3fabdb0
[platform/core/uifw/dali-core.git] / automated-tests / src / dali-unmanaged / dali-test-suite-utils / test-dynamics.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 #include "test-dynamics.h"
19
20 using namespace Dali;
21
22 namespace Dali
23 {
24
25
26 TestDynamicsJoint::TestDynamicsJoint( TraceCallStack& trace )
27 : mTrace( trace )
28 {
29   mTrace.PushCall( "DynamicsJoint::DynamicsJoint", "" );
30 }
31
32 TestDynamicsJoint::~TestDynamicsJoint()
33 {
34   mTrace.PushCall( "DynamicsJoint::~DynamicsJoint", "" );
35 }
36
37 void TestDynamicsJoint::Initialize(
38   Integration::DynamicsBody* bodyA, const Vector3& positionA, const Quaternion& rotationA, const Vector3& offsetA,
39   Integration::DynamicsBody* bodyB, const Vector3& positionB, const Quaternion& rotationB, const Vector3& offsetB )
40 {
41   mTrace.PushCall( "DynamicsJoint::Initialize", "" );
42 }
43
44 void TestDynamicsJoint::SetLimit( const int axisIndex, const float lowerLimit, const float upperLimit )
45 {
46   mTrace.PushCall( "DynamicsJoint::SetLimit", "" );
47 }
48
49 void TestDynamicsJoint::EnableSpring( int axisIndex, bool flag )
50 {
51   mTrace.PushCall( "DynamicsJoint::EnableSpring", "" );
52 }
53
54 void TestDynamicsJoint::SetSpringStiffness( int axisIndex, float stiffness )
55 {
56   mTrace.PushCall( "DynamicsJoint::SetSpringStiffness", "" );
57 }
58
59 void TestDynamicsJoint::SetSpringDamping( int axisIndex, float damping )
60 {
61   mTrace.PushCall( "DynamicsJoint::SetSpringDamping", "" );
62 }
63
64 void TestDynamicsJoint::SetSpringCenterPoint( int axisIndex, float ratio )
65 {
66   mTrace.PushCall( "DynamicsJoint::SetSpringCenterPoint", "" );
67 }
68
69 void TestDynamicsJoint::EnableMotor( int axisIndex, bool flag )
70 {
71   mTrace.PushCall( "DynamicsJoint::EnableMotor", "" );
72 }
73
74 void TestDynamicsJoint::SetMotorVelocity( int axisIndex, float velocity )
75 {
76   mTrace.PushCall( "DynamicsJoint::SetMotorVelocity", "" );
77 }
78
79 void TestDynamicsJoint::SetMotorForce( int axisIndex, float force )
80 {
81   mTrace.PushCall( "DynamicsJoint::SetMotorForce", "" );
82 }
83
84
85 TestDynamicsShape::TestDynamicsShape( TraceCallStack& trace )
86 : mVertices( NULL ),
87   mFaces( NULL ),
88   mTrace( trace )
89 {
90   mTrace.PushCall( "DynamicsShape::DynamicsShape", "" );
91 }
92
93 TestDynamicsShape::~TestDynamicsShape()
94 {
95   mTrace.PushCall( "DynamicsShape::~DynamicsShape", "" );
96 }
97
98 void TestDynamicsShape::Initialize( int type, const Vector3& dimensions )
99 {
100   mTrace.PushCall( "DynamicsShape::Initialize", "" );
101 }
102
103 void TestDynamicsShape::Initialize( int type, const MeshData::VertexContainer& vertices, const MeshData::FaceIndices& faceIndices )
104 {
105   mTrace.PushCall( "DynamicsShape::Initialize", "mesh" );
106 }
107
108 TestDynamicsBody::TestDynamicsBody( TraceCallStack& trace )
109 : mSettings( NULL ),
110   mConserveVolume( false ),
111   mConserveShape( false ),
112   mKinematic( false ),
113   mActivationState( true ),
114   mCollisionGroup( 0 ),
115   mCollisionMask( 0 ),
116   mTrace( trace )
117 {
118   mTrace.PushCall( "DynamicsBody::DynamicsBody", "" );
119 }
120
121 TestDynamicsBody::~TestDynamicsBody()
122 {
123   mTrace.PushCall( "DynamicsBody::~DynamicsBody", "" );
124 }
125
126 TestDynamicsWorld::TestDynamicsWorld( TraceCallStack& trace )
127 : mSettings( NULL ),
128   mTrace( trace )
129 {
130   mTrace.PushCall( "DynamicsWorld::DynamicsWorld", "" );
131 }
132
133 TestDynamicsWorld::~TestDynamicsWorld()
134 {
135   mTrace.PushCall( "DynamicsWorld::~DynamicsWorld", "" );
136 }
137
138
139 TestDynamicsFactory::TestDynamicsFactory( TraceCallStack& trace ) : mTrace( trace )
140 {
141 }
142
143 TestDynamicsFactory::~TestDynamicsFactory()
144 {
145 }
146
147 bool TestDynamicsFactory::InitializeDynamics( const Integration::DynamicsWorldSettings& worldSettings )
148 {
149   mTrace.PushCall( "DynamicsFactory::InitializeDynamics", "" );
150   return true;
151 }
152
153 void TestDynamicsFactory::TerminateDynamics()
154 {
155   mTrace.PushCall( "DynamicsFactory::InitializeDynamics", "" );
156 }
157
158 Integration::DynamicsWorld* TestDynamicsFactory::CreateDynamicsWorld()
159 {
160   mTrace.PushCall( "DynamicsFactory::CreateDynamicsWorld", "" );
161   return new TestDynamicsWorld( mTrace );
162 }
163
164 Integration::DynamicsBody* TestDynamicsFactory::CreateDynamicsBody()
165 {
166   mTrace.PushCall( "DynamicsFactory::CreateDynamicsBody", "" );
167   return new TestDynamicsBody( mTrace );
168 }
169
170 Integration::DynamicsJoint* TestDynamicsFactory::CreateDynamicsJoint()
171 {
172   mTrace.PushCall( "DynamicsFactory::CreateDynamicsJoint", "" );
173   return new TestDynamicsJoint( mTrace );
174 }
175
176 Integration::DynamicsShape* TestDynamicsFactory::CreateDynamicsShape()
177 {
178   mTrace.PushCall( "DynamicsFactory::CreateDynamicsShape", "" );
179  return new TestDynamicsShape( mTrace );
180 }
181
182
183 } //namespace Dali