SceneState.cpp
Go to the documentation of this file.
00001 #include "SceneState.h"
00002 
00003 using namespace hrp;
00004 using namespace OpenHRP;
00005 
00006 void SceneState::set(hrp::WorldBase& i_world, OpenHRP::CollisionSequence& i_collisions)
00007 {
00008     time = i_world.currentTime();
00009     bodyStates.resize(i_world.numBodies());
00010     for (unsigned int i=0; i<i_world.numBodies(); i++){
00011         BodyPtr body = i_world.body(i);
00012         bodyStates[i].set(body);
00013     }
00014     size_t n=0;
00015     for (size_t i=0; i<i_collisions.length(); i++){
00016         n += i_collisions[i].points.length();
00017     }
00018     collisions.resize(n);
00019     size_t index=0;
00020     for (size_t i=0; i<i_collisions.length(); i++){
00021         Collision &col = i_collisions[i];
00022         for (size_t j=0; j<col.points.length(); j++){
00023             CollisionInfo& ci=collisions[index++];
00024             CollisionPoint& cp=col.points[j];
00025             for (int k=0; k<3; k++){
00026                 ci.position[k] = cp.position[k];
00027                 ci.normal[k] = cp.normal[k];
00028             }
00029             ci.idepth = cp.idepth;
00030         }
00031     }
00032 }


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Wed May 15 2019 05:02:19