iMSTK
Interactive Medical Simulation Toolkit
imstkRigidObject2.h
1 /*
2 ** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
3 ** iMSTK is distributed under the Apache License, Version 2.0.
4 ** See accompanying NOTICE for details.
5 */
6 
7 #pragma once
8 
9 #include "imstkDynamicObject.h"
10 #include "imstkMacros.h"
11 
12 namespace imstk
13 {
14 class PointSet;
15 class RigidBodyModel2;
16 struct RigidBody;
17 
25 {
26 public:
27  RigidObject2(const std::string& name = "RigidObject2") : DynamicObject(name) { }
28  ~RigidObject2() override = default;
29 
30  IMSTK_TYPE_NAME(RigidObject2)
31 
32 
33  bool initialize() override;
36 
40  //void addForce(const Vec3d& force, const Vec3d& pos, bool wakeup = true);
41 
42  std::shared_ptr<RigidBodyModel2> getRigidBodyModel2();
43 
47  std::shared_ptr<RigidBody> getRigidBody() const { return m_rigidBody; }
48 
52  void setDynamicalModel(std::shared_ptr<AbstractDynamicalModel> dynaModel) override;
53 
57  void updatePhysicsGeometry() override;
58 
59 protected:
60  std::shared_ptr<RigidBodyModel2> m_rigidBodyModel2;
61  std::shared_ptr<RigidBody> m_rigidBody;
62 };
63 } // namespace imstk
void setDynamicalModel(std::shared_ptr< AbstractDynamicalModel > dynaModel) override
Sets the model, and creates the body within the model.
std::shared_ptr< RigidBody > m_rigidBody
Gives the actual body within the model.
Base class for scene objects that move and/or deform.
Compound Geometry.
std::shared_ptr< RigidBody > getRigidBody() const
Returns body in the model.
void updatePhysicsGeometry() override
Updates the physics geometry of the object.
std::shared_ptr< RigidBodyModel2 > getRigidBodyModel2()
Add local force at a position relative to object.
Scene objects that are governed by rigid body dynamics under the RigidBodyModel2. ...
bool initialize() override
Initialize the rigid scene object.