physx_footbot_model.cpp
Go to the documentation of this file.
1 
7 #include "physx_footbot_model.h"
8 #include <argos3/plugins/robots/foot-bot/simulator/footbot_entity.h>
9 
10 namespace argos {
11 
12  /****************************************/
13  /****************************************/
14 
16  CFootBotEntity& c_entity) :
17  CPhysXSingleBodyObjectModel(c_engine, c_entity),
18  m_cFootBotEntity(c_entity) {
19  /* Calculate base center */
20  SetARGoSReferencePoint(physx::PxVec3(0.0f, 0.0f, 0.0f));
21  /* Get position and orientation in this engine's representation */
22  physx::PxVec3 cPos;
23  CVector3ToPxVec3(GetEmbodiedEntity().GetOriginAnchor().Position, cPos);
24  physx::PxQuat cOrient;
25  CQuaternionToPxQuat(GetEmbodiedEntity().GetOriginAnchor().Orientation, cOrient);
26  /* Create the transform
27  * 1. a translation up by half body height
28  * 2. a rotation around the base
29  * 3. a translation to the final position
30  */
31  physx::PxTransform cTranslation1(physx::PxVec3(0.0f, 0.0f, 0.0f));
32  physx::PxTransform cRotation(cOrient);
33  physx::PxTransform cTranslation2(cPos);
34  physx::PxTransform cFinalTrans = cTranslation2 * cRotation * cTranslation1;
35  /* Calculate bounding box */
36  CalculateBoundingBox();
37  }
38 
39  /****************************************/
40  /****************************************/
41 
43  }
44 
45  /****************************************/
46  /****************************************/
47 
49 
50  /****************************************/
51  /****************************************/
52 
53 }
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
REGISTER_STANDARD_PHYSX_OPERATIONS_ON_ENTITY(CEPuckEntity, CPhysXEPuckModel)
CPhysXFootBotModel(CPhysXEngine &c_engine, CFootBotEntity &c_entity)