mirror of
https://github.com/devZoGok/vb01.git
synced 2026-08-26 19:43:30 +00:00
31 lines
625 B
C++
31 lines
625 B
C++
#include"bone.h"
|
|
|
|
using namespace std;
|
|
|
|
namespace vb01{
|
|
Bone::Bone(string name, Vector3 axis[3], Vector3 pos,Quaternion rot, Vector3 scale) : Node(pos,rot,scale){
|
|
this->name=name;
|
|
this->restPos=pos;
|
|
this->restRot=rot;
|
|
this->restScale=scale;
|
|
for(int i=0;i<3;i++)
|
|
this->initAxis[i]=axis[i];
|
|
//lookAt(axis[1],axis[2],parent);
|
|
}
|
|
|
|
void Bone::setPosePos(Vector3 p){
|
|
this->posePos=p;
|
|
setPosition(restPos+posePos);
|
|
}
|
|
|
|
void Bone::setPoseRot(Quaternion r){
|
|
this->poseRot=r;
|
|
setOrientation(poseRot*restRot);
|
|
}
|
|
|
|
void Bone::setPoseScale(Vector3 s){
|
|
this->poseScale=s;
|
|
setScale(restScale+poseScale);
|
|
}
|
|
}
|