mirror of
https://github.com/ApfelTeeSaft/vb01.git
synced 2026-08-26 19:33:45 +00:00
bone transformations influence verts according to weights
This commit is contained in:
@@ -3,7 +3,28 @@
|
||||
using namespace std;
|
||||
|
||||
namespace vb01{
|
||||
Bone::Bone(string name, Vector3 pos) : Node(pos){
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user