amotor.h
Go to the documentation of this file.00001 #ifndef PHYSICS_AMOTOR_H
00002 #define PHYSICS_AMOTOR_H
00003
00013 #include "physics/joint.h"
00014 #include "physics/jointaxis.h"
00015 #include "util/nfixedarray.h"
00016
00017
00018 namespace Physics
00019 {
00020 class AMotor : public Joint
00021 {
00022 DeclareRtti;
00023 DeclareFactory(AMotor);
00024
00025 public:
00027 AMotor();
00029 virtual ~AMotor();
00031 virtual void Attach(dWorldID worldID, dJointGroupID groupID, const matrix44& m);
00033 virtual void UpdateTransform(const matrix44& m);
00035 void SetNumAxes(uint num);
00037 uint GetNumAxes() const;
00039 JointAxis& AxisParams(uint axisIndex) const;
00040
00041 private:
00042 nFixedArray<JointAxis> axisParams;
00043 };
00044
00045 RegisterFactory(AMotor);
00046
00047
00050 inline
00051 void
00052 AMotor::SetNumAxes(uint num)
00053 {
00054 n_assert(num <= 3);
00055 this->axisParams.SetSize(num);
00056 }
00057
00058
00061 inline
00062 uint
00063 AMotor::GetNumAxes() const
00064 {
00065 return this->axisParams.Size();
00066 }
00067
00068
00071 inline
00072 JointAxis&
00073 AMotor::AxisParams(uint axisIndex) const
00074 {
00075 return this->axisParams[axisIndex];
00076 }
00077
00078 };
00079
00080
00081 #endif