Merge branch 'TorqueGameEngines:development' into development_gld

This commit is contained in:
GoldenThumbs 2022-08-27 00:23:36 -05:00 committed by GitHub
commit 666de4ab36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 340 additions and 155 deletions

View file

@ -2,9 +2,9 @@ name: CMake
on: on:
push: push:
branches: [ Preview4_0 ] branches: [ development ]
pull_request: pull_request:
branches: [ Preview4_0 ] branches: [ development ]
env: env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)

View file

@ -470,9 +470,6 @@ void GuiInspectorTypeImageAssetPtr::consoleInit()
GuiControl* GuiInspectorTypeImageAssetPtr::constructEditControl() GuiControl* GuiInspectorTypeImageAssetPtr::constructEditControl()
{ {
if (mInspector->getInspectObject() == nullptr)
return nullptr;
// Create base filename edit controls // Create base filename edit controls
GuiControl* retCtrl = Parent::constructEditControl(); GuiControl* retCtrl = Parent::constructEditControl();
if (retCtrl == NULL) if (retCtrl == NULL)
@ -480,16 +477,28 @@ GuiControl* GuiInspectorTypeImageAssetPtr::constructEditControl()
retCtrl->getRenderTooltipDelegate().bind(this, &GuiInspectorTypeImageAssetPtr::renderTooltip); retCtrl->getRenderTooltipDelegate().bind(this, &GuiInspectorTypeImageAssetPtr::renderTooltip);
// Change filespec if (mInspector->getInspectObject() != nullptr)
char szBuffer[512]; {
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ImageAsset\", \"AssetBrowser.changeAsset\", %s, %s);", // Change filespec
mInspector->getIdString(), mCaption); char szBuffer[512];
mBrowseButton->setField("Command", szBuffer); dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ImageAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
mInspector->getIdString(), mCaption);
mBrowseButton->setField("Command", szBuffer);
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString()); setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
}
else
{
//if we don't have a target object, we'll be manipulating the desination value directly
char szBuffer[512];
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ImageAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
mInspector->getIdString(), mVariableName);
mBrowseButton->setField("Command", szBuffer);
}
// Create "Open in ShapeEditor" button mImageEdButton = NULL;
mImageEdButton = new GuiBitmapButtonCtrl(); // Create "Open in ImageEditor" button
/*mImageEdButton = new GuiBitmapButtonCtrl();
char bitmapName[512] = "ToolsModule:GameTSCtrl_image"; char bitmapName[512] = "ToolsModule:GameTSCtrl_image";
mImageEdButton->setBitmap(StringTable->insert(bitmapName)); mImageEdButton->setBitmap(StringTable->insert(bitmapName));
@ -498,10 +507,10 @@ GuiControl* GuiInspectorTypeImageAssetPtr::constructEditControl()
mImageEdButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile"); mImageEdButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");
mImageEdButton->setDataField(StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile"); mImageEdButton->setDataField(StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile");
mImageEdButton->setDataField(StringTable->insert("hovertime"), NULL, "1000"); mImageEdButton->setDataField(StringTable->insert("hovertime"), NULL, "1000");
mImageEdButton->setDataField(StringTable->insert("tooltip"), NULL, "Open this file in the Shape Editor"); mImageEdButton->setDataField(StringTable->insert("tooltip"), NULL, "Open this file in the Image Editor");
mImageEdButton->registerObject(); mImageEdButton->registerObject();
addObject(mImageEdButton); addObject(mImageEdButton);*/
return retCtrl; return retCtrl;
} }
@ -517,18 +526,21 @@ bool GuiInspectorTypeImageAssetPtr::updateRects()
mEditCtrlRect.set(fieldExtent.x - dividerPos + dividerMargin, 1, dividerPos - dividerMargin - 34, fieldExtent.y); mEditCtrlRect.set(fieldExtent.x - dividerPos + dividerMargin, 1, dividerPos - dividerMargin - 34, fieldExtent.y);
bool resized = mEdit->resize(mEditCtrlRect.point, mEditCtrlRect.extent); bool resized = mEdit->resize(mEditCtrlRect.point, mEditCtrlRect.extent);
if (mBrowseButton != NULL)
{
mBrowseRect.set(fieldExtent.x - 32, 2, 14, fieldExtent.y - 4);
resized |= mBrowseButton->resize(mBrowseRect.point, mBrowseRect.extent);
}
if (mImageEdButton != NULL) if (mImageEdButton != NULL)
{ {
RectI shapeEdRect(fieldExtent.x - 16, 2, 14, fieldExtent.y - 4); RectI shapeEdRect(fieldExtent.x - 16, 2, 14, fieldExtent.y - 4);
resized |= mImageEdButton->resize(shapeEdRect.point, shapeEdRect.extent); resized |= mImageEdButton->resize(shapeEdRect.point, shapeEdRect.extent);
} }
if (mBrowseButton != NULL)
{
if(mImageEdButton != NULL)
mBrowseRect.set(fieldExtent.x - 32, 2, 14, fieldExtent.y - 4);
else
mBrowseRect.set(fieldExtent.x - 16, 2, 14, fieldExtent.y - 4);
resized |= mBrowseButton->resize(mBrowseRect.point, mBrowseRect.extent);
}
return resized; return resized;
} }

View file

@ -479,11 +479,22 @@ GuiControl* GuiInspectorTypeMaterialAssetPtr::constructEditControl()
// Change filespec // Change filespec
char szBuffer[512]; char szBuffer[512];
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"MaterialAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
mInspector->getIdString(), mCaption);
mBrowseButton->setField("Command", szBuffer);
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString()); if (mInspector->getInspectObject() != nullptr)
{
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"MaterialAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
mInspector->getIdString(), mCaption);
mBrowseButton->setField("Command", szBuffer);
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
}
else
{
//if we don't have a target object, we'll be manipulating the desination value directly
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"MaterialAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
mInspector->getIdString(), mVariableName);
mBrowseButton->setField("Command", szBuffer);
}
// Create "Open in Editor" button // Create "Open in Editor" button
mEditButton = new GuiBitmapButtonCtrl(); mEditButton = new GuiBitmapButtonCtrl();

View file

@ -749,11 +749,21 @@ GuiControl* GuiInspectorTypeShapeAssetPtr::constructEditControl()
// Change filespec // Change filespec
char szBuffer[512]; char szBuffer[512];
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ShapeAsset\", \"AssetBrowser.changeAsset\", %s, %s);", if (mInspector->getInspectObject() != nullptr)
mInspector->getIdString(), mCaption); {
mBrowseButton->setField("Command", szBuffer); dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ShapeAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
mInspector->getIdString(), mCaption);
mBrowseButton->setField("Command", szBuffer);
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString()); setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
}
else
{
//if we don't have a target object, we'll be manipulating the desination value directly
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ShapeAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
mInspector->getIdString(), mVariableName);
mBrowseButton->setField("Command", szBuffer);
}
// Create "Open in ShapeEditor" button // Create "Open in ShapeEditor" button
mShapeEdButton = new GuiBitmapButtonCtrl(); mShapeEdButton = new GuiBitmapButtonCtrl();

View file

@ -68,7 +68,7 @@ extern ColorI gCanvasClearColor;
/// @see DecalManager /// @see DecalManager
extern F32 gDecalBias; extern F32 gDecalBias;
extern LinearColorF gFallbackAmbient;
/// @see AccumulationVolume /// @see AccumulationVolume
extern GFXTexHandle gLevelAccuMap; extern GFXTexHandle gLevelAccuMap;
@ -86,6 +86,7 @@ LevelInfo::LevelInfo()
mDecalBias( 0.0015f ), mDecalBias( 0.0015f ),
mCanvasClearColor( 255, 0, 255, 255 ), mCanvasClearColor( 255, 0, 255, 255 ),
mAmbientLightBlendPhase( 1.f ), mAmbientLightBlendPhase( 1.f ),
mFallbackAmbient(LinearColorF(0.1f, 0.1f, 0.1f, 1.0f)),
mSoundAmbience( NULL ), mSoundAmbience( NULL ),
mSoundDistanceModel( SFXDistanceModelLinear ), mSoundDistanceModel( SFXDistanceModelLinear ),
mSoundscape( NULL ) mSoundscape( NULL )
@ -163,6 +164,8 @@ void LevelInfo::initPersistFields()
addField( "ambientLightBlendCurve", TypeEaseF, Offset( mAmbientLightBlendCurve, LevelInfo ), addField( "ambientLightBlendCurve", TypeEaseF, Offset( mAmbientLightBlendCurve, LevelInfo ),
"Interpolation curve to use for blending from one ambient light color to a different one." ); "Interpolation curve to use for blending from one ambient light color to a different one." );
addField("fallbackAmbient", TypeColorF, Offset(mFallbackAmbient, LevelInfo),
"Ambient Color to use if no global light source exists.");
//addField( "advancedLightmapSupport", TypeBool, Offset( mAdvancedLightmapSupport, LevelInfo ), //addField( "advancedLightmapSupport", TypeBool, Offset( mAdvancedLightmapSupport, LevelInfo ),
// "Enable expanded support for mixing static and dynamic lighting (more costly)" ); // "Enable expanded support for mixing static and dynamic lighting (more costly)" );
@ -211,6 +214,7 @@ U32 LevelInfo::packUpdate(NetConnection *conn, U32 mask, BitStream *stream)
stream->writeFlag( mAdvancedLightmapSupport ); stream->writeFlag( mAdvancedLightmapSupport );
stream->write( mAmbientLightBlendPhase ); stream->write( mAmbientLightBlendPhase );
mathWrite( *stream, mAmbientLightBlendCurve ); mathWrite( *stream, mAmbientLightBlendCurve );
stream->write(mFallbackAmbient);
sfxWrite( stream, mSoundAmbience ); sfxWrite( stream, mSoundAmbience );
stream->writeInt( mSoundDistanceModel, 1 ); stream->writeInt( mSoundDistanceModel, 1 );
@ -241,6 +245,7 @@ void LevelInfo::unpackUpdate(NetConnection *conn, BitStream *stream)
mAdvancedLightmapSupport = stream->readFlag(); mAdvancedLightmapSupport = stream->readFlag();
stream->read( &mAmbientLightBlendPhase ); stream->read( &mAmbientLightBlendPhase );
mathRead( *stream, &mAmbientLightBlendCurve ); mathRead( *stream, &mAmbientLightBlendCurve );
stream->read(&mFallbackAmbient);
String errorStr; String errorStr;
if( !sfxReadAndResolve( stream, &mSoundAmbience, errorStr ) ) if( !sfxReadAndResolve( stream, &mSoundAmbience, errorStr ) )
@ -323,8 +328,8 @@ void LevelInfo::_updateSceneGraph()
scene->setVisibleGhostDistance( mVisibleGhostDistance ); scene->setVisibleGhostDistance( mVisibleGhostDistance );
gDecalBias = mDecalBias; gDecalBias = mDecalBias;
// Set ambient lighting properties. // Set ambient lighting properties.
gFallbackAmbient = mFallbackAmbient;
scene->setAmbientLightTransitionTime( mAmbientLightBlendPhase * 1000.f ); scene->setAmbientLightTransitionTime( mAmbientLightBlendPhase * 1000.f );
scene->setAmbientLightTransitionCurve( mAmbientLightBlendCurve ); scene->setAmbientLightTransitionCurve( mAmbientLightBlendCurve );

View file

@ -78,7 +78,7 @@ class LevelInfo : public NetObject
/// Interpolation for going from one global ambient color /// Interpolation for going from one global ambient color
/// to a different one. /// to a different one.
EaseF mAmbientLightBlendCurve; EaseF mAmbientLightBlendCurve;
LinearColorF mFallbackAmbient;
/// @} /// @}
/// @name Sound Properties /// @name Sound Properties

View file

@ -393,7 +393,7 @@ void GuiGameSettingsCtrl::onRenderSliderOption(Point2I currentOffset)
GFont* font = mProfile->mFont; GFont* font = mProfile->mFont;
char stringVal[32]; char stringVal[32];
dSprintf(stringVal, 32, "%f", mValue); dSprintf(stringVal, 32, "%.1f", mValue);
S32 stringWidth = font->getStrWidth(stringVal); S32 stringWidth = font->getStrWidth(stringVal);
Point2I textOffset(sliderRect.point.x + sliderRect.extent.x, 0); Point2I textOffset(sliderRect.point.x + sliderRect.extent.x, 0);

View file

@ -1982,7 +1982,7 @@ bool GuiTreeViewCtrl::_hitTest(const Point2I & pnt, Item* & item, BitSet32 & fla
min += mProfile->mTextOffset.x; min += mProfile->mTextOffset.x;
FrameAllocatorMarker txtAlloc; FrameAllocatorMarker txtAlloc;
U32 bufLen = item->getDisplayTextLength() + 1; U32 bufLen = item->getDisplayTextLength() + 2;
char *buf = (char*)txtAlloc.alloc(bufLen); char *buf = (char*)txtAlloc.alloc(bufLen);
item->getDisplayText(bufLen, buf); item->getDisplayText(bufLen, buf);

View file

@ -428,7 +428,7 @@ void PopupMenu::showPopup(GuiCanvas *owner, S32 x /* = -1 */, S32 y /* = -1 */)
Point2I pos = Point2I::Zero; Point2I pos = Point2I::Zero;
if (x == -1 && y == -1) if (x == -1 && y == -1)
pos = owner->getCursorPos(); pos = owner->getCursorPosLocal();
else else
pos = Point2I(x, y); pos = Point2I(x, y);

View file

@ -42,6 +42,7 @@
Signal<void(const char*,bool)> LightManager::smActivateSignal; Signal<void(const char*,bool)> LightManager::smActivateSignal;
LightManager *LightManager::smActiveLM = NULL; LightManager *LightManager::smActiveLM = NULL;
LinearColorF gFallbackAmbient;
LightManager::LightManager( const char *name, const char *id ) LightManager::LightManager( const char *name, const char *id )
: mName( name ), : mName( name ),
@ -162,19 +163,28 @@ LightInfo* LightManager::getDefaultLight()
{ {
// The sun is always our default light when // The sun is always our default light when
// when its registered. // when its registered.
if ( mSpecialLights[ LightManager::slSunLightType ] ) if (mSpecialLights[LightManager::slSunLightType])
return mSpecialLights[ LightManager::slSunLightType ]; {
mSpecialLights[LightManager::slSunLightType]->setAmbient(gFallbackAmbient);
return mSpecialLights[LightManager::slSunLightType];
}
// Else return a dummy special light. // Else return a dummy special light.
if ( !mDefaultLight ) if (!mDefaultLight)
{
mDefaultLight = createLightInfo(); mDefaultLight = createLightInfo();
}
mDefaultLight->setAmbient(gFallbackAmbient);
return mDefaultLight; return mDefaultLight;
} }
LightInfo* LightManager::getSpecialLight( LightManager::SpecialLightTypesEnum type, bool useDefault ) LightInfo* LightManager::getSpecialLight( LightManager::SpecialLightTypesEnum type, bool useDefault )
{ {
if ( mSpecialLights[type] ) if (mSpecialLights[type])
{
mSpecialLights[LightManager::slSunLightType]->setAmbient(gFallbackAmbient);
return mSpecialLights[type]; return mSpecialLights[type];
}
if ( useDefault ) if ( useDefault )
return getDefaultLight(); return getDefaultLight();

View file

@ -34,9 +34,6 @@ static const U32 MaxExtent = 256;
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
Convex sTerrainConvexList;
// Number of vertices followed by point index // Number of vertices followed by point index
S32 sVertexList[5][5] = { S32 sVertexList[5][5] = {
{ 3, 1,2,3 }, // 135 B { 3, 1,2,3 }, // 135 B
@ -350,7 +347,7 @@ void TerrainBlock::buildConvex(const Box3F& box,Convex* convex)
{ {
PROFILE_SCOPE( TerrainBlock_buildConvex ); PROFILE_SCOPE( TerrainBlock_buildConvex );
sTerrainConvexList.collectGarbage(); mTerrainConvexList.collectGarbage();
// First check to see if the query misses the // First check to see if the query misses the
// terrain elevation range. // terrain elevation range.
@ -415,7 +412,7 @@ void TerrainBlock::buildConvex(const Box3F& box,Convex* convex)
// Create a new convex. // Create a new convex.
TerrainConvex* cp = new TerrainConvex; TerrainConvex* cp = new TerrainConvex;
sTerrainConvexList.registerObject(cp); mTerrainConvexList.registerObject(cp);
convex->addToWorkingList(cp); convex->addToWorkingList(cp);
cp->halfA = true; cp->halfA = true;
cp->square = 0; cp->square = 0;
@ -448,7 +445,7 @@ void TerrainBlock::buildConvex(const Box3F& box,Convex* convex)
cp->normal[1].normalize(); cp->normal[1].normalize();
if (mDot(vp[3] - vp[1],cp->normal[0]) > 0) { if (mDot(vp[3] - vp[1],cp->normal[0]) > 0) {
TerrainConvex* nc = new TerrainConvex(*cp); TerrainConvex* nc = new TerrainConvex(*cp);
sTerrainConvexList.registerObject(nc); mTerrainConvexList.registerObject(nc);
convex->addToWorkingList(nc); convex->addToWorkingList(nc);
nc->halfA = false; nc->halfA = false;
nc->square = cp; nc->square = cp;
@ -463,7 +460,7 @@ void TerrainBlock::buildConvex(const Box3F& box,Convex* convex)
cp->normal[1].normalize(); cp->normal[1].normalize();
if (mDot(vp[2] - vp[0],cp->normal[0]) > 0) { if (mDot(vp[2] - vp[0],cp->normal[0]) > 0) {
TerrainConvex* nc = new TerrainConvex(*cp); TerrainConvex* nc = new TerrainConvex(*cp);
sTerrainConvexList.registerObject(nc); mTerrainConvexList.registerObject(nc);
convex->addToWorkingList(nc); convex->addToWorkingList(nc);
nc->halfA = false; nc->halfA = false;
nc->square = cp; nc->square = cp;

View file

@ -220,13 +220,10 @@ TerrainBlock::TerrainBlock()
mTerrainAssetId = StringTable->EmptyString(); mTerrainAssetId = StringTable->EmptyString();
} }
extern Convex sTerrainConvexList;
TerrainBlock::~TerrainBlock() TerrainBlock::~TerrainBlock()
{ {
// Kill collision // Kill collision
sTerrainConvexList.nukeList(); mTerrainConvexList.nukeList();
SAFE_DELETE(mLightMap); SAFE_DELETE(mLightMap);
mLightMapTex = NULL; mLightMapTex = NULL;

View file

@ -56,6 +56,9 @@
#ifndef TERRAINASSET_H #ifndef TERRAINASSET_H
#include "T3D/assets/TerrainAsset.h" #include "T3D/assets/TerrainAsset.h"
#endif #endif
#ifndef _CONVEX_H_
#include "collision/convex.h"
#endif
class GBitmap; class GBitmap;
class TerrainBlock; class TerrainBlock;
@ -217,6 +220,9 @@ protected:
/// True if the zoning needs to be recalculated for the terrain. /// True if the zoning needs to be recalculated for the terrain.
bool mZoningDirty; bool mZoningDirty;
/// Holds the generated convex list stuff for this terrain
Convex mTerrainConvexList;
String _getBaseTexCacheFileName() const; String _getBaseTexCacheFileName() const;
void _rebuildQuadtree(); void _rebuildQuadtree();

View file

@ -672,6 +672,11 @@ void PlatformWindowSDL::_processSDLEvent(SDL_Event &evt)
case SDL_WINDOWEVENT_RESTORED: case SDL_WINDOWEVENT_RESTORED:
Con::setBoolVariable("pref::Video::isMaximized", false); Con::setBoolVariable("pref::Video::isMaximized", false);
break; break;
case SDL_WINDOWEVENT_DISPLAY_CHANGED:
Con::printf("Window moved to display #%d", evt.window.data1);
Con::setIntVariable("pref::Video::deviceId", evt.window.data1);
Con::evaluate("configureCanvas();");
break;
default: default:
break; break;

View file

@ -139,7 +139,7 @@ datablock MissionMarkerData(SpawnSphereMarker)
datablock MissionMarkerData(CameraBookmarkMarker) datablock MissionMarkerData(CameraBookmarkMarker)
{ {
category = "Misc"; category = "Misc";
shapeAsset = "Core_GameObjects:Camera"; shapeAsset = "Core_GameObjects:camera_shape";
}; };
datablock CameraData(Observer) datablock CameraData(Observer)

View file

@ -5,6 +5,7 @@
materialDefinitionName="CameraMat" materialDefinitionName="CameraMat"
VersionId="1"> VersionId="1">
<Material <Material
mapTo="CameraMat"
Name="CameraMat" Name="CameraMat"
doubleSided="1" doubleSided="1"
translucent="1" translucent="1"

View file

@ -0,0 +1,5 @@
<ShapeAsset
AssetName="camera_shape"
fileName="@assetFile=camera.fbx"
constuctorFileName="@assetFile=camera_shape.tscript"
materialSlot0="@asset=Core_GameObjects:CameraMat"/>

View file

@ -0,0 +1,11 @@
singleton TSShapeConstructor(cameradts2)
{
baseShapeAsset = "Core_GameObjects:Camera_shape";
singleDetailSize = "0";
flipUVCoords = "0";
JoinIdenticalVerts = "0";
reverseWindingOrder = "0";
removeRedundantMats = "0";
animFPS = "2";
};

View file

@ -382,6 +382,7 @@ vec4 computeForwardProbes(Surface surface,
float probehits = 0; float probehits = 0;
//Set up our struct data //Set up our struct data
float contribution[MAX_FORWARD_PROBES]; float contribution[MAX_FORWARD_PROBES];
float blendCap = 0;
for (i = 0; i < numProbes; ++i) for (i = 0; i < numProbes; ++i)
{ {
contribution[i] = 0; contribution[i] = 0;
@ -401,21 +402,24 @@ vec4 computeForwardProbes(Surface surface,
contribution[i] = 0.0; contribution[i] = 0.0;
blendSum += contribution[i]; blendSum += contribution[i];
blendCap = max(contribution[i],blendCap);
} }
if (probehits > 1.0)//if we overlap if (probehits > 0.0)
{ {
invBlendSum = (probehits - blendSum)/(probehits-1); //grab the remainder invBlendSum = (probehits - blendSum)/probehits; //grab the remainder
for (i = 0; i < numProbes; i++) for (i = 0; i < numProbes; i++)
{ {
blendFactor[i] = contribution[i]/blendSum; //what % total is this instance blendFactor[i] = contribution[i]/blendSum; //what % total is this instance
blendFactor[i] *= blendFactor[i] / invBlendSum; //what should we add to sum to 1 blendFactor[i] *= blendFactor[i]/invBlendSum; //what should we add to sum to 1
blendFacSum += blendFactor[i]; //running tally of results blendFacSum += blendFactor[i]; //running tally of results
} }
for (i = 0; i < numProbes; ++i) for (i = 0; i < numProbes; ++i)
{ {
contribution[i] *= blendFactor[i]/blendFacSum; //normalize //normalize, but in the range of the highest value applied
//to preserve blend vs skylight
contribution[i] = blendFactor[i]/blendFacSum*blendCap;
} }
} }

View file

@ -386,6 +386,8 @@ float4 computeForwardProbes(Surface surface,
float probehits = 0; float probehits = 0;
//Set up our struct data //Set up our struct data
float contribution[MAX_FORWARD_PROBES]; float contribution[MAX_FORWARD_PROBES];
float blendCap = 0;
//Process prooooobes //Process prooooobes
for (i = 0; i < numProbes; ++i) for (i = 0; i < numProbes; ++i)
{ {
@ -406,21 +408,24 @@ float4 computeForwardProbes(Surface surface,
contribution[i] = 0.0; contribution[i] = 0.0;
blendSum += contribution[i]; blendSum += contribution[i];
blendCap = max(contribution[i],blendCap);
} }
if (probehits > 1.0)//if we overlap if (probehits > 0.0)
{ {
invBlendSum = (probehits - blendSum)/(probehits-1); //grab the remainder invBlendSum = (probehits - blendSum)/probehits; //grab the remainder
for (i = 0; i < numProbes; i++) for (i = 0; i < numProbes; i++)
{ {
blendFactor[i] = contribution[i]/blendSum; //what % total is this instance blendFactor[i] = contribution[i]/blendSum; //what % total is this instance
blendFactor[i] *= blendFactor[i] / invBlendSum; //what should we add to sum to 1 blendFactor[i] *= blendFactor[i]/invBlendSum; //what should we add to sum to 1
blendFacSum += blendFactor[i]; //running tally of results blendFacSum += blendFactor[i]; //running tally of results
} }
for (i = 0; i < numProbes; ++i) for (i = 0; i < numProbes; ++i)
{ {
contribution[i] *= blendFactor[i]/blendFacSum; //normalize //normalize, but in the range of the highest value applied
//to preserve blend vs skylight
contribution[i] = blendFactor[i]/blendFacSum*blendCap;
} }
} }

View file

@ -78,6 +78,7 @@ void main()
//Set up our struct data //Set up our struct data
float contribution[MAX_PROBES]; float contribution[MAX_PROBES];
float blendCap = 0;
if (alpha > 0) if (alpha > 0)
{ {
//Process prooooobes //Process prooooobes
@ -101,21 +102,24 @@ void main()
contribution[i] = 0; contribution[i] = 0;
blendSum += contribution[i]; blendSum += contribution[i];
blendCap = max(contribution[i],blendCap);
} }
if (probehits > 1.0)//if we overlap if (probehits > 0.0)
{ {
invBlendSum = (probehits - blendSum)/(probehits-1); //grab the remainder invBlendSum = (probehits - blendSum)/probehits; //grab the remainder
for (i = 0; i < numProbes; i++) for (i = 0; i < numProbes; i++)
{ {
blendFactor[i] = contribution[i]/blendSum; //what % total is this instance blendFactor[i] = contribution[i]/blendSum; //what % total is this instance
blendFactor[i] *= blendFactor[i] / invBlendSum; //what should we add to sum to 1 blendFactor[i] *= blendFactor[i]/invBlendSum; //what should we add to sum to 1
blendFacSum += blendFactor[i]; //running tally of results blendFacSum += blendFactor[i]; //running tally of results
} }
for (i = 0; i < numProbes; ++i) for (i = 0; i < numProbes; ++i)
{ {
contribution[i] *= blendFactor[i]/blendFacSum; //normalize //normalize, but in the range of the highest value applied
//to preserve blend vs skylight
contribution[i] = blendFactor[i]/blendFacSum*blendCap;
} }
} }

View file

@ -70,6 +70,7 @@ float4 main(PFXVertToPix IN) : SV_TARGET
//Set up our struct data //Set up our struct data
float contribution[MAX_PROBES]; float contribution[MAX_PROBES];
float blendCap = 0;
if (alpha > 0) if (alpha > 0)
{ {
//Process prooooobes //Process prooooobes
@ -93,21 +94,23 @@ float4 main(PFXVertToPix IN) : SV_TARGET
contribution[i] = 0.0; contribution[i] = 0.0;
blendSum += contribution[i]; blendSum += contribution[i];
blendCap = max(contribution[i],blendCap);
} }
if (probehits > 0.0)
if (probehits > 1.0)//if we overlap
{ {
invBlendSum = (probehits - blendSum)/(probehits-1); //grab the remainder invBlendSum = (probehits - blendSum)/probehits; //grab the remainder
for (i = 0; i < numProbes; i++) for (i = 0; i < numProbes; i++)
{ {
blendFactor[i] = contribution[i]/blendSum; //what % total is this instance blendFactor[i] = contribution[i]/blendSum; //what % total is this instance
blendFactor[i] *= blendFactor[i] / invBlendSum; //what should we add to sum to 1 blendFactor[i] *= blendFactor[i]/invBlendSum; //what should we add to sum to 1
blendFacSum += blendFactor[i]; //running tally of results blendFacSum += blendFactor[i]; //running tally of results
} }
for (i = 0; i < numProbes; ++i) for (i = 0; i < numProbes; ++i)
{ {
contribution[i] *= blendFactor[i]/blendFacSum; //normalize //normalize, but in the range of the highest value applied
//to preserve blend vs skylight
contribution[i] = blendFactor[i]/blendFacSum*blendCap;
} }
} }

View file

@ -608,8 +608,11 @@ function AssetBrowser::doRefresh(%this)
//Forces a clean collapse of the tree for any not-really-exposed items //Forces a clean collapse of the tree for any not-really-exposed items
%dataItem = AssetBrowser-->filterTree.findItemByName("data"); %dataItem = AssetBrowser-->filterTree.findItemByName("data");
AssetBrowser-->filterTree.expandItem(%dataItem, false); if(%dataItem != 0)
AssetBrowser-->filterTree.expandItem(%dataItem); {
AssetBrowser-->filterTree.expandItem(%dataItem, false);
AssetBrowser-->filterTree.expandItem(%dataItem);
}
%this.dirty = false; %this.dirty = false;
} }
@ -985,14 +988,21 @@ function AssetBrowser::changeAsset(%this)
%targetObject = %this.fieldTargetObject; %targetObject = %this.fieldTargetObject;
%inspectorObject = ""; %inspectorObject = "";
if(%this.fieldTargetObject.isInNamespaceHierarchy("GuiInspector")) if(isObject(%this.fieldTargetObject) && %this.fieldTargetObject.isInNamespaceHierarchy("GuiInspector"))
{ {
%inspectorObject = %this.fieldTargetObject; %inspectorObject = %this.fieldTargetObject;
%targetObject = %inspectorObject.getInspectObject(); if(%inspectorObject.getNumInspectObjects() != 0)
{
%inspectorObject.setObjectField(%this.fieldTargetName, %this.selectedAsset); %targetObject = %inspectorObject.getInspectObject();
%inspectorObject.setObjectField(%this.fieldTargetName, %this.selectedAsset);
}
else if(startsWith(%this.fieldTargetName, "$"))
{
//we're targeting a variable directly, so deal with that then
%cmd = %this.fieldTargetName @ "=\"" @ %this.selectedAsset @ "\";";
}
} }
else else if(isObject(%this.fieldTargetObject))
{ {
//alright, we've selectd an asset for a field, so time to set it! //alright, we've selectd an asset for a field, so time to set it!
if(%this.fieldTargetName $= "") if(%this.fieldTargetName $= "")
@ -1000,11 +1010,23 @@ function AssetBrowser::changeAsset(%this)
else else
%cmd = %targetObject @ "." @ %this.fieldTargetName @ "=\"" @ %this.selectedAsset @ "\";"; %cmd = %targetObject @ "." @ %this.fieldTargetName @ "=\"" @ %this.selectedAsset @ "\";";
//echo("Changing asset via the " @ %cmd @ " command"); //echo("Changing asset via the " @ %cmd @ " command");
eval(%cmd); }
else if(startsWith(%this.fieldTargetName, "$"))
{
//we're targeting a variable directly, so deal with that then
%cmd = %this.fieldTargetName @ "=\"" @ %this.selectedAsset @ "\";";
} }
eval(%cmd);
//Force update our object with the field change //Force update our object with the field change
%targetObject.inspectPostApply(); if(isObject(%targetObject))
{
if(%this.fieldTargetObject.isInNamespaceHierarchy("GuiInspector"))
%this.fieldTargetObject.refresh();
else
%targetObject.inspectPostApply();
}
//Flag us as dirty for editing purposes //Flag us as dirty for editing purposes
EWorldEditor.setSceneAsDirty(); EWorldEditor.setSceneAsDirty();

View file

@ -499,7 +499,30 @@ function AssetBrowser::openFileLocation(%this)
%filePath = ""; %filePath = "";
if(EditAssetPopup.assetId !$= "") if(EditAssetPopup.assetId !$= "")
{ {
%filePath = AssetDatabase.getAssetPath(EditAssetPopup.assetId); if(AssetDatabase.isDeclaredAsset(EditAssetPopup.assetId))
{
%filePath = AssetDatabase.getAssetPath(EditAssetPopup.assetId);
}
else
{
//probably a file path
%pathSplit = strpos(EditAssetPopup.assetId, ":");
if(%pathSplit != -1)
{
%path = getSubStr(EditAssetPopup.assetId, 0, %pathSplit);
%file = getSubStr(EditAssetPopup.assetId, %pathSplit + 1);
//datablocks pack the originator file in the parent path as-is, so check that
if(fileExt(%path) !$= "")
{
%filePath = %path;
}
else
{
%filePath = %path @ "/" @ %file;
}
}
}
} }
else if(EditLevelAssetPopup.assetId !$= "") else if(EditLevelAssetPopup.assetId !$= "")
{ {
@ -510,16 +533,20 @@ function AssetBrowser::openFileLocation(%this)
%filePath = AssetDatabase.getAssetPath(EditAssetPopup.assetId); %filePath = AssetDatabase.getAssetPath(EditAssetPopup.assetId);
} }
if(%filePath !$= "") if(isFile(%filePath) || isDirectory(%filePath))
{ {
%fullPath = makeFullPath(%filePath);
if(fileExt(%fullPath) $= ".tscript")
%fullPath = filePath(%fullPath);
if($platform $= "windows") if($platform $= "windows")
{ {
%cmd = "cd \"" @ makeFullPath(%filePath) @ "\" && start ."; %cmd = "cd \"" @ %fullPath @ "\" && start .";
systemCommand(%cmd); systemCommand(%cmd);
} }
else else
{ {
%cmd = "open \"" @ makeFullPath(%filePath) @ "\""; %cmd = "open \"" @ %fullPath @ "\"";
systemCommand(%cmd); systemCommand(%cmd);
} }
} }

View file

@ -137,18 +137,9 @@ function AssetBrowser::buildPopupMenus(%this)
item[ 3 ] = "-"; item[ 3 ] = "-";
item[ 4 ] = "Create Terrain Data" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"TerrainAsset\", AssetBrowser.selectedModule);"; item[ 4 ] = "Create Terrain Data" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"TerrainAsset\", AssetBrowser.selectedModule);";
item[ 5 ] = "-"; item[ 5 ] = "-";
item[ 6 ] = "Create Shape" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"Shape\", AssetBrowser.selectedModule);"; item[ 6 ] = "Create GUI" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"GUIAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewGUIAsset(\"NewGUI\", AssetBrowser.selectedModule);";
item[ 7 ] = "Create Shape Animation" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ShapeAnimationAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewShapeAnimationAsset(\"NewShapeAnimation\", AssetBrowser.selectedModule);"; item[ 7 ] = "-";
item[ 8 ] = "-"; item[ 8 ] = "Create Post Effect" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"PostEffectAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewPostEffectAsset(\"NewPostEffect\", AssetBrowser.selectedModule);";
item[ 9 ] = "Create GUI" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"GUIAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewGUIAsset(\"NewGUI\", AssetBrowser.selectedModule);";
item[ 10 ] = "-";
item[ 11 ] = "Create Post Effect" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"PostEffectAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewPostEffectAsset(\"NewPostEffect\", AssetBrowser.selectedModule);";
item[ 12 ] = "-";
item[ 13 ] = "Create Sound" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"SoundAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewSoundAsset(\"NewSound\", AssetBrowser.selectedModule);";
item[ 14 ] = "-";
item[ 15 ] = "Create Particle Effect" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ParticleEffectAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewParticleEffectAsset(\"NewParticleEffect\", AssetBrowser.selectedModule);";
item[ 16 ] = "-";
item[ 17 ] = "Create Cubemap" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"CubemapAsset\", AssetBrowser.selectedModule);";
}; };
} }
@ -232,13 +223,6 @@ function AssetBrowser::buildPopupMenus(%this)
}; };
} }
//Some assets are not yet ready/implemented, so disable their creation here
AddNewArtAssetPopup.enableItem(6, false); //shape
AddNewArtAssetPopup.enableItem(7, false); //shape animation
AddNewArtAssetPopup.enableItem(13, false); //sound asset
AddNewArtAssetPopup.enableItem(15, false); //particle effect
AddNewArtAssetPopup.enableItem(17, false); //cubemap
if( !isObject( EditFolderPopup ) ) if( !isObject( EditFolderPopup ) )
{ {
new PopupMenu( EditFolderPopup ) new PopupMenu( EditFolderPopup )

View file

@ -362,8 +362,8 @@ new GuiMouseEventCtrl(ForestBrushSizeSliderCtrlContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(ForestBrushSizeTextEditContainer.position) + firstWord(ForestEditToolbar.position)+11 SPC position = ForestBrushSizeTextEditContainer.position.x + ForestEditToolbar.position.x + 50 SPC
(getWord(ForestBrushSizeTextEditContainer, 1)) + 25; ForestBrushSizeTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -392,8 +392,8 @@ new GuiMouseEventCtrl(ForestBrushPressureSliderCtrlContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(ForestBrushPressureTextEditContainer.position) + firstWord(ForestEditToolbar.position) SPC position = ForestBrushPressureTextEditContainer.position.x + ForestEditToolbar.position.x + 50 SPC
(getWord(ForestBrushPressureTextEditContainer, 1)) + 25; ForestBrushPressureTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -422,8 +422,8 @@ new GuiMouseEventCtrl(ForestBrushHardnessSliderCtrlContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(ForestBrushHardnessTextEditContainer.position) + firstWord(ForestEditToolbar.position) SPC position = ForestBrushPressureTextEditContainer.position.x + ForestEditToolbar.position.x + 50 SPC
(getWord(TForestBrushHardnessTextEditContainer, 1)) + 25; ForestBrushPressureTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";

View file

@ -42,9 +42,14 @@ function PostFXEditor::editDefaultPostFXSettings( %this )
PostFXEditorActionButton.command = "PostFXManager::savePresetHandler($PostFXManager::defaultPreset);"; PostFXEditorActionButton.command = "PostFXManager::savePresetHandler($PostFXManager::defaultPreset);";
} }
function PostEffectEditorInspector::refresh(%this)
{
PostFXEditor.refresh();
}
function PostFXEditor::refresh(%this) function PostFXEditor::refresh(%this)
{ {
%selectedItem = PostEffectEditorList.getSelectedRow();
PostEffectEditorList.clear(); PostEffectEditorList.clear();
%count = PostFXManager.Count(); %count = PostFXManager.Count();
@ -55,6 +60,8 @@ function PostFXEditor::refresh(%this)
if(%postEffect.isEnabled()) if(%postEffect.isEnabled())
PostEffectEditorList.addRow( %i, %postEffect.getName() ); PostEffectEditorList.addRow( %i, %postEffect.getName() );
} }
PostEffectEditorList.setSelectedRow(%selectedItem);
} }
function PostFXEditor::apply(%this) function PostFXEditor::apply(%this)

View file

@ -302,8 +302,8 @@ new GuiMouseEventCtrl(MeshRoadDefaultWidthSliderCtrlContainer, EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(MeshRoadDefaultWidthTextEditContainer.position) + firstWord(MeshRoadEditorToolbar.position) + 10 SPC position = MeshRoadDefaultWidthTextEditContainer.position.x + MeshRoadEditorToolbar.position.x + 50 SPC
(getWord(MeshRoadDefaultWidthTextEditContainer, 1)) + 25; MeshRoadDefaultWidthTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -331,8 +331,8 @@ new GuiMouseEventCtrl(MeshRoadDefaultDepthSliderCtrlContainer, EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(MeshRoadDefaultDepthTextEditContainer.position) + firstWord(MeshRoadEditorToolbar.position) + 10 SPC position = MeshRoadDefaultDepthTextEditContainer.position.x + MeshRoadEditorToolbar.position.x + 50 SPC
(getWord(MeshRoadDefaultDepthTextEditContainer, 1)) + 25; MeshRoadDefaultDepthTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";

View file

@ -280,8 +280,8 @@ new GuiMouseEventCtrl(RiverDefaultWidthSliderCtrlContainer, EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(RiverDefaultWidthTextEditContainer.position) + firstWord(RiverEditorToolbar.position) + 10 SPC position = RiverDefaultWidthTextEditContainer.position.x + RiverEditorToolbar.position.x + 50 SPC
(getWord(RiverDefaultWidthTextEditContainer, 1)) + 25; RiverDefaultWidthTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -309,8 +309,8 @@ new GuiMouseEventCtrl(RiverDefaultDepthSliderCtrlContainer, EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(RiverDefaultDepthTextEditContainer.position) + firstWord(RiverEditorToolbar.position) + 10 SPC position = RiverDefaultDepthTextEditContainer.position.x + RiverEditorToolbar.position.x + 50 SPC
(getWord(RiverDefaultDepthTextEditContainer, 1)) + 25; RiverDefaultDepthTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";

View file

@ -259,8 +259,8 @@ new GuiMouseEventCtrl(RoadDefaultWidthSliderCtrlContainer, EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(RoadDefaultWidthTextEditContainer.position) + firstWord(RoadEditorToolbar.position) + 10 SPC position = RoadDefaultWidthTextEditContainer.position.x + RoadEditorToolbar.position.x + 50 SPC
(getWord(RoadDefaultWidthTextEditContainer, 1)) + 25; RoadDefaultWidthTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";

View file

@ -510,8 +510,8 @@ new GuiMouseEventCtrl(TerrainBrushSizeSliderCtrlContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(TerrainBrushSizeTextEditContainer.position) + firstWord(EWTerrainEditToolbar.position)+11 SPC position = TerrainBrushSizeTextEditContainer.position.x + EWTerrainEditToolbar.position.x + 50 SPC
(getWord(TerrainBrushSizeTextEditContainer, 1)) + 25; TerrainBrushSizeTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -540,8 +540,8 @@ new GuiMouseEventCtrl(TerrainBrushPressureSliderCtrlContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(TerrainBrushPressureTextEditContainer.position) + firstWord(EWTerrainEditToolbar.position) SPC position = TerrainBrushPressureTextEditContainer.position.x + EWTerrainEditToolbar.position.x + 50 SPC
(getWord(TerrainBrushPressureTextEditContainer, 1)) + 25; TerrainBrushPressureTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -570,8 +570,8 @@ new GuiMouseEventCtrl(TerrainBrushSoftnessSliderCtrlContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(TerrainBrushSoftnessTextEditContainer.position) + firstWord(EWTerrainEditToolbar.position) SPC position = TerrainBrushSoftnessTextEditContainer.position.x + EWTerrainEditToolbar.position.x + 50 SPC
(getWord(TerrainBrushSoftnessTextEditContainer, 1)) + 25; TerrainBrushSoftnessTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -600,8 +600,8 @@ new GuiMouseEventCtrl(TerrainSetHeightSliderCtrlContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(TerrainSetHeightTextEditContainer.position) + firstWord(EWTerrainEditToolbar.position) SPC position = TerrainSetHeightTextEditContainer.position.x + EWTerrainEditToolbar.position.x SPC
(getWord(TerrainSetHeightTextEditContainer, 1)) + 25; TerrainSetHeightTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";

View file

@ -222,7 +222,7 @@ $guiContent = new GuiControl(EWTerrainPainterToolbar,EditorGuiGroup) {
Profile = "ToolsGuiDefaultProfile"; Profile = "ToolsGuiDefaultProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
Position = "222 5"; Position = "245 5";
Extent = "256 50"; Extent = "256 50";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -382,7 +382,7 @@ $guiContent = new GuiControl(EWTerrainPainterToolbar,EditorGuiGroup) {
Profile = "ToolsGuiTransparentProfile"; Profile = "ToolsGuiTransparentProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = "480 5"; position = "490 5";
Extent = "120 50"; Extent = "120 50";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -524,8 +524,8 @@ new GuiMouseEventCtrl(PaintBrushSizeSliderCtrlContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(PaintBrushSizeTextEditContainer.position) + firstWord(EWTerrainPainterToolbar.position)+11 SPC position = PaintBrushSizeTextEditContainer.position.x + EWTerrainPainterToolbar.position.x + 50 SPC
(getWord(PaintBrushSizeTextEditContainer, 1)) + 25; PaintBrushSizeTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -554,8 +554,8 @@ new GuiMouseEventCtrl(PaintBrushSlopeMinContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(PaintBrushSlopeControl.position) + firstWord(EWTerrainPainterToolbar.position)+firstWord(PaintBrushSlopeControl->SlopeMinAngle.position) - 40 SPC position = PaintBrushSlopeControl.position.x + EWTerrainPainterToolbar.position.x + PaintBrushSlopeControl->SlopeMinAngle.position.x - 40 SPC
(getWord(PaintBrushSlopeControl, 1)) + 25; PaintBrushSlopeControl.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -589,8 +589,8 @@ new GuiMouseEventCtrl(PaintBrushSlopeMaxContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(PaintBrushSlopeControl.position) + firstWord(EWTerrainPainterToolbar.position)+firstWord(PaintBrushSlopeControl->SlopeMaxAngle.position) - 40 SPC position = PaintBrushSlopeControl.position.x + EWTerrainPainterToolbar.position.x + PaintBrushSlopeControl->SlopeMaxAngle.position.x - 40 SPC
(getWord(PaintBrushSlopeControl, 1)) + 25; PaintBrushSlopeControl.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -629,8 +629,8 @@ new GuiMouseEventCtrl(PaintBrushPressureSliderCtrlContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(PaintBrushPressureTextEditContainer.position) + firstWord(EWTerrainPainterToolbar.position) SPC position = PaintBrushPressureTextEditContainer.position.x + EWTerrainPainterToolbar.position.x + 50 SPC
(getWord(PaintBrushPressureTextEditContainer, 1)) + 25; PaintBrushPressureTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -659,8 +659,8 @@ new GuiMouseEventCtrl(PaintBrushSoftnessSliderCtrlContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(PaintBrushSoftnessTextEditContainer.position) + firstWord(EWTerrainPainterToolbar.position) SPC position = PaintBrushSoftnessTextEditContainer.position.x + EWTerrainPainterToolbar.position.x + 50 SPC
(getWord(PaintBrushSoftnessTextEditContainer, 1)) + 25; PaintBrushSoftnessTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";

View file

@ -684,8 +684,8 @@ new GuiMouseEventCtrl(softSnapSizeSliderCtrlContainer, EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(EWorldEditorToolbar-->softSnapSizeTextEdit.getGlobalPosition()) - 12 SPC position = EWorldEditorToolbar.position.x + EWorldEditorToolbar-->softSnapSizeTextEditContainer.position.x + 50 SPC
(getWord(EWorldEditorToolbar-->softSnapSizeTextEdit.getGlobalPosition(), 1)) + 18; EWorldEditorToolbar-->softSnapSizeTextEdit.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";

View file

@ -734,7 +734,7 @@ function EditorGui::addCameraBookmarkByGui( %this )
// look for a NewCamera name to grab // look for a NewCamera name to grab
for(%i = 0; ; %i++){ for(%i = 0; ; %i++){
%name = "NewCamera_" @ %i; %name = "NewCamera_" @ %i;
if( !CameraBookmarks.findObjectByInternalName(%name) ){ if( !isObject(CameraBookmarks) || !CameraBookmarks.findObjectByInternalName(%name) ){
break; break;
} }
} }
@ -1340,7 +1340,9 @@ function CameraTypesDropdownToggle()
function VisibilityDropdownToggle() function VisibilityDropdownToggle()
{ {
EditorVisibilityOptions.showPopup(Canvas); %pos = visibilityToggleBtn.getGlobalPosition();
%pos.y += visibilityToggleBtn.extent.y;
EditorVisibilityOptions.showPopup(Canvas, %pos.x, %pos.y);
} }
function CameraTypesDropdownDecoy::onMouseLeave() function CameraTypesDropdownDecoy::onMouseLeave()

View file

@ -436,3 +436,55 @@ function toggleVolumeViz(%vizName)
EVisibilityVolumeOptions.checkItem(7, $SFXSpace::isRenderable); EVisibilityVolumeOptions.checkItem(7, $SFXSpace::isRenderable);
} }
} }
//
//
function togglePlayerCollisionViz()
{
$Player::renderCollision = !$Player::renderCollision;
EVisibilityDebugRenderOptions.checkItem(0, $Player::renderCollision);
}
function toggleTerrainDebugViz()
{
$TerrainBlock::debugRender = !$TerrainBlock::debugRender;
EVisibilityDebugRenderOptions.checkItem(1, $TerrainBlock::debugRender);
}
function toggleDecalsDebugViz()
{
$Decals::debugRender = !$Decals::debugRender;
EVisibilityDebugRenderOptions.checkItem(2, $Decals::debugRender);
}
function toggleBoundingBoxesViz()
{
$Scene::renderBoundingBoxes = !$Scene::renderBoundingBoxes;
EVisibilityDebugRenderOptions.checkItem(3, $Scene::renderBoundingBoxes);
}
//
//
function toggleWireframeViz()
{
$gfx::wireframe = !$gfx::wireframe;
EditorVisibilityOptions.checkItem(3, $gfx::wireframe);
}
function toggleFrustumLockViz()
{
$Scene::lockCull = !$Scene::lockCull;
EditorVisibilityOptions.checkItem(4, $Scene::lockCull);
}
function toggleZoneCulling()
{
$Scene::disableZoneCulling = !$Scene::disableZoneCulling;
EditorVisibilityOptions.checkItem(7, $Scene::disableZoneCulling);
}
function toggleTerrainCulling()
{
$Scene::disableTerrainOcclusion = !$Scene::disableTerrainOcclusion;
EditorVisibilityOptions.checkItem(8, $Scene::disableTerrainOcclusion);
}

View file

@ -98,15 +98,17 @@ function setupEditorVisibilityMenu()
superClass = "MenuBuilder"; superClass = "MenuBuilder";
class = "EditorWorldMenu"; class = "EditorWorldMenu";
item[ 0 ] = "Show Player Collision" TAB "" TAB "$Player::renderCollision = !$Player::renderCollision;"; item[ 0 ] = "Show Player Collision" TAB "" TAB "togglePlayerCollisionViz();";
item[ 1 ] = "Show Terrain Debug" TAB "" TAB "$TerrainBlock::debugRender = !$TerrainBlock::debugRender;"; item[ 1 ] = "Show Terrain Debug" TAB "" TAB "toggleTerrainDebugViz();";
item[ 2 ] = "Show Decals Debug" TAB "" TAB "$Decals::debugRender = !$Decals::debugRender;"; item[ 2 ] = "Show Decals Debug" TAB "" TAB "toggleDecalsDebugViz();";
item[ 3 ] = "Show Bounding Boxes" TAB "" TAB "$Scene::renderBoundingBoxes = !$Scene::renderBoundingBoxes;"; item[ 3 ] = "Show Bounding Boxes" TAB "" TAB "toggleBoundingBoxesViz();";
item[ 4 ] = "Show Physics World" TAB "" TAB "togglePhysicsDebugViz();"; item[ 4 ] = "Show Physics World" TAB "" TAB "togglePhysicsDebugViz();";
item[ 5 ] = "Show Texel Density" TAB "" TAB "toggleTexelDensityViz();"; item[ 5 ] = "Show Texel Density" TAB "" TAB "toggleTexelDensityViz();";
}; };
%debugRenderpopup.enableItem(4, false); if(!physicsPluginPresent())
%debugRenderpopup.enableItem(4, false);
%debugRenderpopup.enableItem(5, false); %debugRenderpopup.enableItem(5, false);
// //
@ -231,12 +233,12 @@ function setupEditorVisibilityMenu()
item[ 0 ] = "Volumes Visibility" TAB EVisibilityVolumeOptions; item[ 0 ] = "Volumes Visibility" TAB EVisibilityVolumeOptions;
item[ 1 ] = "Debug Rendering" TAB EVisibilityDebugRenderOptions; item[ 1 ] = "Debug Rendering" TAB EVisibilityDebugRenderOptions;
item[ 2 ] = "-" TAB "" TAB ""; item[ 2 ] = "-" TAB "" TAB "";
item[ 3 ] = "Wireframe" TAB "" TAB "$gfx::wireframe = !$gfx::wireframe;"; item[ 3 ] = "Wireframe" TAB "" TAB "toggleWireframeViz();";
item[ 4 ] = "Frustum Lock" TAB "" TAB "$Scene::lockCull = !$Scene::lockCull;"; item[ 4 ] = "Frustum Lock" TAB "" TAB "toggleFrustumLockViz();";
item[ 5 ] = "Colorblindness" TAB EVisibilityColorblindnessOptions; item[ 5 ] = "Colorblindness" TAB EVisibilityColorblindnessOptions;
item[ 6 ] = "-" TAB "" TAB ""; item[ 6 ] = "-" TAB "" TAB "";
item[ 7 ] = "Disable Zone Culling" TAB "" TAB "$Scene::disableZoneCulling = !$Scene::disableZoneCulling;"; item[ 7 ] = "Disable Zone Culling" TAB "" TAB "toggleZoneCulling();";
item[ 8 ] = "Disable Terrain Culling" TAB "" TAB "$Scene::disableTerrainOcclusion = !$Scene::disableTerrainOcclusion;"; item[ 8 ] = "Disable Terrain Culling" TAB "" TAB "toggleTerrainCulling();";
item[ 9 ] = "-" TAB "" TAB ""; item[ 9 ] = "-" TAB "" TAB "";
item[ 10 ] = "Lighting Modes" TAB EVisibilityLightingModesOptions; item[ 10 ] = "Lighting Modes" TAB EVisibilityLightingModesOptions;
item[ 11 ] = "Lights" TAB EVisibilityLightsOptions; item[ 11 ] = "Lights" TAB EVisibilityLightsOptions;
@ -383,14 +385,17 @@ function EVisibility::addClassOptions( %this )
} }
} }
function togglePhysicsDebugViz( %enable ) function togglePhysicsDebugViz( )
{ {
$PhysicsWorld::render = %enable; $PhysicsWorld::render = !$PhysicsWorld::render;
if(physicsPluginPresent()) if(physicsPluginPresent())
{ {
physicsDebugDraw(%enable); physicsDebugDraw($PhysicsWorld::render);
} }
EVisibilityDebugRenderOptions.checkItem(4, $PhysicsWorld::render);
} }
function disableVisualizers() function disableVisualizers()