Bug? Camera Distance in Shapebase.cpp
by Steve Acaster · in Torque 3D Professional · 11/11/2009 (8:17 pm) · 2 replies
Non-coder here.
Whilst confusing myself greatly with various camera/controlobject related things I noticed something which looked a bit odd.
Shapbase.cpp around line 86/7
cameraMinDist was larger than cameraMaxDist.
Later down at ShapeBaseDataProto, around line 147 it reads
cameraMinDist being larger again and cameraMaxDist doesn't have an f at the end here.
For the sake of arguement I changed both settings to
and nothing bad happened --- I just thought it looked "funny".
Whilst confusing myself greatly with various camera/controlobject related things I noticed something which looked a bit odd.
Shapbase.cpp around line 86/7
hulkSequence( -1 ), cameraMaxDist( 0.0f ), cameraMinDist( 0.2f ), cameraDefaultFov( 90.0f ), cameraMinFov( 5.0f ),
cameraMinDist was larger than cameraMaxDist.
Later down at ShapeBaseDataProto, around line 147 it reads
...
maxEnergy = 0;
cameraMaxDist = 0;
cameraMinDist = 0.2f;
cameraDefaultFov = 90.f;
...cameraMinDist being larger again and cameraMaxDist doesn't have an f at the end here.
For the sake of arguement I changed both settings to
cameraMaxDist = 0.0f;
cameraMinDist = 0.0f;and nothing bad happened --- I just thought it looked "funny".
About the author
One Bloke ... In His Bedroom ... Making Indie Games ...
#2
11/12/2009 (10:15 am)
If you don't override cameraMaxDist in your player datablock, cameraMaxDist will get set to half the player's bounding box width. This could potentially be a problem if you had a very small character who's bounding box was less than 0.4 wide, making cameraMaxDist less than cameraMinDist. Also, the "f" in "0.0f" just tells the compiler that it is a floating point value. Leaving it as "cameraMaxDist = 0;" is fine... the compiler will convert the zero from an integer to a float.
Torque Owner Davide Archetti
Default Studio Name
The values in ShapeBaseDataProto should be always the same as the ShapeBaseData defaults, because ShapeBaseDataProto is used to reduce the badnwidth needed to send the datablock over the net, if the values are the same, the server, insteand of sending to the client, the data, it just send a flag, only one bit, because the client object has been already intialized with the same value as the server.
Edit:
Sorry, yes, it has more sense to have cameraMaxDist greater than cameraMinDist :)