Raster render updates
This commit is contained in:
parent
e636394952
commit
60a15fad8b
10 changed files with 121 additions and 39 deletions
|
|
@ -117,16 +117,20 @@ void Camera::rotate(halnf angleX, halnf angleY) {
|
|||
Vec3F wup(0, 0, 1);
|
||||
mPos -= mTarget;
|
||||
|
||||
mat3f rotZ = mat3f::rotatorDir(wup, angleX);
|
||||
Mat3F rotZ = Mat3F::rotatorDir(wup, angleX);
|
||||
mPos = rotZ * mPos;
|
||||
mUp = rotZ * mUp;
|
||||
|
||||
Vec3F f = mPos.unitV();
|
||||
Vec3F s = mUp * f;
|
||||
|
||||
mPos = mat3f::rotatorDir(s, -angleY) * mPos;
|
||||
mPos = Mat3F::rotatorDir(s, -angleY) * mPos;
|
||||
|
||||
mPos += mTarget;
|
||||
|
||||
lookAtPoint(mTarget, mPos, mUp);
|
||||
}
|
||||
|
||||
void Camera::setPos(Vec3F pos) {
|
||||
mPos = pos;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue