| 436 | } |
| 437 | |
| 438 | SkeletonPtr createWall() |
| 439 | { |
| 440 | SkeletonPtr wall = Skeleton::create("wall"); |
| 441 | |
| 442 | BodyNode* bn = wall->createJointAndBodyNodePair<WeldJoint>().second; |
| 443 | |
| 444 | std::shared_ptr<BoxShape> shape = std::make_shared<BoxShape>(Eigen::Vector3d( |
| 445 | default_wall_thickness, default_ground_width, default_wall_height)); |
| 446 | auto shapeNode |
| 447 | = bn->createShapeNodeWith<VisualAspect, CollisionAspect, DynamicsAspect>( |
| 448 | shape); |
| 449 | shapeNode->getVisualAspect()->setColor(Eigen::Vector3d(0.8, 0.8, 0.8)); |
| 450 | |
| 451 | Eigen::Isometry3d tf(Eigen::Isometry3d::Identity()); |
| 452 | tf.translation() = Eigen::Vector3d( |
| 453 | (default_ground_width + default_wall_thickness) / 2.0, |
| 454 | 0.0, |
| 455 | (default_wall_height - default_wall_thickness) / 2.0); |
| 456 | bn->getParentJoint()->setTransformFromParentBodyNode(tf); |
| 457 | |
| 458 | shapeNode->getDynamicsAspect()->setRestitutionCoeff(0.2); |
| 459 | |
| 460 | return wall; |
| 461 | } |
| 462 | |
| 463 | int main(int argc, char* argv[]) |
| 464 | { |
no test coverage detected