Matrix4 affine - porting from prior code

Problems building or running the engine, queries about how to use features etc.
Post Reply
Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 614
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 25

Matrix4 affine - porting from prior code

Post by Slicky »

I just build OGRE from the repository. There are some porting problems from my prior code. I think it was v1.09. I think the checkout is v1.11.

Anyway, here are my problems:

(1) In prior code something pseudo code like:

Code: Select all

Matrix4 matrix;
Matrix4 newmatrix = matrix.inverseAffine()
(2) In prior code something like:

Code: Select all

Matrix4 matrix;
const Vector3& handle;
const Vector3& point = matrix.transformAffine(handle);
Affine is still part of the Matrix4 header but has its own class now. I am not familiar enough with matrixes to know what to do. inverseAffine and transformAffine do not exist anymore.

What would the equivalent code be now to achieve what the prior version did?
paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: Matrix4 affine - porting from prior code

Post by paroj »

Code: Select all

Matrix4 matrix;
Affine3 newmatrix = Affine3(matrix).inverse()

Code: Select all

Affine3 matrix(matrix4);
const Vector3& handle;
const Vector3& point = matrix*handle;
basically use Affine3 instead of Matrix4 whenever you know the Matrix is just affine
Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 614
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 25

Re: Matrix4 affine - porting from prior code

Post by Slicky »

Excellent - thanks for the response. I will try that.
Post Reply