mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +00:00
Game cam and eye banking, control schemes
- ShapeBaseData has two new properties. cameraCanBank indicates that the game object may bank its eye/camera, if supported by the object. mountedImagesBank indicates that mounted images should bank with the eye/camera in first person view. Both default to false. - Player supports 1st person eye and 3rd person camera banking when making use of the new ExtendedMove class. - Camera class supports banking when making use of the new ExtendedMove class. - GameConnection now has an idea of a control scheme. This determines how game objects should respond to input events. A control scheme may be set by either the server or client. Current control schemes are: -- Absolute rotation (likely though the ExtendedMove class) -- Add relative yaw (from mouse or gamepad) to absolute rotation. -- Add relative pitch (from mouse or gamepad) to absolute rotation. - Player class supports the new control schemes when using the ExtendedMove class. - Camera class supports the new control scheme when using the ExtendedMove class.
This commit is contained in:
parent
2805ec81c8
commit
660250cccf
10 changed files with 570 additions and 127 deletions
|
|
@ -171,6 +171,8 @@ ShapeBaseData::ShapeBaseData()
|
|||
cameraDefaultFov( 75.0f ),
|
||||
cameraMinFov( 5.0f ),
|
||||
cameraMaxFov( 120.f ),
|
||||
cameraCanBank( false ),
|
||||
mountedImagesBank( false ),
|
||||
isInvincible( false ),
|
||||
renderWhenDestroyed( true ),
|
||||
debris( NULL ),
|
||||
|
|
@ -544,6 +546,10 @@ void ShapeBaseData::initPersistFields()
|
|||
"The minimum camera vertical FOV allowed in degrees." );
|
||||
addField( "cameraMaxFov", TypeF32, Offset(cameraMaxFov, ShapeBaseData),
|
||||
"The maximum camera vertical FOV allowed in degrees." );
|
||||
addField( "cameraCanBank", TypeBool, Offset(cameraCanBank, ShapeBaseData),
|
||||
"If the derrived class supports it, allow the camera to bank." );
|
||||
addField( "mountedImagesBank", TypeBool, Offset(mountedImagesBank, ShapeBaseData),
|
||||
"Do mounted images bank along with the camera?" );
|
||||
addField( "firstPersonOnly", TypeBool, Offset(firstPersonOnly, ShapeBaseData),
|
||||
"Flag controlling whether the view from this object is first person "
|
||||
"only." );
|
||||
|
|
@ -689,6 +695,8 @@ void ShapeBaseData::packData(BitStream* stream)
|
|||
stream->write(cameraMinFov);
|
||||
if(stream->writeFlag(cameraMaxFov != gShapeBaseDataProto.cameraMaxFov))
|
||||
stream->write(cameraMaxFov);
|
||||
stream->writeFlag(cameraCanBank);
|
||||
stream->writeFlag(mountedImagesBank);
|
||||
stream->writeString( debrisShapeName );
|
||||
|
||||
stream->writeFlag(observeThroughObject);
|
||||
|
|
@ -788,6 +796,9 @@ void ShapeBaseData::unpackData(BitStream* stream)
|
|||
else
|
||||
cameraMaxFov = gShapeBaseDataProto.cameraMaxFov;
|
||||
|
||||
cameraCanBank = stream->readFlag();
|
||||
mountedImagesBank = stream->readFlag();
|
||||
|
||||
debrisShapeName = stream->readSTString();
|
||||
|
||||
observeThroughObject = stream->readFlag();
|
||||
|
|
@ -1872,10 +1883,10 @@ Point3F ShapeBase::getAIRepairPoint()
|
|||
|
||||
void ShapeBase::getEyeTransform(MatrixF* mat)
|
||||
{
|
||||
getEyeBaseTransform(mat);
|
||||
getEyeBaseTransform(mat, true);
|
||||
}
|
||||
|
||||
void ShapeBase::getEyeBaseTransform(MatrixF* mat)
|
||||
void ShapeBase::getEyeBaseTransform(MatrixF* mat, bool includeBank)
|
||||
{
|
||||
// Returns eye to world space transform
|
||||
S32 eyeNode = mDataBlock->eyeNode;
|
||||
|
|
@ -1887,10 +1898,10 @@ void ShapeBase::getEyeBaseTransform(MatrixF* mat)
|
|||
|
||||
void ShapeBase::getRenderEyeTransform(MatrixF* mat)
|
||||
{
|
||||
getRenderEyeBaseTransform(mat);
|
||||
getRenderEyeBaseTransform(mat, true);
|
||||
}
|
||||
|
||||
void ShapeBase::getRenderEyeBaseTransform(MatrixF* mat)
|
||||
void ShapeBase::getRenderEyeBaseTransform(MatrixF* mat, bool includeBank)
|
||||
{
|
||||
// Returns eye to world space transform
|
||||
S32 eyeNode = mDataBlock->eyeNode;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue