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.
18 #include "test-dynamics.h"
26 TestDynamicsJoint::TestDynamicsJoint( TraceCallStack& trace )
29 mTrace.PushCall( "DynamicsJoint::DynamicsJoint", "" );
32 TestDynamicsJoint::~TestDynamicsJoint()
34 mTrace.PushCall( "DynamicsJoint::~DynamicsJoint", "" );
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 )
41 mTrace.PushCall( "DynamicsJoint::Initialize", "" );
44 void TestDynamicsJoint::SetLimit( const int axisIndex, const float lowerLimit, const float upperLimit )
46 mTrace.PushCall( "DynamicsJoint::SetLimit", "" );
49 void TestDynamicsJoint::EnableSpring( int axisIndex, bool flag )
51 mTrace.PushCall( "DynamicsJoint::EnableSpring", "" );
54 void TestDynamicsJoint::SetSpringStiffness( int axisIndex, float stiffness )
56 mTrace.PushCall( "DynamicsJoint::SetSpringStiffness", "" );
59 void TestDynamicsJoint::SetSpringDamping( int axisIndex, float damping )
61 mTrace.PushCall( "DynamicsJoint::SetSpringDamping", "" );
64 void TestDynamicsJoint::SetSpringCenterPoint( int axisIndex, float ratio )
66 mTrace.PushCall( "DynamicsJoint::SetSpringCenterPoint", "" );
69 void TestDynamicsJoint::EnableMotor( int axisIndex, bool flag )
71 mTrace.PushCall( "DynamicsJoint::EnableMotor", "" );
74 void TestDynamicsJoint::SetMotorVelocity( int axisIndex, float velocity )
76 mTrace.PushCall( "DynamicsJoint::SetMotorVelocity", "" );
79 void TestDynamicsJoint::SetMotorForce( int axisIndex, float force )
81 mTrace.PushCall( "DynamicsJoint::SetMotorForce", "" );
85 TestDynamicsShape::TestDynamicsShape( TraceCallStack& trace )
90 mTrace.PushCall( "DynamicsShape::DynamicsShape", "" );
93 TestDynamicsShape::~TestDynamicsShape()
95 mTrace.PushCall( "DynamicsShape::~DynamicsShape", "" );
98 void TestDynamicsShape::Initialize( int type, const Vector3& dimensions )
100 mTrace.PushCall( "DynamicsShape::Initialize", "" );
103 void TestDynamicsShape::Initialize( int type, const MeshData::VertexContainer& vertices, const MeshData::FaceIndices& faceIndices )
105 mTrace.PushCall( "DynamicsShape::Initialize", "mesh" );
108 TestDynamicsBody::TestDynamicsBody( TraceCallStack& trace )
110 mConserveVolume( false ),
111 mConserveShape( false ),
113 mActivationState( true ),
114 mCollisionGroup( 0 ),
118 mTrace.PushCall( "DynamicsBody::DynamicsBody", "" );
121 TestDynamicsBody::~TestDynamicsBody()
123 mTrace.PushCall( "DynamicsBody::~DynamicsBody", "" );
126 TestDynamicsWorld::TestDynamicsWorld( TraceCallStack& trace )
130 mTrace.PushCall( "DynamicsWorld::DynamicsWorld", "" );
133 TestDynamicsWorld::~TestDynamicsWorld()
135 mTrace.PushCall( "DynamicsWorld::~DynamicsWorld", "" );
139 TestDynamicsFactory::TestDynamicsFactory( TraceCallStack& trace ) : mTrace( trace )
143 TestDynamicsFactory::~TestDynamicsFactory()
147 bool TestDynamicsFactory::InitializeDynamics( const Integration::DynamicsWorldSettings& worldSettings )
149 mTrace.PushCall( "DynamicsFactory::InitializeDynamics", "" );
153 void TestDynamicsFactory::TerminateDynamics()
155 mTrace.PushCall( "DynamicsFactory::InitializeDynamics", "" );
158 Integration::DynamicsWorld* TestDynamicsFactory::CreateDynamicsWorld()
160 mTrace.PushCall( "DynamicsFactory::CreateDynamicsWorld", "" );
161 return new TestDynamicsWorld( mTrace );
164 Integration::DynamicsBody* TestDynamicsFactory::CreateDynamicsBody()
166 mTrace.PushCall( "DynamicsFactory::CreateDynamicsBody", "" );
167 return new TestDynamicsBody( mTrace );
170 Integration::DynamicsJoint* TestDynamicsFactory::CreateDynamicsJoint()
172 mTrace.PushCall( "DynamicsFactory::CreateDynamicsJoint", "" );
173 return new TestDynamicsJoint( mTrace );
176 Integration::DynamicsShape* TestDynamicsFactory::CreateDynamicsShape()
178 mTrace.PushCall( "DynamicsFactory::CreateDynamicsShape", "" );
179 return new TestDynamicsShape( mTrace );