-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapphalf.cpp
More file actions
21 lines (17 loc) · 762 Bytes
/
apphalf.cpp
File metadata and controls
21 lines (17 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "apphalf.h"
////////////////////////////////////////////////////////////////////////////////
// Left/Right Half of appendage - beam+2 pistons+piston holder creation
// Creator
AppHalf::AppHalf(dWorldID world, dSpaceID space, AppDesignID app_design,
dBodyID main_body, dBodyID blade)
: ebMain(main_body), ebBlade(blade)
{
// NOTE: app_design must have a side called before this, so that A..E and K..Q are one of left or right
// create bodies with geometries
// create links and connect them
jA = dJointCreateHinge(world, 0);
dJointSetHingeAxis(jA, 0, 1, 0); // is -1 or 1 a matter? only for angle and anglerate sign, i think.
dReal *A = app_design->getA();
dJointSetHingeAnchor(jA, A[0], A[1], A[2]);
dJointConnect(jA, ebMain, bBeam);
}