mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +00:00
Various fixes
This commit is contained in:
parent
60a29777fa
commit
3fa7a0d4fa
27 changed files with 171 additions and 177 deletions
|
|
@ -40,6 +40,8 @@
|
|||
#include "assets/assetPtr.h"
|
||||
#endif
|
||||
|
||||
#include "T3D/entity.h"
|
||||
|
||||
// Debug Profiling.
|
||||
#include "platform/profiler.h"
|
||||
|
||||
|
|
@ -133,12 +135,14 @@ void GameObjectAsset::copyTo(SimObject* object)
|
|||
void GameObjectAsset::initializeAsset()
|
||||
{
|
||||
//Ensure we have an expanded filepath
|
||||
mScriptFile = expandAssetFilePath(mScriptFile);
|
||||
if (!Platform::isFullPath(mScriptFile))
|
||||
mScriptFile = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptFile;
|
||||
|
||||
if (Platform::isFile(mScriptFile))
|
||||
Con::executeFile(mScriptFile, false, false);
|
||||
|
||||
mTAMLFile = expandAssetFilePath(mTAMLFile);
|
||||
if (!Platform::isFullPath(mTAMLFile))
|
||||
mTAMLFile = getOwned() ? expandAssetFilePath(mTAMLFile) : mTAMLFile;
|
||||
}
|
||||
|
||||
void GameObjectAsset::onAssetRefresh()
|
||||
|
|
@ -165,7 +169,7 @@ void GameObjectAsset::setScriptFile(const char* pScriptFile)
|
|||
return;
|
||||
|
||||
// Update.
|
||||
mScriptFile = expandAssetFilePath(pScriptFile);
|
||||
mScriptFile = getOwned() ? expandAssetFilePath(pScriptFile) : pScriptFile;
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
|
|
@ -185,7 +189,7 @@ void GameObjectAsset::setTAMLFile(const char* pTAMLFile)
|
|||
return;
|
||||
|
||||
// Update.
|
||||
mTAMLFile = expandAssetFilePath(pTAMLFile);
|
||||
mTAMLFile = getOwned() ? expandAssetFilePath(pTAMLFile) : pTAMLFile;
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
|
|
@ -218,7 +222,12 @@ const char* GameObjectAsset::create()
|
|||
}
|
||||
|
||||
//Flag it so we know where it came from
|
||||
pSimObject->setDataField("GameObject", nullptr, getAssetId());
|
||||
//Entity* e = dynamic_cast<Entity*>(pSimObject);
|
||||
//e->_setGameObject(getAssetId());
|
||||
|
||||
StringTableEntry assetId = getAssetId();
|
||||
|
||||
pSimObject->setDataField(StringTable->insert("GameObject"), nullptr, getAssetId());
|
||||
|
||||
return pSimObject->getIdString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ ConsoleSetType(TypeShapeAssetPtr)
|
|||
|
||||
ShapeAsset::ShapeAsset()
|
||||
{
|
||||
mFileName = StringTable->EmptyString();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -129,6 +130,10 @@ void ShapeAsset::initializeAsset()
|
|||
|
||||
ResourceManager::get().getChangedSignal().notify(this, &ShapeAsset::_onResourceChanged);
|
||||
|
||||
//Ensure our path is expando'd if it isn't already
|
||||
if (!Platform::isFullPath(mFileName))
|
||||
mFileName = getOwned() ? expandAssetFilePath(mFileName) : mFileName;
|
||||
|
||||
loadShape();
|
||||
}
|
||||
|
||||
|
|
@ -144,8 +149,7 @@ void ShapeAsset::setShapeFile(const char* pShapeFile)
|
|||
if (pShapeFile == mFileName)
|
||||
return;
|
||||
|
||||
// Update.
|
||||
mFileName = getOwned() ? expandAssetFilePath(pShapeFile) : StringTable->insert(pShapeFile);
|
||||
mFileName = pShapeFile;
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
|
|
@ -156,6 +160,8 @@ void ShapeAsset::_onResourceChanged(const Torque::Path &path)
|
|||
if (path != Torque::Path(mFileName) )
|
||||
return;
|
||||
|
||||
refreshAsset();
|
||||
|
||||
loadShape();
|
||||
}
|
||||
|
||||
|
|
@ -268,9 +274,13 @@ void ShapeAsset::copyTo(SimObject* object)
|
|||
|
||||
void ShapeAsset::onAssetRefresh(void)
|
||||
{
|
||||
if (dStrcmp(mFileName, "") == 0)
|
||||
if (mFileName == StringTable->EmptyString())
|
||||
return;
|
||||
|
||||
// Update.
|
||||
if(!Platform::isFullPath(mFileName))
|
||||
mFileName = getOwned() ? expandAssetFilePath(mFileName) : mFileName;
|
||||
|
||||
loadShape();
|
||||
}
|
||||
|
||||
|
|
@ -405,4 +415,4 @@ bool GuiInspectorTypeShapeAssetPtr::updateRects()
|
|||
}
|
||||
|
||||
return resized;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,8 +157,7 @@ void Entity::initPersistFields()
|
|||
endGroup("Misc");
|
||||
|
||||
addGroup("GameObject");
|
||||
addProtectedField("GameObject", TypeGameObjectAssetPtr, Offset(mGameObjectAsset, Entity), &_setGameObject, &defaultProtectedGetFn,
|
||||
"The asset Id used for the game object this entity is based on.");
|
||||
addField("GameObject", TypeGameObjectAssetPtr, Offset(mGameObjectAsset, Entity), "The asset Id used for the game object this entity is based on.");
|
||||
|
||||
addField("dirtyGameObject", TypeBool, Offset(mDirtyGameObject, Entity), "If this entity is a GameObject, it flags if this instance delinates from the template.",
|
||||
AbstractClassRep::FieldFlags::FIELD_HideInInspectors);
|
||||
|
|
@ -246,7 +245,7 @@ bool Entity::onAdd()
|
|||
if (isServerObject())
|
||||
{
|
||||
setMaskBits(TransformMask);
|
||||
setMaskBits(NamespaceMask);
|
||||
//setMaskBits(NamespaceMask);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -2019,4 +2018,4 @@ DefineEngineFunction(findEntitiesByTag, const char*, (SimGroup* searchingGroup,
|
|||
}
|
||||
|
||||
object->notifyComponents(signalFunction, argA, argB, argC, argD, argE);*/
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,9 +85,6 @@ private:
|
|||
StringTableEntry mGameObjectAssetId;
|
||||
AssetPtr<GameObjectAsset> mGameObjectAsset;
|
||||
|
||||
//Marked if this entity is a GameObject and deliniates from the parent GO asset
|
||||
bool mDirtyGameObject;
|
||||
|
||||
ContainerQueryInfo containerInfo;
|
||||
|
||||
bool mInitialized;
|
||||
|
|
@ -100,6 +97,8 @@ private:
|
|||
S32 mLifetimeMS;
|
||||
|
||||
protected:
|
||||
//Marked if this entity is a GameObject and deliniates from the parent GO asset
|
||||
bool mDirtyGameObject;
|
||||
|
||||
virtual void processTick(const Move* move);
|
||||
virtual void advanceTime(F32 dt);
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
IMPLEMENT_CO_NETOBJECT_V1(AIPlayerObject);
|
||||
|
||||
AIPlayerObject::AIPlayerObject()
|
||||
: mAIControllerComponent(nullptr)
|
||||
//: mAIControllerComponent(nullptr)
|
||||
{
|
||||
|
||||
mSuperClassName = StringTable->insert("Entity");
|
||||
}
|
||||
AIPlayerObject::~AIPlayerObject()
|
||||
{
|
||||
|
|
@ -21,7 +21,7 @@ bool AIPlayerObject::onAdd()
|
|||
if (!mDirtyGameObject)
|
||||
{
|
||||
//AI Controller
|
||||
mAIControllerComponent = new AIControllerComponent();
|
||||
/*mAIControllerComponent = new AIControllerComponent();
|
||||
if (!mAIControllerComponent->registerObject())
|
||||
{
|
||||
Con::errorf("PlayerObject::onAdd - unable to add mAIControllerComponent!");
|
||||
|
|
@ -30,7 +30,7 @@ bool AIPlayerObject::onAdd()
|
|||
|
||||
mAIControllerComponent->setInternalName("aiControllerComponent");
|
||||
|
||||
addComponent(mAIControllerComponent);
|
||||
addComponent(mAIControllerComponent);*/
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -39,4 +39,4 @@ bool AIPlayerObject::onAdd()
|
|||
void AIPlayerObject::onRemove()
|
||||
{
|
||||
Parent::onRemove();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
#pragma once
|
||||
#include "playerObject.h"
|
||||
|
||||
#include "T3D/components/ai/aiControllerComponent.h"
|
||||
//#include "T3D/components/ai/aiControllerComponent.h"
|
||||
|
||||
class AIPlayerObject : public PlayerObject
|
||||
{
|
||||
typedef PlayerObject Parent;
|
||||
|
||||
AIControllerComponent* mAIControllerComponent;
|
||||
//AIControllerComponent* mAIControllerComponent;
|
||||
|
||||
public:
|
||||
AIPlayerObject();
|
||||
|
|
@ -17,4 +17,4 @@ public:
|
|||
virtual void onRemove();
|
||||
|
||||
DECLARE_CONOBJECT(AIPlayerObject);
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ IMPLEMENT_CO_NETOBJECT_V1(PlayerObject);
|
|||
PlayerObject::PlayerObject()
|
||||
: mMeshComponent(nullptr),
|
||||
mCollisionComponent(nullptr),
|
||||
mAnimationComponent(nullptr),
|
||||
//mAnimationComponent(nullptr),
|
||||
mPhysicsComponent(nullptr)
|
||||
{
|
||||
|
||||
mSuperClassName = StringTable->insert("Entity");
|
||||
}
|
||||
PlayerObject::~PlayerObject()
|
||||
{
|
||||
|
|
@ -48,7 +48,7 @@ bool PlayerObject::onAdd()
|
|||
addComponent(mCollisionComponent);
|
||||
|
||||
//Animation
|
||||
mAnimationComponent = new ActionAnimationComponent();
|
||||
/*mAnimationComponent = new ActionAnimationComponent();
|
||||
if (!mAnimationComponent->registerObject())
|
||||
{
|
||||
Con::errorf("PlayerObject::onAdd - unable to add ActionAnimationComponent!");
|
||||
|
|
@ -69,7 +69,7 @@ bool PlayerObject::onAdd()
|
|||
|
||||
mArmAnimationComponent->setInternalName("armAnimationComponent");
|
||||
|
||||
addComponent(mArmAnimationComponent);
|
||||
addComponent(mArmAnimationComponent);*/
|
||||
|
||||
//Physics control
|
||||
mPhysicsComponent = new PlayerControllerComponent();
|
||||
|
|
@ -162,4 +162,4 @@ bool PlayerObject::onAdd()
|
|||
void PlayerObject::onRemove()
|
||||
{
|
||||
Parent::onRemove();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
#include "T3D/entity.h"
|
||||
#include "T3D/components/render/meshComponent.h"
|
||||
#include "T3D/components/collision/shapeCollisionComponent.h"
|
||||
#include "T3D/components/animation/actionAnimationComponent.h"
|
||||
#include "T3D/components/animation/armAnimationComponent.h"
|
||||
//#include "T3D/components/animation/actionAnimationComponent.h"
|
||||
//#include "T3D/components/animation/armAnimationComponent.h"
|
||||
#include "T3D/components/physics/playerControllerComponent.h"
|
||||
#include "T3D/components/game/stateMachineComponent.h"
|
||||
#include "T3D/components/camera/cameraComponent.h"
|
||||
|
|
@ -19,8 +19,8 @@ class PlayerObject : public Entity
|
|||
|
||||
MeshComponent* mMeshComponent;
|
||||
ShapeCollisionComponent* mCollisionComponent;
|
||||
ActionAnimationComponent* mAnimationComponent;
|
||||
ArmAnimationComponent* mArmAnimationComponent;
|
||||
//ActionAnimationComponent* mAnimationComponent;
|
||||
//ArmAnimationComponent* mArmAnimationComponent;
|
||||
PlayerControllerComponent* mPhysicsComponent;
|
||||
StateMachineComponent* mStateMachineComponent;
|
||||
CameraComponent* mCameraComponent;
|
||||
|
|
@ -37,4 +37,4 @@ public:
|
|||
virtual void onRemove();
|
||||
|
||||
DECLARE_CONOBJECT(PlayerObject);
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
#include "SoundEmitterObject.h"
|
||||
#include "soundEmitterObject.h"
|
||||
|
||||
IMPLEMENT_CO_NETOBJECT_V1(SoundEmitterObject);
|
||||
|
||||
SoundEmitterObject::SoundEmitterObject()
|
||||
: mSoundComponent(nullptr)
|
||||
{
|
||||
|
||||
mSuperClassName = StringTable->insert("Entity");
|
||||
}
|
||||
SoundEmitterObject::~SoundEmitterObject()
|
||||
{
|
||||
|
|
@ -35,4 +35,4 @@ bool SoundEmitterObject::onAdd()
|
|||
void SoundEmitterObject::onRemove()
|
||||
{
|
||||
Parent::onRemove();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "T3D/entity.h"
|
||||
#include "T3D/components/audio/soundComponent.h"
|
||||
#include "T3D/components/audio/SoundComponent.h"
|
||||
|
||||
class SoundEmitterObject : public Entity
|
||||
{
|
||||
|
|
@ -17,4 +17,4 @@ public:
|
|||
virtual void onRemove();
|
||||
|
||||
DECLARE_CONOBJECT(SoundEmitterObject);
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ StaticShapeObject::StaticShapeObject()
|
|||
mCollisionComponent(nullptr),
|
||||
mAnimationComponent(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
StaticShapeObject::~StaticShapeObject()
|
||||
{
|
||||
|
|
@ -65,4 +64,4 @@ bool StaticShapeObject::onAdd()
|
|||
void StaticShapeObject::onRemove()
|
||||
{
|
||||
Parent::onRemove();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,6 +70,9 @@
|
|||
#ifndef MATERIALASSET_H
|
||||
#include "T3D/assets/MaterialAsset.h"
|
||||
#endif
|
||||
#ifndef GAME_OBJECT_ASSET_H
|
||||
#include "T3D/assets/GameObjectAsset.h"
|
||||
#endif
|
||||
|
||||
// Script bindings.
|
||||
#include "assetManager_ScriptBinding.h"
|
||||
|
|
@ -272,10 +275,16 @@ bool AssetManager::loadModuleAutoLoadAssets(ModuleDefinition* pModuleDefinition)
|
|||
{
|
||||
assetBase = mTaml.read<MaterialAsset>(assetDef->mAssetBaseFilePath);
|
||||
}
|
||||
else if (assetDef->mAssetType == StringTable->insert("GameObjectAsset"))
|
||||
{
|
||||
assetBase = mTaml.read<GameObjectAsset>(assetDef->mAssetBaseFilePath);
|
||||
}
|
||||
|
||||
//load the asset now if valid
|
||||
if (assetBase)
|
||||
addPrivateAsset(assetBase);
|
||||
{
|
||||
assetBase->setOwned(this, assetDef);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -658,8 +658,11 @@ void RenderProbeMgr::_update4ProbeConsts(const SceneData &sgData,
|
|||
shaderConsts->setSafe(probeShaderConsts->mProbeBoxMinSC, probeBoxMinArray);
|
||||
shaderConsts->setSafe(probeShaderConsts->mProbeBoxMaxSC, probeBoxMaxArray);
|
||||
shaderConsts->setSafe(probeShaderConsts->mProbeConfigDataSC, probeConfigArray);
|
||||
GFX->setCubeArrayTexture(probeShaderConsts->mProbeSpecularCubemapSC->getSamplerRegister(), mPrefilterArray);
|
||||
GFX->setCubeArrayTexture(probeShaderConsts->mProbeIrradianceCubemapSC->getSamplerRegister(), mIrradianceArray);
|
||||
|
||||
if(probeShaderConsts->mProbeSpecularCubemapSC->getSamplerRegister() != -1)
|
||||
GFX->setCubeArrayTexture(probeShaderConsts->mProbeSpecularCubemapSC->getSamplerRegister(), mPrefilterArray);
|
||||
if(probeShaderConsts->mProbeIrradianceCubemapSC->getSamplerRegister() != -1)
|
||||
GFX->setCubeArrayTexture(probeShaderConsts->mProbeIrradianceCubemapSC->getSamplerRegister(), mIrradianceArray);
|
||||
}
|
||||
|
||||
if (probeShaderConsts->mBRDFTextureMap->isValid())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue