RTSCamera::setCameraPosition() vs Pitch Angle
by Robert Brower · in RTS Starter Kit · 11/26/2007 (6:15 am) · 2 replies
When the RTSCamera is pitched to it's minimum, and the RTSCamera::setCameraPosition() function is called, the camera position obtained is not the camera position requested. Steps to reproduce:
1. Using the stock RTS Kit .exe,
2. Enter the mission provided.
3. Using the mouse wheel, pitch the camera to it's minimum pitch angle.
4. Open the console and type: echo($RTSCamera.getCameraPosition());
5. In the console, type: $RTSCamera.setCameraPosition(X, Y); (where X and Y are what were returned in step 4.)
6. Observe that the camera moves to a position that was not requested.
7. Pitch the camera to it's maximum.
8. repeat steps 4 - 6.
9. Observe that the camera moves to the requested position.
I may be able to work around this but I thought I should be diligent enough to post what I may only be presuming is a bug.
Thank you.
With regards,
Robert Brower
1. Using the stock RTS Kit .exe,
2. Enter the mission provided.
3. Using the mouse wheel, pitch the camera to it's minimum pitch angle.
4. Open the console and type: echo($RTSCamera.getCameraPosition());
5. In the console, type: $RTSCamera.setCameraPosition(X, Y); (where X and Y are what were returned in step 4.)
6. Observe that the camera moves to a position that was not requested.
7. Pitch the camera to it's maximum.
8. repeat steps 4 - 6.
9. Observe that the camera moves to the requested position.
I may be able to work around this but I thought I should be diligent enough to post what I may only be presuming is a bug.
Thank you.
With regards,
Robert Brower
#2
void RTSCamera::setCameraPosition(Point2F pos)
{
F32 realHeight = getTerrHeight(pos) + mCurrHeight;
Point3F dir;
Point3F startPos = Point3F(pos.x, pos.y, realHeight);
Point3F endPos;
// RFB ->
//mObjToWorld.getColumn(1, &dir);
//endPos = startPos - dir * mTargetHeight;
//endPos.z = getTerrHeight(Point2F(endPos.x, endPos.y)) + mCurrHeight;
endPos.x = pos.x;
endPos.y = pos.y;
endPos.z = realHeight;
// <- RFB
mTargetPos = mPrevPos = Point2F(endPos.x, endPos.y);
setPosition(endPos);
11/27/2007 (11:32 am)
This gives me what I need...void RTSCamera::setCameraPosition(Point2F pos)
{
F32 realHeight = getTerrHeight(pos) + mCurrHeight;
Point3F dir;
Point3F startPos = Point3F(pos.x, pos.y, realHeight);
Point3F endPos;
// RFB ->
//mObjToWorld.getColumn(1, &dir);
//endPos = startPos - dir * mTargetHeight;
//endPos.z = getTerrHeight(Point2F(endPos.x, endPos.y)) + mCurrHeight;
endPos.x = pos.x;
endPos.y = pos.y;
endPos.z = realHeight;
// <- RFB
mTargetPos = mPrevPos = Point2F(endPos.x, endPos.y);
setPosition(endPos);
Torque Owner Swaroop Reddy