mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
Merge remote-tracking branch 'upstream/development' into development
This commit is contained in:
commit
fcbb72866c
8 changed files with 55 additions and 23 deletions
|
|
@ -660,12 +660,14 @@ DecalInstance* DecalManager::raycast( const Point3F &start, const Point3F &end,
|
||||||
RayInfo ri;
|
RayInfo ri;
|
||||||
bool containsPoint = false;
|
bool containsPoint = false;
|
||||||
if ( gServerContainer.castRayRendered( start, end, STATIC_COLLISION_TYPEMASK, &ri ) )
|
if ( gServerContainer.castRayRendered( start, end, STATIC_COLLISION_TYPEMASK, &ri ) )
|
||||||
{
|
{
|
||||||
|
RectF rect = inst->mDataBlock->texRect[inst->mTextureRectIdx];
|
||||||
|
rect.extent *= inst->mSize * 0.5f;
|
||||||
Point2F poly[4];
|
Point2F poly[4];
|
||||||
poly[0].set( inst->mPosition.x - (inst->mSize / 2), inst->mPosition.y + (inst->mSize / 2));
|
poly[0].set(inst->mPosition.x - rect.extent.x, inst->mPosition.y + rect.extent.y);
|
||||||
poly[1].set( inst->mPosition.x - (inst->mSize / 2), inst->mPosition.y - (inst->mSize / 2));
|
poly[1].set( inst->mPosition.x - rect.extent.x, inst->mPosition.y - rect.extent.y);
|
||||||
poly[2].set( inst->mPosition.x + (inst->mSize / 2), inst->mPosition.y - (inst->mSize / 2));
|
poly[2].set( inst->mPosition.x + rect.extent.x, inst->mPosition.y - rect.extent.y);
|
||||||
poly[3].set( inst->mPosition.x + (inst->mSize / 2), inst->mPosition.y + (inst->mSize / 2));
|
poly[3].set( inst->mPosition.x + rect.extent.x, inst->mPosition.y + rect.extent.y);
|
||||||
|
|
||||||
if ( MathUtils::pointInPolygon( poly, 4, Point2F(ri.point.x, ri.point.y) ) )
|
if ( MathUtils::pointInPolygon( poly, 4, Point2F(ri.point.x, ri.point.y) ) )
|
||||||
containsPoint = true;
|
containsPoint = true;
|
||||||
|
|
|
||||||
|
|
@ -873,11 +873,8 @@ bool Projectile::onAdd()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mSourceObject.isValid())
|
if (mSourceObject.isValid())
|
||||||
{
|
|
||||||
processAfter(mSourceObject);
|
processAfter(mSourceObject);
|
||||||
if (isClientObject())
|
|
||||||
mSourceObject->getRenderMuzzlePoint(mSourceObjectSlot, &mCurrPosition);
|
|
||||||
}
|
|
||||||
// Setup our bounding box
|
// Setup our bounding box
|
||||||
if (bool(mDataBlock->getProjectileShape()) == true)
|
if (bool(mDataBlock->getProjectileShape()) == true)
|
||||||
mObjBox = mDataBlock->getProjectileShape()->mBounds;
|
mObjBox = mDataBlock->getProjectileShape()->mBounds;
|
||||||
|
|
|
||||||
|
|
@ -1164,13 +1164,6 @@ void ShapeBase::onRemove()
|
||||||
{
|
{
|
||||||
mConvexList->nukeList();
|
mConvexList->nukeList();
|
||||||
|
|
||||||
Parent::onRemove();
|
|
||||||
|
|
||||||
// Stop any running sounds on the client
|
|
||||||
if (isGhost())
|
|
||||||
for (S32 i = 0; i < MaxSoundThreads; i++)
|
|
||||||
stopAudio(i);
|
|
||||||
|
|
||||||
// Accumulation and environment mapping
|
// Accumulation and environment mapping
|
||||||
if (isClientObject() && mShapeInstance)
|
if (isClientObject() && mShapeInstance)
|
||||||
{
|
{
|
||||||
|
|
@ -1178,6 +1171,13 @@ void ShapeBase::onRemove()
|
||||||
AccumulationVolume::removeObject(this);
|
AccumulationVolume::removeObject(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Parent::onRemove();
|
||||||
|
|
||||||
|
// Stop any running sounds on the client
|
||||||
|
if (isGhost())
|
||||||
|
for (S32 i = 0; i < MaxSoundThreads; i++)
|
||||||
|
stopAudio(i);
|
||||||
|
|
||||||
if ( isClientObject() )
|
if ( isClientObject() )
|
||||||
{
|
{
|
||||||
if (mCubeReflector)
|
if (mCubeReflector)
|
||||||
|
|
|
||||||
|
|
@ -516,11 +516,12 @@ void GuiDecalEditorCtrl::renderScene(const RectI & updateRect)
|
||||||
if ( gDecalManager->clipDecal( mSELDecal, &mSELEdgeVerts ) )
|
if ( gDecalManager->clipDecal( mSELDecal, &mSELEdgeVerts ) )
|
||||||
_renderDecalEdge( mSELEdgeVerts, ColorI( 255, 255, 255, 255 ) );
|
_renderDecalEdge( mSELEdgeVerts, ColorI( 255, 255, 255, 255 ) );
|
||||||
|
|
||||||
const F32 &decalSize = mSELDecal->mSize;
|
const F32 &decalSize = mSELDecal->mSize * 0.5;
|
||||||
Point3F boxSize( decalSize, decalSize, decalSize );
|
Point3F boxSize( decalSize, decalSize, decalSize );
|
||||||
|
|
||||||
MatrixF worldMat( true );
|
MatrixF worldMat( true );
|
||||||
mSELDecal->getWorldMatrix( &worldMat, true );
|
mSELDecal->getWorldMatrix( &worldMat, true );
|
||||||
|
RectF rect = mSELDecal->mDataBlock->texRect[mSELDecal->mTextureRectIdx];
|
||||||
|
worldMat.scale(Point3F(rect.extent.x, rect.extent.y, 0.25f));
|
||||||
|
|
||||||
drawUtil->drawObjectBox( desc, boxSize, mSELDecal->mPosition, worldMat, ColorI( 255, 255, 255, 255 ) );
|
drawUtil->drawObjectBox( desc, boxSize, mSELDecal->mPosition, worldMat, ColorI( 255, 255, 255, 255 ) );
|
||||||
}
|
}
|
||||||
|
|
@ -531,11 +532,13 @@ void GuiDecalEditorCtrl::renderScene(const RectI & updateRect)
|
||||||
if ( gDecalManager->clipDecal( mHLDecal, &mHLEdgeVerts ) )
|
if ( gDecalManager->clipDecal( mHLDecal, &mHLEdgeVerts ) )
|
||||||
_renderDecalEdge( mHLEdgeVerts, ColorI( 255, 255, 255, 255 ) );
|
_renderDecalEdge( mHLEdgeVerts, ColorI( 255, 255, 255, 255 ) );
|
||||||
|
|
||||||
const F32 &decalSize = mHLDecal->mSize;
|
const F32 &decalSize = mHLDecal->mSize * 0.5;
|
||||||
Point3F boxSize( decalSize, decalSize, decalSize );
|
Point3F boxSize( decalSize, decalSize, decalSize );
|
||||||
|
|
||||||
MatrixF worldMat( true );
|
MatrixF worldMat( true );
|
||||||
mHLDecal->getWorldMatrix( &worldMat, true );
|
mHLDecal->getWorldMatrix( &worldMat, true );
|
||||||
|
RectF rect = mHLDecal->mDataBlock->texRect[mHLDecal->mTextureRectIdx];
|
||||||
|
worldMat.scale(Point3F(rect.extent.x, rect.extent.y, 0.25f));
|
||||||
|
|
||||||
drawUtil->drawObjectBox( desc, boxSize, mHLDecal->mPosition, worldMat, ColorI( 255, 255, 255, 255 ) );
|
drawUtil->drawObjectBox( desc, boxSize, mHLDecal->mPosition, worldMat, ColorI( 255, 255, 255, 255 ) );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -239,8 +239,11 @@ void TSShapeInstance::initMeshObjects()
|
||||||
void TSShapeInstance::setMaterialList( TSMaterialList *matList )
|
void TSShapeInstance::setMaterialList( TSMaterialList *matList )
|
||||||
{
|
{
|
||||||
// get rid of old list
|
// get rid of old list
|
||||||
if ( mOwnMaterialList )
|
if (mOwnMaterialList)
|
||||||
|
{
|
||||||
delete mMaterialList;
|
delete mMaterialList;
|
||||||
|
mMaterialList = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
mMaterialList = matList;
|
mMaterialList = matList;
|
||||||
mOwnMaterialList = false;
|
mOwnMaterialList = false;
|
||||||
|
|
@ -891,6 +894,9 @@ void TSShapeInstance::prepCollision()
|
||||||
// Returns true is the shape contains any materials with accumulation enabled.
|
// Returns true is the shape contains any materials with accumulation enabled.
|
||||||
bool TSShapeInstance::hasAccumulation()
|
bool TSShapeInstance::hasAccumulation()
|
||||||
{
|
{
|
||||||
|
if (!mOwnMaterialList || mMaterialList == NULL)
|
||||||
|
return false;
|
||||||
|
|
||||||
bool result = false;
|
bool result = false;
|
||||||
for ( U32 i = 0; i < mMaterialList->size(); ++i )
|
for ( U32 i = 0; i < mMaterialList->size(); ++i )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ trace(false);
|
||||||
|
|
||||||
// Set the name of our application
|
// Set the name of our application
|
||||||
$appName = "@TORQUE_APP_NAME@";
|
$appName = "@TORQUE_APP_NAME@";
|
||||||
|
echo("\nInitializing" SPC $appName SPC "["@getAppVersionString()@"] [Engine Version:"@getVersionString()@"]\n");
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Load up scripts to initialise subsystems.
|
// Load up scripts to initialise subsystems.
|
||||||
ModuleDatabase.setModuleExtension("module");
|
ModuleDatabase.setModuleExtension("module");
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ function VerveEditor::CreateField( %targetStack, %fieldName, %fieldType )
|
||||||
};
|
};
|
||||||
%fieldContainer.add( %fieldLabel );
|
%fieldContainer.add( %fieldLabel );
|
||||||
|
|
||||||
if ( isMethod( "VerveEditor", "Create" @ %fieldType @ "Field" ) )
|
if ( (%fieldType !$= "") && (isMethod( "VerveEditor", "Create" @ %fieldType @ "Field" ) ))
|
||||||
{
|
{
|
||||||
// Create the Input Control.
|
// Create the Input Control.
|
||||||
%fieldInput = eval( "return VerveEditor::Create" @ %fieldType @ "Field(" @ %fieldContainer @ "," @ %fieldName @ ");" );
|
%fieldInput = eval( "return VerveEditor::Create" @ %fieldType @ "Field(" @ %fieldContainer @ "," @ %fieldName @ ");" );
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,28 @@ function ImageAsset::generatePreviewImage(%this, %previewButton, %forceRegenerat
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ImageAsset::makeMaterialFrom(%this)
|
||||||
|
{
|
||||||
|
%matName = %this.assetName @ "_Mat";
|
||||||
|
%assetLoc = AssetDatabase.getAssetPath(%this.getAssetId()) @"/"@ %this.assetName @"_Mat.asset.taml";
|
||||||
|
%newMat = new Material(%matName) {
|
||||||
|
diffuseMapAsset[0] = %this.getAssetId();
|
||||||
|
mapTo = %this.assetName;
|
||||||
|
};
|
||||||
|
|
||||||
|
%matAsset = new MaterialAsset() {
|
||||||
|
assetName = %matName;
|
||||||
|
materialDefinitionName = %matName;
|
||||||
|
};
|
||||||
|
|
||||||
|
%matAsset.add(%newMat);
|
||||||
|
|
||||||
|
TamlWrite(%matAsset, expandPath(%assetLoc));
|
||||||
|
AssetDatabase.addDeclaredAsset(AssetDatabase.getAssetModule(%this.getAssetId()), %assetLoc);
|
||||||
|
return %matAsset;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function ImageAsset::onShowActionMenu(%this)
|
function ImageAsset::onShowActionMenu(%this)
|
||||||
{
|
{
|
||||||
GenericAsset::onShowActionMenu(%this);
|
GenericAsset::onShowActionMenu(%this);
|
||||||
|
|
@ -134,6 +156,8 @@ function ImageAsset::onShowActionMenu(%this)
|
||||||
%assetId = %this.getAssetId();
|
%assetId = %this.getAssetId();
|
||||||
|
|
||||||
EditAssetPopup.setItemPosition("Create Composite Texture" TAB "" TAB "CompositeTextureEditor.buildComposite(\"" @ %assetId @ "\");", 4);
|
EditAssetPopup.setItemPosition("Create Composite Texture" TAB "" TAB "CompositeTextureEditor.buildComposite(\"" @ %assetId @ "\");", 4);
|
||||||
|
EditAssetPopup.setItemPosition("Create Terrain Textures" TAB "" TAB "makeTerrainMapsFrom(\"" @ %assetId @ "\");", 5);
|
||||||
|
EditAssetPopup.setItemPosition("Create Material" TAB "" TAB %this @ ".makeMaterialFrom();", 6);
|
||||||
|
|
||||||
EditAssetPopup.objectData = %assetId;
|
EditAssetPopup.objectData = %assetId;
|
||||||
EditAssetPopup.objectType = AssetDatabase.getAssetType(%assetId);
|
EditAssetPopup.objectType = AssetDatabase.getAssetType(%assetId);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue