37 lines
780 B
C++
37 lines
780 B
C++
#include "Quadcopter.h"
|
|
|
|
Quadcopter::Quadcopter() {
|
|
}
|
|
|
|
void Quadcopter::LinearMotion(Vector3 velocity, float yawSpeed, float rollSpeed) {
|
|
this->velocity = velocity;
|
|
this->yawSpeed = yawSpeed;
|
|
this->rollSpeed = rollSpeed;
|
|
}
|
|
|
|
void Quadcopter::SetTwistSpeed(Vector3 velocity, float yawSpeed) {
|
|
this->velocity = velocity;
|
|
this->yawSpeed = yawSpeed;
|
|
}
|
|
|
|
void Quadcopter::SetTwistSpeed(float forward, float yaw, float pitch) {
|
|
this->velocity = Vector3::forward * forward;
|
|
this->yawSpeed = yaw;
|
|
this->pitchSpeed = pitch;
|
|
}
|
|
|
|
Vector3 Quadcopter::GetTargetVelocity() {
|
|
return this->velocity;
|
|
}
|
|
|
|
float Quadcopter::GetPitchSpeed() {
|
|
return this->pitchSpeed;
|
|
}
|
|
|
|
float Quadcopter::GetYawSpeed() {
|
|
return this->yawSpeed;
|
|
}
|
|
float Quadcopter::GetRollSpeed() {
|
|
return this->rollSpeed;
|
|
}
|