Setting position of Advanced Camera without interpolation?
by Milo D. Cooper · in Torque Game Engine · 07/04/2007 (12:17 pm) · 2 replies
How?
Or more precisely, how do I set the camera's transformation matrix such that it essentially doesn't move when I call the the AdvancedCamera::setPosition(Point3F) function?
To put in another way, I want tPos and pos to be the same when the engine evaluates "tPos = getPosition();", so I need to set the camera's transformation matrix before I call setPosition(Point3F).
I've tried modifying AdvancedCamera::setCameraPosition(const Point3F& pos) to:
{
MatrixF transMat = Parent::getTransform();
transMat.setColumn(3, pos);
Parent::setTransform(transMat);
mCameraPos = pos;
setPosition(mCameraPos);
}
... but that seems to have no effect, the camera still interpolates.
Anyone?
EDIT: Note that I would rather not modify AdvancedCamera::setPosition(const Point3F&) such that it doesn't interpolate. I would much rather just add code to AdvancedCamera::setCameraPosition(const Point3F&) that sets the camera matrix then calls setPosition(Point3F), essentially causing the camera to immediately jump to a position.
-- M. Cooper
Or more precisely, how do I set the camera's transformation matrix such that it essentially doesn't move when I call the the AdvancedCamera::setPosition(Point3F) function?
To put in another way, I want tPos and pos to be the same when the engine evaluates "tPos = getPosition();", so I need to set the camera's transformation matrix before I call setPosition(Point3F).
I've tried modifying AdvancedCamera::setCameraPosition(const Point3F& pos) to:
{
MatrixF transMat = Parent::getTransform();
transMat.setColumn(3, pos);
Parent::setTransform(transMat);
mCameraPos = pos;
setPosition(mCameraPos);
}
... but that seems to have no effect, the camera still interpolates.
Anyone?
EDIT: Note that I would rather not modify AdvancedCamera::setPosition(const Point3F&) such that it doesn't interpolate. I would much rather just add code to AdvancedCamera::setCameraPosition(const Point3F&) that sets the camera matrix then calls setPosition(Point3F), essentially causing the camera to immediately jump to a position.
-- M. Cooper
#2
either that or it locks up when i hit tab to activate it, its so weird.
07/08/2007 (7:32 pm)
On another note, have you had the advanced camera just give you a blank sky when you activate it? thats all iam getting.either that or it locks up when i hit tab to activate it, its so weird.
Torque Owner Milo D. Cooper