| 607 | } |
| 608 | |
| 609 | SkeletonPtr createWall() |
| 610 | { |
| 611 | SkeletonPtr wall = Skeleton::create("wall"); |
| 612 | |
| 613 | BodyNode* bn = wall->createJointAndBodyNodePair<WeldJoint>().second; |
| 614 | |
| 615 | std::shared_ptr<BoxShape> shape = std::make_shared<BoxShape>(Eigen::Vector3d( |
| 616 | default_wall_thickness, default_ground_width, default_wall_height)); |
| 617 | auto shapeNode |
| 618 | = bn->createShapeNodeWith<VisualAspect, CollisionAspect, DynamicsAspect>( |
| 619 | shape); |
| 620 | shapeNode->getVisualAspect()->setColor(Eigen::Vector3d(0.8, 0.8, 0.8)); |
| 621 | |
| 622 | Eigen::Isometry3d tf(Eigen::Isometry3d::Identity()); |
| 623 | tf.translation() = Eigen::Vector3d( |
| 624 | (default_ground_width + default_wall_thickness) / 2.0, |
| 625 | 0.0, |
| 626 | (default_wall_height - default_wall_thickness) / 2.0); |
| 627 | bn->getParentJoint()->setTransformFromParentBodyNode(tf); |
| 628 | |
| 629 | shapeNode->getDynamicsAspect()->setRestitutionCoeff(0.2); |
| 630 | |
| 631 | return wall; |
| 632 | } |
| 633 | |
| 634 | int main(int argc, char* argv[]) |
| 635 | { |
no test coverage detected