RenderGeometry.cpp
1 /*********************************************************************
2 * Rice University Software Distribution License
3 *
4 * Copyright (c) 2010, Rice University
5 * All Rights Reserved.
6 *
7 * For a full description see the file named LICENSE.
8 *
9 *********************************************************************/
10 
11 /* Author: Ioan Sucan */
12 
13 #include "omplapp/graphics/RenderGeometry.h"
14 #include "omplapp/graphics/detail/assimpGUtil.h"
15 #include "omplapp/graphics/detail/RenderPlannerData.h"
16 
17 int ompl::app::RenderGeometry::renderEnvironment() const
18 {
19  const GeometrySpecification &gs = rbg_.getGeometrySpecification();
20  return scene::assimpRender(gs.obstacles, gs.obstaclesShift);
21 }
22 
23 int ompl::app::RenderGeometry::renderRobot() const
24 {
25  const GeometrySpecification &gs = rbg_.getGeometrySpecification();
26  return scene::assimpRender(gs.robot, gs.robotShift);
27 }
28 
29 int ompl::app::RenderGeometry::renderRobotPart(unsigned int index) const
30 {
31  const GeometrySpecification &gs = rbg_.getGeometrySpecification();
32  if (index >= gs.robot.size())
33  return 0;
34  return scene::assimpRender(gs.robot[index], gs.robotShift.size() > index ? gs.robotShift[index] : aiVector3D(0.0, 0.0, 0.0));
35 }
36 
37 int ompl::app::RenderGeometry::renderPlannerData(const base::PlannerData &pd) const
38 {
39  return RenderPlannerData(pd, aiVector3D(0.0, 0.0, 0.0), rbg_.getMotionModel(), se_, rbg_.getLoadedRobotCount());
40 }
int RenderPlannerData(const base::PlannerData &pd, const aiVector3D &translate, MotionModel m, const GeometricStateExtractor &gse, unsigned int count)
Render the planner states in pd, after shifting them by translate, using the motion model m...