|
@@ -3360,30 +3360,32 @@ void tnsRotateObjectGlobal(tnsObject *o, real x, real y, real z, real angle, rea
|
|
|
//memcpy(o->GlobalTransform, res1, sizeof(tnsMatrix44d));
|
|
|
tnsGlobalMatrixChanged(o,1);
|
|
|
}
|
|
|
-void tnsRotateObjectLocal(tnsObject *o, real x, real y, real z, real angle, real gcx,real gcy,real gcz){
|
|
|
+void tnsRotateObjectLocal(tnsObject *o, real x, real y, real z, real angle){
|
|
|
tnsMatrix44d tback,tfwd,rot,res1,res2;
|
|
|
- real xs, ys, zs;
|
|
|
- tnsVector3d gp,gpt; gp[0]=gcx; gp[1]=gcy; gp[2]=gcz;
|
|
|
- tnsApplyTransform43d(gpt,o->GlobalTransform,gp);
|
|
|
- tnsMakeTranslationMatrix44d(tfwd, gpt[0]-gcx, gpt[0]-gcy, gpt[0]-gcz);
|
|
|
- tnsInverse44d(tback,tfwd);
|
|
|
+ //tnsVector3d gp,gpt; gp[0]=gcx; gp[1]=gcy; gp[2]=gcz;
|
|
|
+ //tnsMakeTranslationMatrix44d(tfwd, gcx, gcy, gcz);
|
|
|
+ //tnsInverse44d(tback,tfwd);
|
|
|
tnsMakeRotationMatrix44d(rot,angle,x,y,z);
|
|
|
- tnsMultiply44d(res1,o->SelfTransform,tback);
|
|
|
- tnsMultiply44d(res2,res1,rot);
|
|
|
- tnsMultiply44d(o->SelfTransform,res2,tfwd);
|
|
|
+ //tnsMultiply44d(res1,o->SelfTransform,tback);
|
|
|
+ //tnsMultiply44d(res2,res1,rot);
|
|
|
+ //tnsMultiply44d(o->SelfTransform,res2,tfwd);
|
|
|
+ tnsMultiply44d(res1,o->SelfTransform,rot);
|
|
|
+ tnsCopyMatrix44d(res1,o->SelfTransform);
|
|
|
tnsSelfMatrixChanged(o,1);
|
|
|
}
|
|
|
-void tnsRotateObjectDelta(tnsObject *o, real x, real y, real z, real angle, real gcx,real gcy,real gcz){
|
|
|
+void tnsRotateObjectDelta(tnsObject *o, real x, real y, real z, real angle){
|
|
|
tnsMatrix44d tback,tfwd,rot,res1,res2;
|
|
|
- real xs, ys, zs;
|
|
|
- tnsVector3d gp,gpt; gp[0]=gcx; gp[1]=gcy; gp[2]=gcz;
|
|
|
- tnsApplyTransform43d(gpt,o->DeltaTransform,gp);
|
|
|
- tnsMakeTranslationMatrix44d(tfwd, gpt[0]-gcx, gpt[0]-gcy, gpt[0]-gcz);
|
|
|
- tnsInverse44d(tback,tfwd);
|
|
|
+ //tnsVector3d gp,gpt; gp[0]=gcx; gp[1]=gcy; gp[2]=gcz;
|
|
|
+ //tnsApplyTransform43d(gpt,o->DeltaTransform,gp);
|
|
|
+ //tnsMakeTranslationMatrix44d(tfwd, gpt[0]-gcx, gpt[0]-gcy, gpt[0]-gcz);
|
|
|
+ //tnsInverse44d(tback,tfwd);
|
|
|
+ //tnsMakeRotationMatrix44d(rot,angle,x,y,z);
|
|
|
+ //tnsMultiply44d(res1,o->SelfTransform,tback);
|
|
|
+ //tnsMultiply44d(res2,res1,rot);
|
|
|
+ //tnsMultiply44d(o->SelfTransform,res2,tfwd);
|
|
|
tnsMakeRotationMatrix44d(rot,angle,x,y,z);
|
|
|
- tnsMultiply44d(res1,o->SelfTransform,tback);
|
|
|
- tnsMultiply44d(res2,res1,rot);
|
|
|
- tnsMultiply44d(o->SelfTransform,res2,tfwd);
|
|
|
+ tnsMultiply44d(res1,o->DeltaTransform,rot);
|
|
|
+ tnsCopyMatrix44d(res1,o->DeltaTransform);
|
|
|
tnsExtractDeltaTransformValue(o);
|
|
|
tnsSelfMatrixChanged(o,1);
|
|
|
}
|