From 16a159992ffd4c89c2646f49e593203d38490fed Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Fri, 12 Jun 2020 14:38:19 -0500 Subject: [PATCH 1/2] adress #162 based on work by Chad Hall --- Engine/source/T3D/spotLight.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Engine/source/T3D/spotLight.cpp b/Engine/source/T3D/spotLight.cpp index 4cc8ccb57..3a3340b60 100644 --- a/Engine/source/T3D/spotLight.cpp +++ b/Engine/source/T3D/spotLight.cpp @@ -134,9 +134,18 @@ void SpotLight::_conformLights() // Update the bounds and scale to fit our spotlight. F32 radius = mRange * mSin( mDegToRad( mOuterConeAngle ) * 0.5f ); - mObjBox.minExtents.set( -1, 0, -1 ); - mObjBox.maxExtents.set( 1, 1, 1 ); - mObjScale.set( radius, mRange, radius ); + Point3F objectScale(radius, mRange, radius); + Point3F objectBoxMin(-1, 0, -1); + + if (mAnimationData && mAnimationData->mRot.keyLen > 0) + { + objectBoxMin.set(-1, -1, -1); + objectScale.set(mRange, mRange, mRange); + } + + mObjBox.minExtents.set(objectBoxMin); + mObjBox.maxExtents.set(1, 1, 1); + mObjScale.set(objectScale); // Skip our transform... it just dirties mask bits. Parent::setTransform( mObjToWorld ); From 0c0646a90c42a41be4deb49a8cda6b112842bf4d Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sat, 13 Jun 2020 01:32:14 -0500 Subject: [PATCH 2/2] seed the engine core with three baseline light animation dbs. no motion, pulse, and spin. --- .../datablocks/defaultDatablocks.cs | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Templates/BaseGame/game/core/gameObjects/datablocks/defaultDatablocks.cs b/Templates/BaseGame/game/core/gameObjects/datablocks/defaultDatablocks.cs index 5d9f245aa..25192bf79 100644 --- a/Templates/BaseGame/game/core/gameObjects/datablocks/defaultDatablocks.cs +++ b/Templates/BaseGame/game/core/gameObjects/datablocks/defaultDatablocks.cs @@ -146,3 +146,26 @@ datablock CameraData(Observer) { mode = "Observer"; }; + +datablock LightAnimData( NullLightAnim ) +{ + animEnabled = false; +}; + +datablock LightAnimData( PulseLightAnim ) +{ + brightnessA = 0; + brightnessZ = 1; + brightnessPeriod = 1; + brightnessKeys = "aza"; + brightnessSmooth = true; +}; + +datablock LightAnimData( SpinLightAnim ) +{ + rotA[2] = "0"; + rotZ[2] = "360"; + rotPeriod[2] = "1"; + rotKeys[2] = "az"; + rotSmooth[2] = true; +};