~robot3d-team/robot3d/trunk

« back to all changes in this revision

Viewing changes to src/srFactory/actuatorFactory.cpp

  • Committer: Anne van Rossum
  • Date: 2010-08-10 15:58:55 UTC
  • Revision ID: anne@gamix-20100810155855-kve7x2vwouagdij9
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Robot3D Physical realistic 3D simulator for robots
 
3
 *
 
4
 * @license GNU Lesser General Public License
 
5
 *
 
6
 * @author Lutz Winkler
 
7
 * @author Anne C. van Rossum
 
8
 */
 
9
 
 
10
#include <srFactory/actuatorFactory.h>
 
11
 
 
12
namespace srCore {
 
13
 
 
14
 
 
15
dtCore::RefPtr<ActuatorBase> ActuatorFactory::createActuator(actuatortype type,
 
16
                dtCore::RefPtr<BodyBase> body1, dtCore::RefPtr<BodyBase> body2,
 
17
                float anchorX, float anchorY, float anchorZ,
 
18
                float axisX, float axisY, float axisZ,
 
19
                const std::string &name)
 
20
{
 
21
 
 
22
        switch (type)
 
23
        {
 
24
 
 
25
        case HINGE_ACTUATOR:
 
26
 
 
27
                return new HingeUniKarl(
 
28
                                body1, body2,
 
29
                                anchorX, anchorY, anchorZ,
 
30
                                axisX, axisY, axisZ, name);
 
31
 
 
32
        case WHEEL_ACTUATOR:
 
33
                return new WheelUniKarl(
 
34
                                body1, body2,
 
35
                                anchorX, anchorY, anchorZ,
 
36
                                axisX, axisY, axisZ, name);
 
37
 
 
38
        default:
 
39
                return NULL;
 
40
 
 
41
        }
 
42
 
 
43
}
 
44
 
 
45
ActuatorFactory::~ActuatorFactory() {
 
46
 
 
47
}
 
48
 
 
49
}