Files
hexapod-robot/2012-simulation/ik-visualiser-vs/Hexapod app/Leg.h
T
2014-02-16 00:13:50 +01:00

70 lines
1.2 KiB
C++

//Leg.h
#ifndef LEG_H
#define LEG_H
#include <Windows.h>
#include "InverseKinemetics.h"
#include <vector>
#include <D3DX9.h>
using namespace std;
class Leg
{
public:
//Variable
D3DXVECTOR3 OffsetVector, SizeVector, Coordinate;
struct vector<D3DXVECTOR3> MoveSpace;
bool MoveSpaceRenderd;
D3DXVECTOR3 ModelSpaceHip, ModelSpaceKnee, ModelSpaceFeet;
vector<struct D3DXVECTOR3> WorldSpaceLineModel;
bool Error;
HDC HDCBuffer, HDCSecondBuffer;
//Initial
Leg();
~Leg();
void GetHDC( HDC hdc );
void GetHDCSecondBuffer( HDC hdc );
//Input
void Coordinates( float ix, float iy, float iz );
void Coordinates( D3DXVECTOR3 i );
void Offset( float ix, float iy, float iz );
void Offset( D3DXVECTOR3 i );
void Size( float ix, float iy, float iz );
void Size( D3DXVECTOR3 i );
//Functions
void GetPossibleMoveSpace( );
void CalculateLegRight( );
void CalculateWorldSpaceLineModel( );
void PrintMoveSpaceOnWorldSpace( );
void PrintWorldSpaceLineModel( );
void Print3DLinesOnWorldSpace( );
};
#endif
/*
Z-Axis Rotation
x' = x*cos q - y*sin q
y' = x*sin q + y*cos q
z' = z
X-Axis Rotation
y' = y*cos q - z*sin q
z' = y*sin q + z*cos q
x' = x
Y-Axis Rotation
z' = z*cos q - x*sin q
x' = z*sin q + x*cos q
y' = y
*/