00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
#ifndef OPENCAL_RIGIDBODYPOINT_H
00012
#define OPENCAL_RIGIDBODYPOINT_H
00013
00014
00015
#include <OpenCAL/global.h>
00016
#include <OpenCAL/PhysicalObject.h>
00017
#include <OpenCAL/Vector3.h>
00018
using OpenCAL::Utils::Vector3;
00019
00020
namespace OpenCAL
00021 {
00022
00023
class RigidBody;
00024
00030 class OPENCAL_API RigidBodyPoint:
public PhysicalObject
00031 {
00032
protected:
00033
00034
RigidBody *m_object;
00035 Vector3 m_bodyPosition;
00036
00037
public:
00038
00039 RigidBodyPoint(
RigidBody *object,
const Vector3 &bodyPosition);
00040
virtual ~RigidBodyPoint();
00041
00042
00043
const Vector3 &getPosition()
const { calcPosition();
return m_position; }
00044 Vector3 *getPositionP() { calcPosition();
return &m_position; }
00045
const Vector3 &getVelocity()
const { calcVelocity();
return m_velocity; }
00046 Vector3 *getVelocityP() { calcVelocity();
return &m_velocity; }
00047
00048
00049
void addForce(
const Vector3 &force);
00050
00052
00053
00054
void render();
00055
00056
00057
void addToState(
PhaseSpace *state) {}
00058
void addToDerivative(
PhaseSpace *deriv) {}
00059
void fromState(
PhaseSpace *state) {}
00060
00061
protected:
00062
00063
void calcPosition()
const;
00064
void calcVelocity()
const;
00065 };
00066 }
00067
00068
#endif // OPENCAL_RIGIDBODYPOINT_H