From c514841ebbf35f723ddcb3288df0c5afd262fb4f Mon Sep 17 00:00:00 2001 From: Azaezel Date: Wed, 11 Jun 2014 03:09:41 -0500 Subject: [PATCH 01/21] Binds the full metrics display to CTRL+F2 while in-game. Escape Closes. --- Templates/Empty/game/core/art/gui/FrameOverlayGui.gui | 2 ++ Templates/Empty/game/scripts/client/default.bind.cs | 6 +++++- Templates/Full/game/core/art/gui/FrameOverlayGui.gui | 2 ++ Templates/Full/game/scripts/client/default.bind.cs | 6 +++++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Templates/Empty/game/core/art/gui/FrameOverlayGui.gui b/Templates/Empty/game/core/art/gui/FrameOverlayGui.gui index 04a3f1472..2736b7ade 100644 --- a/Templates/Empty/game/core/art/gui/FrameOverlayGui.gui +++ b/Templates/Empty/game/core/art/gui/FrameOverlayGui.gui @@ -23,6 +23,8 @@ modal = "True"; helpTag = "0"; expression = "10"; + command = "Canvas.popDialog(FrameOverlayGui);"; + accelerator = "escape"; }; }; //--- OBJECT WRITE END --- diff --git a/Templates/Empty/game/scripts/client/default.bind.cs b/Templates/Empty/game/scripts/client/default.bind.cs index fa7455271..05ced493e 100644 --- a/Templates/Empty/game/scripts/client/default.bind.cs +++ b/Templates/Empty/game/scripts/client/default.bind.cs @@ -441,7 +441,11 @@ GlobalActionMap.bind(keyboard, "ctrl o", bringUpOptions); //------------------------------------------------------------------------------ // Debugging Functions //------------------------------------------------------------------------------ - +function showmetrics(%val) +{ + metrics("FPS GFX SHADOW SFX TERRAIN GROUNDCOVER FOREST NET"); +} +GlobalActionMap.bind(keyboard, "ctrl F2", showmetrics); //------------------------------------------------------------------------------ // diff --git a/Templates/Full/game/core/art/gui/FrameOverlayGui.gui b/Templates/Full/game/core/art/gui/FrameOverlayGui.gui index 04a3f1472..2736b7ade 100644 --- a/Templates/Full/game/core/art/gui/FrameOverlayGui.gui +++ b/Templates/Full/game/core/art/gui/FrameOverlayGui.gui @@ -23,6 +23,8 @@ modal = "True"; helpTag = "0"; expression = "10"; + command = "Canvas.popDialog(FrameOverlayGui);"; + accelerator = "escape"; }; }; //--- OBJECT WRITE END --- diff --git a/Templates/Full/game/scripts/client/default.bind.cs b/Templates/Full/game/scripts/client/default.bind.cs index 803124bc0..2ea70cbee 100644 --- a/Templates/Full/game/scripts/client/default.bind.cs +++ b/Templates/Full/game/scripts/client/default.bind.cs @@ -615,7 +615,11 @@ GlobalActionMap.bind(keyboard, "ctrl o", bringUpOptions); //------------------------------------------------------------------------------ // Debugging Functions //------------------------------------------------------------------------------ - +function showmetrics(%val) +{ + metrics("FPS GFX SHADOW SFX TERRAIN GROUNDCOVER FOREST NET"); +} +GlobalActionMap.bind(keyboard, "ctrl F2", showmetrics); //------------------------------------------------------------------------------ // From e442b87c0c4d6f9dd13d4156a3867aae8e6eb96c Mon Sep 17 00:00:00 2001 From: bank Date: Wed, 18 Jun 2014 11:33:38 +0400 Subject: [PATCH 02/21] Fix: Null'ed pointer usage, possible access violation. This fixes issue #700 --- Engine/source/T3D/debris.cpp | 6 +----- Engine/source/T3D/fx/explosion.cpp | 5 +---- Engine/source/T3D/fx/splash.cpp | 6 +----- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/Engine/source/T3D/debris.cpp b/Engine/source/T3D/debris.cpp index 495b5dbc2..77d5fc603 100644 --- a/Engine/source/T3D/debris.cpp +++ b/Engine/source/T3D/debris.cpp @@ -659,11 +659,7 @@ void Debris::onRemove() } } - if( getSceneManager() ) - getSceneManager()->removeObjectFromScene(this); - - if( getContainer() ) - getContainer()->removeObject(this); + removeFromScene(); Parent::onRemove(); } diff --git a/Engine/source/T3D/fx/explosion.cpp b/Engine/source/T3D/fx/explosion.cpp index dd81dcba8..f23400232 100644 --- a/Engine/source/T3D/fx/explosion.cpp +++ b/Engine/source/T3D/fx/explosion.cpp @@ -964,10 +964,7 @@ void Explosion::onRemove() mMainEmitter = NULL; } - if (getSceneManager() != NULL) - getSceneManager()->removeObjectFromScene(this); - if (getContainer() != NULL) - getContainer()->removeObject(this); + removeFromScene(); Parent::onRemove(); } diff --git a/Engine/source/T3D/fx/splash.cpp b/Engine/source/T3D/fx/splash.cpp index 1558f2dbc..0e9a2c6f4 100644 --- a/Engine/source/T3D/fx/splash.cpp +++ b/Engine/source/T3D/fx/splash.cpp @@ -415,11 +415,7 @@ void Splash::onRemove() ringList.clear(); - if( getSceneManager() ) - getSceneManager()->removeObjectFromScene(this); - - if( getContainer() ) - getContainer()->removeObject(this); + removeFromScene(); Parent::onRemove(); } From ebbd8a2e0209e8c18de51c620bc8a073b48d8a56 Mon Sep 17 00:00:00 2001 From: Azaezel Date: Fri, 20 Jun 2014 14:45:12 -0500 Subject: [PATCH 03/21] Instancing clones the results of a previously used material to it's next instance. As such, it and Dynamic Cube Mapping are mutually exclusive features. --- Engine/source/materials/processedShaderMaterial.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Engine/source/materials/processedShaderMaterial.cpp b/Engine/source/materials/processedShaderMaterial.cpp index 410773d7e..1b17c17ce 100644 --- a/Engine/source/materials/processedShaderMaterial.cpp +++ b/Engine/source/materials/processedShaderMaterial.cpp @@ -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 ); From c23f3fbd9fef98f8346f0939989f1089b276118d Mon Sep 17 00:00:00 2001 From: bank Date: Thu, 16 Oct 2014 19:23:10 +0400 Subject: [PATCH 04/21] Fix initializing return buffer. Use "bufSize", not the "buf" itself. --- Engine/source/console/fileSystemFunctions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/console/fileSystemFunctions.cpp b/Engine/source/console/fileSystemFunctions.cpp index 75b1ba9f7..b37a61386 100644 --- a/Engine/source/console/fileSystemFunctions.cpp +++ b/Engine/source/console/fileSystemFunctions.cpp @@ -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; } From d9c5670e935d79b18e5957a69f8be4e16fc04079 Mon Sep 17 00:00:00 2001 From: bank Date: Thu, 16 Oct 2014 19:39:25 +0400 Subject: [PATCH 05/21] Fix possible array overrun. We should clamp the index value to the size of the weaponMountNode[], which is ShapeBase::MaxMountedImages (4) and SceneObject::NumMountPoints = 31. --- Engine/source/T3D/turret/turretShape.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/T3D/turret/turretShape.cpp b/Engine/source/T3D/turret/turretShape.cpp index 5d53fabe8..b824d75cd 100644 --- a/Engine/source/T3D/turret/turretShape.cpp +++ b/Engine/source/T3D/turret/turretShape.cpp @@ -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]; From 62006e8b3c5971fd2fde47075ae43d4b6bd642a7 Mon Sep 17 00:00:00 2001 From: bank Date: Thu, 16 Oct 2014 19:39:54 +0400 Subject: [PATCH 06/21] Remove unneeded double-initialization of the vars. --- Engine/source/T3D/debris.cpp | 1 - Engine/source/materials/processedFFMaterial.cpp | 2 +- Engine/source/renderInstance/renderBinManager.cpp | 1 - Engine/source/scene/simPath.cpp | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Engine/source/T3D/debris.cpp b/Engine/source/T3D/debris.cpp index 77d5fc603..d8ef4f8fa 100644 --- a/Engine/source/T3D/debris.cpp +++ b/Engine/source/T3D/debris.cpp @@ -99,7 +99,6 @@ DebrisData::DebrisData() friction = 0.2f; numBounces = 0; bounceVariance = 0; - minSpinSpeed = maxSpinSpeed = 0.0; staticOnMaxBounce = false; explodeOnMaxBounce = false; snapOnMaxBounce = false; diff --git a/Engine/source/materials/processedFFMaterial.cpp b/Engine/source/materials/processedFFMaterial.cpp index 500783aee..1a1a4f9e5 100644 --- a/Engine/source/materials/processedFFMaterial.cpp +++ b/Engine/source/materials/processedFFMaterial.cpp @@ -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. diff --git a/Engine/source/renderInstance/renderBinManager.cpp b/Engine/source/renderInstance/renderBinManager.cpp index 5fb05eebf..df41b634c 100644 --- a/Engine/source/renderInstance/renderBinManager.cpp +++ b/Engine/source/renderInstance/renderBinManager.cpp @@ -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; diff --git a/Engine/source/scene/simPath.cpp b/Engine/source/scene/simPath.cpp index 1ab5677ec..c25764ad1 100644 --- a/Engine/source/scene/simPath.cpp +++ b/Engine/source/scene/simPath.cpp @@ -371,7 +371,6 @@ Marker::Marker() mTypeMask |= MarkerObjectType; mSeqNum = 0; - mSmoothingType = SmoothingTypeLinear; mMSToNext = 1000; mSmoothingType = SmoothingTypeSpline; mKnotType = KnotTypeNormal; From b9ebe479a38427c01992c5afa7b4e2d95d93ca97 Mon Sep 17 00:00:00 2001 From: Daniel Buckmaster Date: Sun, 19 Oct 2014 20:43:44 +1100 Subject: [PATCH 07/21] Disable all post effects by default. --- .../core/scripts/client/postFx/default.postfxpreset.cs | 7 ++++++- .../core/scripts/client/postFx/default.postfxpreset.cs | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Templates/Empty/game/core/scripts/client/postFx/default.postfxpreset.cs b/Templates/Empty/game/core/scripts/client/postFx/default.postfxpreset.cs index 35843b249..2fe077e63 100644 --- a/Templates/Empty/game/core/scripts/client/postFx/default.postfxpreset.cs +++ b/Templates/Empty/game/core/scripts/client/postFx/default.postfxpreset.cs @@ -20,6 +20,11 @@ // IN THE SOFTWARE. //----------------------------------------------------------------------------- +$PostFXManager::Settings::EnableDOF = "0"; +$PostFXManager::Settings::EnabledSSAO = "0"; +$PostFXManager::Settings::EnableHDR = "0"; +$PostFXManager::Settings::EnableLightRays = "0"; +$PostFXManager::Settings::EnablePostFX = "0"; $PostFXManager::Settings::DOF::BlurCurveFar = ""; $PostFXManager::Settings::DOF::BlurCurveNear = ""; $PostFXManager::Settings::DOF::BlurMax = ""; @@ -59,4 +64,4 @@ $PostFXManager::Settings::SSAO::sNormalPow = "1"; $PostFXManager::Settings::SSAO::sNormalTol = "0"; $PostFXManager::Settings::SSAO::sRadius = "0.1"; $PostFXManager::Settings::SSAO::sStrength = "6"; -$PostFXManager::Settings::ColorCorrectionRamp = "core/scripts/client/postFx/null_color_ramp.png"; \ No newline at end of file +$PostFXManager::Settings::ColorCorrectionRamp = "core/scripts/client/postFx/null_color_ramp.png"; diff --git a/Templates/Full/game/core/scripts/client/postFx/default.postfxpreset.cs b/Templates/Full/game/core/scripts/client/postFx/default.postfxpreset.cs index 35843b249..2fe077e63 100644 --- a/Templates/Full/game/core/scripts/client/postFx/default.postfxpreset.cs +++ b/Templates/Full/game/core/scripts/client/postFx/default.postfxpreset.cs @@ -20,6 +20,11 @@ // IN THE SOFTWARE. //----------------------------------------------------------------------------- +$PostFXManager::Settings::EnableDOF = "0"; +$PostFXManager::Settings::EnabledSSAO = "0"; +$PostFXManager::Settings::EnableHDR = "0"; +$PostFXManager::Settings::EnableLightRays = "0"; +$PostFXManager::Settings::EnablePostFX = "0"; $PostFXManager::Settings::DOF::BlurCurveFar = ""; $PostFXManager::Settings::DOF::BlurCurveNear = ""; $PostFXManager::Settings::DOF::BlurMax = ""; @@ -59,4 +64,4 @@ $PostFXManager::Settings::SSAO::sNormalPow = "1"; $PostFXManager::Settings::SSAO::sNormalTol = "0"; $PostFXManager::Settings::SSAO::sRadius = "0.1"; $PostFXManager::Settings::SSAO::sStrength = "6"; -$PostFXManager::Settings::ColorCorrectionRamp = "core/scripts/client/postFx/null_color_ramp.png"; \ No newline at end of file +$PostFXManager::Settings::ColorCorrectionRamp = "core/scripts/client/postFx/null_color_ramp.png"; From 0dde7022c20a195729d20ec494b87147da59018a Mon Sep 17 00:00:00 2001 From: Azaezel Date: Thu, 23 Oct 2014 05:03:28 -0500 Subject: [PATCH 08/21] engine: corrects offsets for the guiobjectview gui element which displays materialized meshes, and exposes it's specialized renderering system to the postfx subsystem. immediate purpose: corrected display long term purpose: deferred display. --- Engine/source/T3D/guiObjectView.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Engine/source/T3D/guiObjectView.cpp b/Engine/source/T3D/guiObjectView.cpp index 00e5de0df..32c1b1565 100644 --- a/Engine/source/T3D/guiObjectView.cpp +++ b/Engine/source/T3D/guiObjectView.cpp @@ -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. From 4fb820c3ef21d8ccd7a72440bfd0ede2b354e952 Mon Sep 17 00:00:00 2001 From: Daniel Buckmaster Date: Fri, 24 Oct 2014 09:17:48 +1100 Subject: [PATCH 09/21] New Physics doc group. --- Engine/source/T3D/rigidShape.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/T3D/rigidShape.cpp b/Engine/source/T3D/rigidShape.cpp index f0545d054..c69396fde 100644 --- a/Engine/source/T3D/rigidShape.cpp +++ b/Engine/source/T3D/rigidShape.cpp @@ -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" ); From d73ddc5d7777391ec975d396b3e699065cd97d6c Mon Sep 17 00:00:00 2001 From: Daniel Buckmaster Date: Mon, 27 Oct 2014 17:22:50 +1100 Subject: [PATCH 10/21] Create CONTRIBUTING.md --- CONTRIBUTING.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..db625977f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,57 @@ +# Torque 3D contribution guidelines + +So you want to help TOrque out by contributing to the repo? That's awesome! +We just ask that you'd give this document a quick read to get yourself familiar with the process. +Do you want to [request a feature](#request-a-feature)? +Create a [pull-request](#create-a-pull-request) to contribute your own code to the engine? +[Report an issue](#report-an-issue) you've discovered? + +## Report an issue + +Before you report an issue with the engine, please [search](https://github.com/GarageGames/Torque3D/issues) and quickly make sure someone else hasn't obviously reported it. +If you're ont sure if it's the same issue, go ahead and comment on the issue! +Once you're certain you've found a new issue, hit the [big green button](https://github.com/GarageGames/Torque3D/issues/new) and please include the following information: + + * Your platform and compiler, if you're not using a precompiled binary + * Steps to reproduce the issue, if _at all_ possible + * If it's related to graphics, your GFX card and driver details. + +## Create a pull-request + +We ask that potential contributors read our [pull-request guidelines](http://torque3d.org/contribute/#pull-request-guide) before opening a PR. +Here's a quick guide to the branches in this repo that you might think of targeting a PR at: + +### The master branch + +The repository's `master` branch is where we make releases. +It's supposed to be stable at all times - or as stable as we can make it - and only gets updated when a new version comes out. +Any pull-requests to the master branch will have to be rejected - sorry :(. + +### The development branch + +The `development` branch is where most development happens. +It is the target for the next 'middle' version of the engine (the 6 in 3.6.1, for example). +This means we will add new features, and refactor code if it doesn't break existing games made with the engine _too_ much*. +Most pull requests to `development` can be accepted if we like your code - unless they would potentially break users' games. + +*How much is _too_ much is for the Steering Committee to decide. + +### The development-3.6 branch + +The `development-3.6` branch is where we will make bugfixes and small patches to the previous stable 'middle' version. +This branch is where the 'small' versions will be created - 3.6.2, 3.6.3, etcetera. +So if you have a bugfix or tiny enhancement that doesn't require anyone to change their game, it'd be best appreciated in this branch. + +### TLDR + +Don't make any PRs to `master`. +PR new features and large fixes/refactorings to `development`. +PR bugfixes to `development-3.6`. + +## Request a feature + +We ask that all feature requests be discussed in the [GarageGames forums](http://www.garagegames.com/community/forums), our [IRC channel](http://torque3d.wikidot.com/community:chat), or on our [UserVoice feature request voting page](https://garagegames.uservoice.com/forums/178972-torque-3d-mit/filters/top) before making an issue here. +If your idea is popular, we'll hear of it and probably make an issue ourselves, if we agree. + +Even better - don't request a feature, start working on it! +This engine isn't going to improve itself ;). From 8e1a323e181a6af090d26ac9df51bc25df4ada45 Mon Sep 17 00:00:00 2001 From: Daniel Buckmaster Date: Mon, 27 Oct 2014 17:25:26 +1100 Subject: [PATCH 11/21] Fixed typos. --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index db625977f..997d6782c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Torque 3D contribution guidelines -So you want to help TOrque out by contributing to the repo? That's awesome! +So you want to help Torque out by contributing to the repo? That's awesome! We just ask that you'd give this document a quick read to get yourself familiar with the process. Do you want to [request a feature](#request-a-feature)? Create a [pull-request](#create-a-pull-request) to contribute your own code to the engine? @@ -9,7 +9,7 @@ Create a [pull-request](#create-a-pull-request) to contribute your own code to t ## Report an issue Before you report an issue with the engine, please [search](https://github.com/GarageGames/Torque3D/issues) and quickly make sure someone else hasn't obviously reported it. -If you're ont sure if it's the same issue, go ahead and comment on the issue! +If you're not sure if it's the same issue, go ahead and comment on it! Once you're certain you've found a new issue, hit the [big green button](https://github.com/GarageGames/Torque3D/issues/new) and please include the following information: * Your platform and compiler, if you're not using a precompiled binary From 355ce5d85475ce4637c130b20fa575902d678378 Mon Sep 17 00:00:00 2001 From: Daniel Buckmaster Date: Tue, 28 Oct 2014 09:26:46 +1100 Subject: [PATCH 12/21] Andrew's fix for ear transform with detached camera. --- Engine/source/T3D/sfx/sfx3DWorld.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Engine/source/T3D/sfx/sfx3DWorld.cpp b/Engine/source/T3D/sfx/sfx3DWorld.cpp index b04338460..1246895d0 100644 --- a/Engine/source/T3D/sfx/sfx3DWorld.cpp +++ b/Engine/source/T3D/sfx/sfx3DWorld.cpp @@ -91,7 +91,9 @@ void SFX3DObject::getEarTransform( MatrixF& transform ) const if ( !shapeInstance ) { // Just in case. - transform = mObject->getTransform(); + GameConnection* connection = dynamic_cast(NetConnection::getConnectionToServer()); + if ( !connection || !connection->getControlCameraTransform( 0.0f, &transform ) ) + transform = mObject->getTransform(); return; } From f3b08501c071c4b5cab44ed56cfdad067c6e0862 Mon Sep 17 00:00:00 2001 From: Daniel Buckmaster Date: Fri, 31 Oct 2014 08:07:19 +1100 Subject: [PATCH 13/21] Enable gamepad input when the startup GUI wakes. --- Templates/Empty/game/scripts/gui/startupGui.cs | 6 ++++++ Templates/Full/game/scripts/gui/startupGui.cs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/Templates/Empty/game/scripts/gui/startupGui.cs b/Templates/Empty/game/scripts/gui/startupGui.cs index 675daeafa..afd4be7d4 100644 --- a/Templates/Empty/game/scripts/gui/startupGui.cs +++ b/Templates/Empty/game/scripts/gui/startupGui.cs @@ -45,6 +45,12 @@ function loadStartup() //SFXPlayOnce(AudioGui, "art/sound/gui/startup");//SFXPlay(startsnd); } +function StartupGui::onWake(%this) +{ + $enableDirectInput = "1"; + activateDirectInput(); +} + function StartupGui::click(%this) { %this.done = true; diff --git a/Templates/Full/game/scripts/gui/startupGui.cs b/Templates/Full/game/scripts/gui/startupGui.cs index 675daeafa..afd4be7d4 100644 --- a/Templates/Full/game/scripts/gui/startupGui.cs +++ b/Templates/Full/game/scripts/gui/startupGui.cs @@ -45,6 +45,12 @@ function loadStartup() //SFXPlayOnce(AudioGui, "art/sound/gui/startup");//SFXPlay(startsnd); } +function StartupGui::onWake(%this) +{ + $enableDirectInput = "1"; + activateDirectInput(); +} + function StartupGui::click(%this) { %this.done = true; From e209cc4389d48671163e7037e9b9123a48287541 Mon Sep 17 00:00:00 2001 From: Daniel Buckmaster Date: Fri, 31 Oct 2014 09:11:07 +1100 Subject: [PATCH 14/21] Use existing methods instead of incorrect maths. --- Engine/source/T3D/tsStatic.cpp | 38 +++------------------------------- 1 file changed, 3 insertions(+), 35 deletions(-) diff --git a/Engine/source/T3D/tsStatic.cpp b/Engine/source/T3D/tsStatic.cpp index 1474bf96d..f072528cd 100644 --- a/Engine/source/T3D/tsStatic.cpp +++ b/Engine/source/T3D/tsStatic.cpp @@ -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; From a87a891cfc88cc153304b8c4c42c4d235e4bfe22 Mon Sep 17 00:00:00 2001 From: Daniel Buckmaster Date: Fri, 31 Oct 2014 10:04:32 +1100 Subject: [PATCH 15/21] Prevent crash when loading Player with no shape. --- Engine/source/T3D/player.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Engine/source/T3D/player.cpp b/Engine/source/T3D/player.cpp index 5a30fb77b..241be2c2f 100644 --- a/Engine/source/T3D/player.cpp +++ b/Engine/source/T3D/player.cpp @@ -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) From d12310602d4bad23b333494c546e3462249344b0 Mon Sep 17 00:00:00 2001 From: Daniel Buckmaster Date: Sun, 2 Nov 2014 07:35:39 +1100 Subject: [PATCH 16/21] Increment vertex pointer by 3, not 1. --- Engine/source/ts/tsMesh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/ts/tsMesh.cpp b/Engine/source/ts/tsMesh.cpp index 6648ae931..0ed173297 100644 --- a/Engine/source/ts/tsMesh.cpp +++ b/Engine/source/ts/tsMesh.cpp @@ -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]; From f6d54d810be1d198ff804737a55082a518144a34 Mon Sep 17 00:00:00 2001 From: Daniel Buckmaster Date: Sun, 2 Nov 2014 07:43:45 +1100 Subject: [PATCH 17/21] Improve documentation on getCursorPos and fix cursorInControl. --- Engine/source/gui/core/guiCanvas.cpp | 5 ++++- Engine/source/gui/core/guiControl.cpp | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Engine/source/gui/core/guiCanvas.cpp b/Engine/source/gui/core/guiCanvas.cpp index ad5646fe6..68889af3d 100644 --- a/Engine/source/gui/core/guiCanvas.cpp +++ b/Engine/source/gui/core/guiCanvas.cpp @@ -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" diff --git a/Engine/source/gui/core/guiControl.cpp b/Engine/source/gui/core/guiControl.cpp index 1485f81d8..b52a398b3 100644 --- a/Engine/source/gui/core/guiControl.cpp +++ b/Engine/source/gui/core/guiControl.cpp @@ -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 && From 1e47b7bf4494e61968a257a9e1bf3f62482642b1 Mon Sep 17 00:00:00 2001 From: Daniel Buckmaster Date: Sun, 2 Nov 2014 08:04:12 +1100 Subject: [PATCH 18/21] Mention code style guidelines. --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 997d6782c..dd81cb739 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,6 +19,7 @@ Once you're certain you've found a new issue, hit the [big green button](https:/ ## Create a pull-request We ask that potential contributors read our [pull-request guidelines](http://torque3d.org/contribute/#pull-request-guide) before opening a PR. +We also have some [code style guidelines](https://github.com/GarageGames/Torque3D/wiki/Code-Style-Guidelines). Here's a quick guide to the branches in this repo that you might think of targeting a PR at: ### The master branch From a61be8783aa291feb322e7b3ad5631eda24a8537 Mon Sep 17 00:00:00 2001 From: Daniel Buckmaster Date: Fri, 24 Oct 2014 09:17:48 +1100 Subject: [PATCH 19/21] New Physics doc group. --- Engine/source/T3D/rigidShape.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/T3D/rigidShape.cpp b/Engine/source/T3D/rigidShape.cpp index f0545d054..c69396fde 100644 --- a/Engine/source/T3D/rigidShape.cpp +++ b/Engine/source/T3D/rigidShape.cpp @@ -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" ); From dc92d58692b067b719013c2a51a32d599f3bb6ec Mon Sep 17 00:00:00 2001 From: Daniel Buckmaster Date: Tue, 4 Nov 2014 11:06:39 +1100 Subject: [PATCH 20/21] Update version.h --- Engine/source/app/version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/app/version.h b/Engine/source/app/version.h index 963fd452e..9f68b2cbc 100644 --- a/Engine/source/app/version.h +++ b/Engine/source/app/version.h @@ -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(); From e2435e39d02d3763d9b5daf1c4f00e300b75b2c4 Mon Sep 17 00:00:00 2001 From: Daniel Buckmaster Date: Tue, 4 Nov 2014 10:00:55 +1100 Subject: [PATCH 21/21] Update README with new links and version number. --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index be83ee28c..5aed4b20a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Torque 3D v3.6.1 +Torque 3D v3.6.2 ================ MIT Licensed Open Source version of [Torque 3D](http://www.garagegames.com/products/torque-3d) from [GarageGames](http://www.garagegames.com) @@ -21,7 +21,9 @@ Pre-compiled Version In addition to GitHub we also have a couple of pre-packaged files for you to download if you would prefer to not compile the code yourself: -* [Complete Torque 3D 3.6.1 zip package](http://mit.garagegames.com/Torque3D-3-6-1.zip) with updated TorqueScript documentation, the *Project Manager*, and compiled versions of the templates. +* [Torque 3D 3.6 Full template](http://mit.garagegames.com/Torque3D-3-6-1-FullTemplate.zip), which contains precompiled binaries. +* [Complete Torque 3D 3.6 zip package](http://mit.garagegames.com/Torque3D-3-6-1.zip) containing the contents of this repository. +* [Windows binaries for 3.6.2](https://github.com/GarageGames/Torque3D/releases/tag/v3.6.2) which you can drop into your existing script projects. * [Torque 3D Project Manager v2.1](http://mit.garagegames.com/T3DProjectManager-2-1.zip) on its own for use in your T3D forks. If you're looking for an older release see the [Torque 3D Archive](https://github.com/GarageGames/Torque3D/wiki/Torque-3D-Archive)