Not rendering first person in racing mod?!
by Kirby Webber · in Torque Game Engine · 12/04/2002 (12:49 pm) · 3 replies
Okay, I have spent several days fiddling with the renderFirstPerson variable found in player.cc and have had no success turning off the first person rendering in the racing mod!
I posted previously, and while the responses I had recieved were herlpful, I still have had no luck.
So far I have:
declared the renderFirstPerson variable to vehicle.cc
added the following lines to pack and unpack functions appropriately:
stream->writeFlag(renderFirstPerson);
renderFirstPerson = stream->readFlag();
and written inumerable test conditions to verify whether or not the camera is set to first person or not.
Still, nothing.
Anyone tackled this yet? Any advice? I think I am going to go wipe the blood from my eyes now. ;)
I posted previously, and while the responses I had recieved were herlpful, I still have had no luck.
So far I have:
declared the renderFirstPerson variable to vehicle.cc
added the following lines to pack and unpack functions appropriately:
stream->writeFlag(renderFirstPerson);
renderFirstPerson = stream->readFlag();
and written inumerable test conditions to verify whether or not the camera is set to first person or not.
Still, nothing.
Anyone tackled this yet? Any advice? I think I am going to go wipe the blood from my eyes now. ;)
#2
The problem is that, while this will work with a standard player entity, i.e. player.cc/ player.cs, I am working with car.cs, which inherits from wheeledVehicle.cc, which in turn inherits from vehicle.cc.
After looking through the vehicle code extensively, it has become apparent that objects inheriting from the vehicle class are not set up to handle the renderFirstPerson variable.
This is what I have been attempting to overcome, and it is going to have to be done in the actual engine code.
So far, I have gained the recognition of the variable from within the main vehicle class, however, while this generates no errors that I can find, it also does not generate any results!
=/
12/04/2002 (1:23 pm)
Thanks for the reply Robert, but that doesn't work.The problem is that, while this will work with a standard player entity, i.e. player.cc/ player.cs, I am working with car.cs, which inherits from wheeledVehicle.cc, which in turn inherits from vehicle.cc.
After looking through the vehicle code extensively, it has become apparent that objects inheriting from the vehicle class are not set up to handle the renderFirstPerson variable.
This is what I have been attempting to overcome, and it is going to have to be done in the actual engine code.
So far, I have gained the recognition of the variable from within the main vehicle class, however, while this generates no errors that I can find, it also does not generate any results!
=/
#3
Since I have acheived a small measure of success in this department, I thought I'd share.
In gameConnection.cc, the following instructions can be found:
and...
by modifying the mCameraPos variable initially, and within the nested if statement, you can modify the location of the camera while in first person.
as a note, negative values move the camera forward through your mesh, while positive values move it back.
What is most distressing, is that when the camera location is modified in this manner, the crosshair fails to display!
I am taking this to imply that the guiCrosshair is somehow dependant upon the camera location, which complicates matters.
Also, and I could be wrong on this, it seemed as though the camera was set a bit higher from the ground plane than when the mCameraPos is set to zero.
Any thoughts?
12/05/2002 (7:41 pm)
Well, having all but abandoned the renderFirstPerson approach, I set out in search of a way to physically move the camera forward when in first person. (Bumper Cam)Since I have acheived a small measure of success in this department, I thought I'd share.
In gameConnection.cc, the following instructions can be found:
mCameraPos = 0
and...
if (dt) {
if (mFirstPerson || obj->onlyFirstPerson()) {
if (mCameraPos > 0)
if ((mCameraPos -= mCameraSpeed * dt) <= 0)
mCameraPos = 0;
}
else {
if (mCameraPos < 1)
if ((mCameraPos += mCameraSpeed * dt) > 1)
mCameraPos = 1;
}
}by modifying the mCameraPos variable initially, and within the nested if statement, you can modify the location of the camera while in first person.
as a note, negative values move the camera forward through your mesh, while positive values move it back.
What is most distressing, is that when the camera location is modified in this manner, the crosshair fails to display!
I am taking this to imply that the guiCrosshair is somehow dependant upon the camera location, which complicates matters.
Also, and I could be wrong on this, it seemed as though the camera was set a bit higher from the ground plane than when the mCameraPos is set to zero.
Any thoughts?
Torque 3D Owner Robert Blanchet Jr.
renderFirstPerson = true;
and change it to
renderFirstPerson = false;
If the value isn't currently present add it.
This will be found in the scripts.
This value controls whether or not the object will render in first person or not. Keep in mind, disregarding coding changes, you can only turn off the rendering of the first person, you can't turn it on again, unless you change the datablock value back to boolean true.