Merge pull request #884 from GarageGames/development-3.6

Version 3.6.2
This commit is contained in:
Daniel Buckmaster 2014-11-05 20:28:01 +11:00
commit 3082bb3adc
28 changed files with 132 additions and 74 deletions

View file

@ -99,7 +99,6 @@ DebrisData::DebrisData()
friction = 0.2f;
numBounces = 0;
bounceVariance = 0;
minSpinSpeed = maxSpinSpeed = 0.0;
staticOnMaxBounce = false;
explodeOnMaxBounce = false;
snapOnMaxBounce = false;
@ -659,11 +658,7 @@ void Debris::onRemove()
}
}
if( getSceneManager() )
getSceneManager()->removeObjectFromScene(this);
if( getContainer() )
getContainer()->removeObject(this);
removeFromScene();
Parent::onRemove();
}

View file

@ -964,10 +964,7 @@ void Explosion::onRemove()
mMainEmitter = NULL;
}
if (getSceneManager() != NULL)
getSceneManager()->removeObjectFromScene(this);
if (getContainer() != NULL)
getContainer()->removeObject(this);
removeFromScene();
Parent::onRemove();
}

View file

@ -415,11 +415,7 @@ void Splash::onRemove()
ringList.clear();
if( getSceneManager() )
getSceneManager()->removeObjectFromScene(this);
if( getContainer() )
getContainer()->removeObject(this);
removeFromScene();
Parent::onRemove();
}

View file

@ -110,7 +110,7 @@ GuiObjectView::GuiObjectView()
{
mCameraMatrix.identity();
mCameraRot.set( 0.0f, 0.0f, 3.9f );
mCameraPos.set( 0.0f, 1.75f, 1.25f );
mCameraPos.set( 0.0f, 0.0f, 0.0f );
mCameraMatrix.setColumn( 3, mCameraPos );
mOrbitPos.set( 0.0f, 0.0f, 0.0f );
@ -520,9 +520,9 @@ void GuiObjectView::renderWorld( const RectI& updateRect )
(
gClientSceneGraph,
SPT_Diffuse,
SceneCameraState( GFX->getViewport(), frust, GFX->getWorldMatrix(), GFX->getProjectionMatrix() ),
SceneCameraState( GFX->getViewport(), frust, MatrixF::Identity, GFX->getProjectionMatrix() ),
renderPass,
false
true
);
// Set up our TS render state here.

View file

@ -356,6 +356,7 @@ PlayerData::PlayerData()
decalID = 0;
decalOffset = 0.0f;
actionCount = 0;
lookAction = 0;
// size of bounding box
@ -3691,7 +3692,7 @@ bool Player::setActionThread(const char* sequence,bool hold,bool wait,bool fsp)
void Player::setActionThread(U32 action,bool forward,bool hold,bool wait,bool fsp, bool forceSet)
{
if (!mDataBlock || (mActionAnimation.action == action && mActionAnimation.forward == forward && !forceSet))
if (!mDataBlock || !mDataBlock->actionCount || (mActionAnimation.action == action && mActionAnimation.forward == forward && !forceSet))
return;
if (action >= PlayerData::NumActionAnims)

View file

@ -92,7 +92,7 @@ ConsoleDocClass( RigidShapeData,
"@see RigidShape\n"
"@see ShapeBase\n\n"
"@ingroup Platform\n"
"@ingroup Physics\n"
);
@ -149,7 +149,7 @@ ConsoleDocClass( RigidShape,
"@see RigidShapeData\n"
"@see ShapeBase\n\n"
"@ingroup Platform\n"
"@ingroup Physics\n"
);

View file

@ -91,7 +91,9 @@ void SFX3DObject::getEarTransform( MatrixF& transform ) const
if ( !shapeInstance )
{
// Just in case.
transform = mObject->getTransform();
GameConnection* connection = dynamic_cast<GameConnection *>(NetConnection::getConnectionToServer());
if ( !connection || !connection->getControlCameraTransform( 0.0f, &transform ) )
transform = mObject->getTransform();
return;
}

View file

@ -702,41 +702,9 @@ bool TSStatic::castRay(const Point3F &start, const Point3F &end, RayInfo* info)
if ( mCollisionType == Bounds )
{
F32 st, et, fst = 0.0f, fet = 1.0f;
F32 *bmin = &mObjBox.minExtents.x;
F32 *bmax = &mObjBox.maxExtents.x;
F32 const *si = &start.x;
F32 const *ei = &end.x;
for ( U32 i = 0; i < 3; i++ )
{
if (*si < *ei)
{
if ( *si > *bmax || *ei < *bmin )
return false;
F32 di = *ei - *si;
st = ( *si < *bmin ) ? ( *bmin - *si ) / di : 0.0f;
et = ( *ei > *bmax ) ? ( *bmax - *si ) / di : 1.0f;
}
else
{
if ( *ei > *bmax || *si < *bmin )
return false;
F32 di = *ei - *si;
st = ( *si > *bmax ) ? ( *bmax - *si ) / di : 0.0f;
et = ( *ei < *bmin ) ? ( *bmin - *si ) / di : 1.0f;
}
if ( st > fst ) fst = st;
if ( et < fet ) fet = et;
if ( fet < fst )
return false;
bmin++; bmax++;
si++; ei++;
}
info->normal = start - end;
info->normal.normalizeSafe();
getTransform().mulV( info->normal );
F32 fst;
if (!mObjBox.collideLine(start, end, &fst, &info->normal))
return false;
info->t = fst;
info->object = this;

View file

@ -1155,7 +1155,7 @@ void TurretShape::unpackUpdate(NetConnection *connection, BitStream *stream)
void TurretShape::getWeaponMountTransform( S32 index, const MatrixF &xfm, MatrixF *outMat )
{
// Returns mount point to world space transform
if ( index >= 0 && index < SceneObject::NumMountPoints) {
if ( index >= 0 && index < ShapeBase::MaxMountedImages) {
S32 ni = mDataBlock->weaponMountNode[index];
if (ni != -1) {
MatrixF mountTransform = mShapeInstance->mNodeTransforms[ni];
@ -1180,7 +1180,7 @@ void TurretShape::getWeaponMountTransform( S32 index, const MatrixF &xfm, Matrix
void TurretShape::getRenderWeaponMountTransform( F32 delta, S32 mountPoint, const MatrixF &xfm, MatrixF *outMat )
{
// Returns mount point to world space transform
if ( mountPoint >= 0 && mountPoint < SceneObject::NumMountPoints) {
if ( mountPoint >= 0 && mountPoint < ShapeBase::MaxMountedImages) {
S32 ni = mDataBlock->weaponMountNode[mountPoint];
if (ni != -1) {
MatrixF mountTransform = mShapeInstance->mNodeTransforms[ni];

View file

@ -41,10 +41,10 @@
/// code version, the game name, and which type of game it is (TGB, TGE, TGEA, etc.).
///
/// Version number is major * 1000 + minor * 100 + revision * 10.
#define TORQUE_GAME_ENGINE 3610
#define TORQUE_GAME_ENGINE 3620
/// Human readable engine version string.
#define TORQUE_GAME_ENGINE_VERSION_STRING "3.6.1"
#define TORQUE_GAME_ENGINE_VERSION_STRING "3.6.2"
/// Gets the engine version number. The version number is specified as a global in version.cc
U32 getVersionNumber();

View file

@ -696,7 +696,7 @@ DefineEngineFunction(makeFullPath, String, ( const char* path, const char* cwd )
"@ingroup FileSystem")
{
static const U32 bufSize = 512;
char *buf = Con::getReturnBuffer(buf);
char *buf = Con::getReturnBuffer(bufSize);
Platform::makeFullPathName(path, buf, bufSize, dStrlen(cwd) > 1 ? cwd : NULL);
return buf;
}
@ -723,7 +723,7 @@ DefineEngineFunction(pathConcat, String, ( const char* path, const char* file),,
"@ingroup FileSystem")
{
static const U32 bufSize = 1024;
char *buf = Con::getReturnBuffer(buf);
char *buf = Con::getReturnBuffer(bufSize);
Platform::makeFullPathName(file, buf, bufSize, path);
return buf;
}

View file

@ -2225,7 +2225,10 @@ DefineEngineMethod( GuiCanvas, reset, void, (),,
}
DefineEngineMethod( GuiCanvas, getCursorPos, Point2I, (),,
"@brief Get the current position of the cursor.\n\n"
"@brief Get the current position of the cursor in screen-space. Note that this position"
" might be outside the Torque window. If you want to get the position within the Canvas,"
" call screenToClient on the result.\n\n"
"@see Canvas::screenToClient()\n\n"
"@param param Description\n\n"
"@tsexample\n"
"%cursorPos = Canvas.getCursorPos();\n"

View file

@ -1427,6 +1427,7 @@ bool GuiControl::cursorInControl()
if (! root) return false;
Point2I pt = root->getCursorPos();
pt = root->getPlatformWindow() ? root->getPlatformWindow()->screenToClient(pt) : pt;
Point2I extent = getExtent();
Point2I offset = localToGlobalCoord(Point2I(0, 0));
if (pt.x >= offset.x && pt.y >= offset.y &&

View file

@ -368,7 +368,7 @@ void ProcessedFFMaterial::_initPassStateBlock( RenderPassData *rpd, GFXStateBloc
result.blendDefined = true;
result.blendEnable = true;
result.blendSrc = GFXBlendOne;
result.blendSrc = GFXBlendOne;
result.blendDest = GFXBlendZero;
}
// This is here for generic FF shader fallbacks.

View file

@ -328,6 +328,7 @@ void ProcessedShaderMaterial::_determineFeatures( U32 stageNum,
if ( features.hasFeature( MFT_UseInstancing ) &&
mMaxStages == 1 &&
!mMaterial->mGlow[0] &&
!mMaterial->mDynamicCubemap &&
shaderVersion >= 3.0f )
fd.features.addFeature( MFT_UseInstancing );

View file

@ -122,7 +122,6 @@ void RenderBinManager::internalAddElement(RenderInst* inst)
mElementList.increment();
MainSortElem &elem = mElementList.last();
elem.inst = inst;
elem.key = elem.key2 = 0;
elem.key = inst->defaultKey;
elem.key2 = inst->defaultKey2;

View file

@ -371,7 +371,6 @@ Marker::Marker()
mTypeMask |= MarkerObjectType;
mSeqNum = 0;
mSmoothingType = SmoothingTypeLinear;
mMSToNext = 1000;
mSmoothingType = SmoothingTypeSpline;
mKnotType = KnotTypeNormal;

View file

@ -784,7 +784,7 @@ bool TSMesh::castRayRendered( S32 frame, const Point3F & start, const Point3F &
// gonna depend on what kind of primitive it is...
if ( (draw.matIndex & TSDrawPrimitive::TypeMask) == TSDrawPrimitive::Triangles )
{
for ( S32 j = 0; j < draw.numElements-2; j++)
for ( S32 j = 0; j < draw.numElements-2; j += 3 )
{
idx0 = indices[drawStart + j + 0];
idx1 = indices[drawStart + j + 1];