Corrected profile for GameObjectAsset type field button

Initial implementation of changeable TSStatic materials via material slots and drag and drop of material assets onto world editor from AB
Updated Volumetric Fog to support ShapeAsset for it's model data
Added cmake option to hide literal filename fields if the class supports asset fields for the same input
Added light viz modes to see diffuse, specular and detail lighting modes(currently just sun)
New raycast console function to return back material of hit object
Moved GameObject logic to SceneObject and started fixing up of editor behavior to allow any SceneObject to be converted into a GO, along with all supported behavior such as instance-template management and spawning GO via drag-and-drop from AB
Fixed inspector field tooltip text to be positioned in inspector footer properly again
Drag and drop of shape asset attempts to drop at raycast position now, instead of just at the camera ray position
This commit is contained in:
Areloch 2019-12-05 20:42:47 -06:00
parent 551df5e92a
commit 09c651c26d
25 changed files with 572 additions and 35 deletions

View file

@ -262,8 +262,8 @@ GuiControl* GuiInspectorTypeGameObjectAssetPtr::constructEditControl()
dSprintf(szBuffer, sizeof(szBuffer), "%d.onClick(%s);", this->getId(), mCaption);
mGameObjectEditButton->setField("Command", szBuffer);
mGameObjectEditButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");
mGameObjectEditButton->setDataField(StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile");
mGameObjectEditButton->setDataField(StringTable->insert("Profile"), NULL, "ToolsGuiButtonProfile");
mGameObjectEditButton->setDataField(StringTable->insert("tooltipprofile"), NULL, "ToolsGuiToolTipProfile");
mGameObjectEditButton->setDataField(StringTable->insert("hovertime"), NULL, "1000");
const char* assetId = getData();

View file

@ -366,7 +366,7 @@ GuiControl* GuiInspectorTypeShapeAssetPtr::constructEditControl()
// Change filespec
char szBuffer[512];
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ShapeAsset\", \"AssetBrowser.changeAsset\", %d, %s);",
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ShapeAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
mInspector->getInspectObject()->getIdString(), mCaption);
mBrowseButton->setField("Command", szBuffer);

View file

@ -171,8 +171,10 @@ void TSStatic::initPersistFields()
&TSStatic::_setShapeAsset, &defaultProtectedGetFn,
"The source shape asset.");
#ifdef TORQUE_ALLOW_DIRECT_FILENAMES
addField("shapeName", TypeShapeFilename, Offset( mShapeName, TSStatic ),
"%Path and filename of the model file (.DTS, .DAE) to use for this TSStatic." );
#endif
addProtectedField( "skin", TypeRealString, Offset( mAppliedSkinName, TSStatic ), &_setFieldSkin, &_getFieldSkin,
"@brief The skin applied to the shape.\n\n"
@ -289,7 +291,7 @@ void TSStatic::inspectPostApply()
if(isServerObject())
{
setMaskBits(AdvancedStaticOptionsMask);
setMaskBits(-1);
prepCollision();
}
@ -463,9 +465,74 @@ bool TSStatic::_createShape()
Sim::findObject( cubeDescId, reflectorDesc );
}
//Set up the material slot vars for easy manipulation
S32 materialCount = mShape->materialList->getMaterialNameList().size(); //mMeshAsset->getMaterialCount();
if (isServerObject())
{
char matFieldName[128];
for (U32 i = 0; i < materialCount; i++)
{
StringTableEntry materialname = StringTable->insert(mShape->materialList->getMaterialName(i).c_str());
dSprintf(matFieldName, 128, "MaterialSlot%d", i);
StringTableEntry matFld = StringTable->insert(matFieldName);
setDataField(matFld, NULL, materialname);
}
}
return true;
}
void TSStatic::onDynamicModified(const char* slotName, const char* newValue)
{
bool isSrv = isServerObject();
if (FindMatch::isMatch("materialslot*", slotName, false))
{
if (!getShape())
return;
S32 slot = -1;
String outStr(String::GetTrailingNumber(slotName, slot));
if (slot == -1)
return;
//Safe to assume the inbound value for the material will be a MaterialAsset, so lets do a lookup on the name
MaterialAsset* matAsset = AssetDatabase.acquireAsset<MaterialAsset>(newValue);
if (!matAsset)
return;
bool found = false;
for (U32 i = 0; i < mChangingMaterials.size(); i++)
{
if (mChangingMaterials[i].slot == slot)
{
mChangingMaterials[i].matAsset = matAsset;
mChangingMaterials[i].assetId = newValue;
found = true;
}
}
if (!found)
{
matMap newMatMap;
newMatMap.slot = slot;
newMatMap.matAsset = matAsset;
newMatMap.assetId = newValue;
mChangingMaterials.push_back(newMatMap);
}
setMaskBits(MaterialMask);
}
Parent::onDynamicModified(slotName, newValue);
}
void TSStatic::prepCollision()
{
// Let the client know that the collision was updated
@ -918,6 +985,22 @@ U32 TSStatic::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
}
stream->write(mOverrideColor);
if (stream->writeFlag(mask & MaterialMask))
{
stream->writeInt(mChangingMaterials.size(), 16);
for (U32 i = 0; i < mChangingMaterials.size(); i++)
{
stream->writeInt(mChangingMaterials[i].slot, 16);
NetStringHandle matNameStr = mChangingMaterials[i].assetId.c_str();
con->packNetStringHandleU(stream, matNameStr);
}
mChangingMaterials.clear();
}
return retMask;
}
@ -1019,6 +1102,26 @@ void TSStatic::unpackUpdate(NetConnection *con, BitStream *stream)
stream->read(&mOverrideColor);
if (stream->readFlag())
{
mChangingMaterials.clear();
U32 materialCount = stream->readInt(16);
for (U32 i = 0; i < materialCount; i++)
{
matMap newMatMap;
newMatMap.slot = stream->readInt(16);
newMatMap.assetId = String(con->unpackNetStringHandleU(stream).getString());
//do the lookup, now
newMatMap.matAsset = AssetDatabase.acquireAsset<MaterialAsset>(newMatMap.assetId);
mChangingMaterials.push_back(newMatMap);
}
updateMaterials();
}
if ( isProperlyAdded() )
_updateShouldTick();
set_special_typing();
@ -1458,6 +1561,46 @@ U32 TSStatic::getNumDetails()
return 0;
};
void TSStatic::updateMaterials()
{
if (mChangingMaterials.empty() || !mShape)
return;
TSMaterialList* pMatList = mShapeInstance->getMaterialList();
String path;
if (mShapeAsset->isAssetValid())
path = mShapeAsset->getShapeFilename();
else
path = mShapeName;
pMatList->setTextureLookupPath(path);
bool found = false;
const Vector<String>& materialNames = pMatList->getMaterialNameList();
for (S32 i = 0; i < materialNames.size(); i++)
{
if (found)
break;
for (U32 m = 0; m < mChangingMaterials.size(); m++)
{
if (mChangingMaterials[m].slot == i)
{
//Fetch the actual material asset
pMatList->renameMaterial(i, mChangingMaterials[m].matAsset->getMaterialDefinitionName());
found = true;
break;
}
}
}
mChangingMaterials.clear();
// Initialize the material instances
mShapeInstance->initMaterialList();
}
//------------------------------------------------------------------------
//These functions are duplicated in tsStatic and shapeBase.
//They each function a little differently; but achieve the same purpose of gathering

View file

@ -108,8 +108,9 @@ class TSStatic : public SceneObject
TransformMask = Parent::NextFreeMask << 0,
AdvancedStaticOptionsMask = Parent::NextFreeMask << 1,
UpdateCollisionMask = Parent::NextFreeMask << 2,
SkinMask = Parent::NextFreeFlag << 3,
NextFreeMask = Parent::NextFreeMask << 4
SkinMask = Parent::NextFreeMask << 3,
MaterialMask = Parent::NextFreeMask << 4,
NextFreeMask = Parent::NextFreeMask << 5
};
public:
@ -137,6 +138,16 @@ protected:
F32 mAlphaFade;
bool mInvertAlphaFade;
struct matMap
{
MaterialAsset* matAsset;
String assetId;
U32 slot;
};
Vector<matMap> mChangingMaterials;
Vector<matMap> mMaterials;
bool onAdd();
void onRemove();
@ -163,6 +174,8 @@ protected:
virtual void interpolateTick( F32 delta );
virtual void advanceTime( F32 dt );
virtual void onDynamicModified(const char* slotName, const char* newValue);
/// Start or stop processing ticks depending on our state.
void _updateShouldTick();
@ -261,6 +274,8 @@ public:
virtual void onInspect(GuiInspector*);
void updateMaterials();
private:
virtual void onStaticModified(const char* slotName, const char*newValue = NULL);
protected:

View file

@ -138,6 +138,9 @@ VolumetricFog::VolumetricFog()
mTexTiles = 1.0f;
mSpeed1.set(0.5f, 0.0f);
mSpeed2.set(0.1f, 0.1f);
mShapeAsset = StringTable->EmptyString();
mShapeAssetId = StringTable->EmptyString();
}
VolumetricFog::~VolumetricFog()
@ -165,8 +168,14 @@ VolumetricFog::~VolumetricFog()
void VolumetricFog::initPersistFields()
{
addGroup("VolumetricFogData");
addProtectedField("shapeAsset", TypeShapeAssetPtr, Offset(mShapeAsset, VolumetricFog),
&VolumetricFog::_setShapeAsset, &defaultProtectedGetFn, "The source shape asset.");
#ifdef TORQUE_ALLOW_DIRECT_FILENAMES
addField("shapeName", TypeShapeFilename, Offset(mShapeName, VolumetricFog),
"Path and filename of the model file (.DTS, .DAE) to use for this Volume.");
#endif
addField("FogColor", TypeColorI, Offset(mFogColor, VolumetricFog),
"Fog color RGBA (Alpha is ignored)");
addField("FogDensity", TypeF32, Offset(mFogDensity, VolumetricFog),
@ -212,6 +221,15 @@ void VolumetricFog::initPersistFields()
Parent::initPersistFields();
}
bool VolumetricFog::_setShapeAsset(void* obj, const char* index, const char* data)
{
VolumetricFog* fog = static_cast<VolumetricFog*>(obj);// ->setFile(FileName(data));
fog->setShapeAsset(StringTable->insert(data));
return false;
}
void VolumetricFog::inspectPostApply()
{
Parent::inspectPostApply();
@ -328,19 +346,49 @@ void VolumetricFog::handleResize(VolumetricFogRTManager *RTM, bool resize)
// Loadshape extracted from TSMesh and TSShapeInstance
//-----------------------------------------------------------------------------
bool VolumetricFog::setShapeAsset(const StringTableEntry shapeAssetId)
{
mShapeAssetId = shapeAssetId;
LoadShape();
return true;
}
bool VolumetricFog::LoadShape()
{
GFXPrimitiveType GFXdrawTypes[] = { GFXTriangleList, GFXTriangleStrip };
if (!mShapeName || mShapeName[0] == '\0')
{
Con::errorf("VolumetricFog::LoadShape() - No shape name! Volumetric Fog will not be rendered!");
return false;
}
// Load shape, server side only reads bounds and radius
Resource<TSShape> mShape;
mShape = ResourceManager::get().load(mShapeName);
if (mShapeAssetId != StringTable->EmptyString())
{
mShapeAsset = mShapeAssetId;
if (mShapeAsset.isNull())
{
Con::errorf("[TSStatic] Failed to load shape asset.");
return false;
}
mShape = mShapeAsset->getShapeResource();
if (!mShape)
{
Con::errorf("TSStatic::_createShape() - Shape Asset had no valid shape!");
return false;
}
}
else
{
if (!mShapeName || mShapeName[0] == '\0')
{
Con::errorf("VolumetricFog::LoadShape() - No shape name! Volumetric Fog will not be rendered!");
return false;
}
// Load shape, server side only reads bounds and radius
mShape = ResourceManager::get().load(mShapeName);
}
if (bool(mShape) == false)
{
Con::errorf("VolumetricFog::LoadShape() - Unable to load shape: %s", mShapeName);
@ -551,15 +599,25 @@ U32 VolumetricFog::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
}
if (stream->writeFlag(mask & FogShapeMask))
{
stream->writeString(mShapeAssetId);
stream->writeString(mShapeName);
mathWrite(*stream, getTransform());
mathWrite(*stream, getScale());
if (!mShapeName || mShapeName[0] == '\0')
return retMask;
Resource<TSShape> mShape;
mShape = ResourceManager::get().load(mShapeName);
if (mShapeAssetId != StringTable->EmptyString())
{
mShape = mShape = mShapeAsset->getShapeResource();
}
else if (mShapeName && mShapeName[0] != '\0')
{
mShape = ResourceManager::get().load(mShapeName);
}
if (bool(mShape) == false)
return retMask;
mObjBox = mShape->mBounds;
mRadius = mShape->mRadius;
resetWorldBox();
@ -577,6 +635,7 @@ void VolumetricFog::unpackUpdate(NetConnection *con, BitStream *stream)
VectorF scale;
VectorF mOldScale = getScale();
String oldTextureName = mTextureName;
StringTableEntry oldShapeAsset = mShapeAssetId;
StringTableEntry oldShape = mShapeName;
if (stream->readFlag())// Fog color
@ -647,10 +706,14 @@ void VolumetricFog::unpackUpdate(NetConnection *con, BitStream *stream)
}
if (stream->readFlag())//Fog shape
{
char buffer[256];
stream->readString(buffer);
mShapeAssetId = StringTable->insert(buffer);
mShapeName = stream->readSTString();
mathRead(*stream, &mat);
mathRead(*stream, &scale);
if (strcmp(oldShape, mShapeName) != 0)
if (strcmp(oldShapeAsset, mShapeAssetId) != 0 || strcmp(oldShape, mShapeName) != 0)
{
mIsVBDirty = true;
mShapeLoaded = LoadShape();

View file

@ -46,6 +46,13 @@
#endif
#include "gui/core/guiCanvas.h"
#ifndef _ASSET_PTR_H_
#include "assets/assetPtr.h"
#endif
#ifndef SHAPEASSET_H
#include "T3D/assets/ShapeAsset.h"
#endif
class VolumetricFogRTManager;
@ -136,6 +143,9 @@ class VolumetricFog : public SceneObject
GFXPrimitiveBufferHandle mPB;
// Fog volume data;
AssetPtr<ShapeAsset> mShapeAsset;
StringTableEntry mShapeAssetId;
StringTableEntry mShapeName;
ColorI mFogColor;
F32 mFogDensity;
@ -209,6 +219,8 @@ class VolumetricFog : public SceneObject
void processTick(const Move *move);
void _enterFog(ShapeBase *control);
void _leaveFog(ShapeBase *control);
static bool _setShapeAsset(void* obj, const char* index, const char* data);
public:
// Public methods
@ -234,6 +246,8 @@ class VolumetricFog : public SceneObject
void setFogGlow(bool on_off, F32 strength);
void setFogLightray(bool on_off, F32 strength);
bool isInsideFog();
bool setShapeAsset(const StringTableEntry shapeAssetId);
DECLARE_CONOBJECT(VolumetricFog);

View file

@ -138,6 +138,9 @@ GuiTextEditCtrl::GuiTextEditCtrl()
mHistoryIndex = 0;
mHistoryBuf = NULL;
mDoubleClickTimeMS = 50;
mMouseUpTime = 0;
#if defined(__MACOSX__)
UTF8 bullet[4] = { 0xE2, 0x80, 0xA2, 0 };
@ -382,7 +385,7 @@ void GuiTextEditCtrl::onMouseDown( const GuiEvent &event )
// If we have a double click, select all text. Otherwise
// act as before by clearing any selection.
bool doubleClick = (event.mouseClickCount > 1);
bool doubleClick = (event.mouseClickCount > 1 && Platform::getRealMilliseconds() - mMouseUpTime > mDoubleClickTimeMS);
if(doubleClick)
{
selectAllText();
@ -451,6 +454,8 @@ void GuiTextEditCtrl::onMouseUp(const GuiEvent &event)
TORQUE_UNUSED(event);
mDragHit = false;
mScrollDir = 0;
mMouseUpTime = Platform::getRealMilliseconds();
mouseUnlock();
}

View file

@ -85,6 +85,9 @@ protected:
bool mPasswordText;
StringTableEntry mPasswordMask;
S32 mDoubleClickTimeMS;
S32 mMouseUpTime;
/// If set, any non-ESC key is handled here or not at all
bool mSinkAllKeyEvents;
UTF16 **mHistoryBuf;

View file

@ -48,6 +48,9 @@ const String AdvancedLightBinManager::smBufferName( "specularLighting" );
ShadowFilterMode AdvancedLightBinManager::smShadowFilterMode = ShadowFilterMode_SoftShadowHighQuality;
bool AdvancedLightBinManager::smPSSMDebugRender = false;
bool AdvancedLightBinManager::smUseSSAOMask = false;
bool AdvancedLightBinManager::smDiffuseLightViz = false;
bool AdvancedLightBinManager::smSpecularLightViz = false;
bool AdvancedLightBinManager::smDetailLightingViz = false;
ImplementEnumType( ShadowFilterMode,
"The shadow filtering modes for Advanced Lighting shadows.\n"
@ -127,6 +130,9 @@ AdvancedLightBinManager::AdvancedLightBinManager( AdvancedLightManager *lm /* =
Con::addVariableNotify( "$pref::Shadows::filterMode", callback );
Con::addVariableNotify( "$AL::PSSMDebugRender", callback );
Con::addVariableNotify( "$AL::UseSSAOMask", callback );
Con::addVariableNotify( "$AL::DiffuseLightViz", callback);
Con::addVariableNotify( "$AL::SpecularLightViz", callback);
Con::addVariableNotify( "$AL::DetailLightingViz", callback);
}
@ -137,7 +143,10 @@ AdvancedLightBinManager::~AdvancedLightBinManager()
Con::NotifyDelegate callback( this, &AdvancedLightBinManager::_deleteLightMaterials );
Con::removeVariableNotify( "$pref::shadows::filterMode", callback );
Con::removeVariableNotify( "$AL::PSSMDebugRender", callback );
Con::removeVariableNotify( "$AL::UseSSAOMask", callback );
Con::removeVariableNotify( "$AL::UseSSAOMask", callback );
Con::removeVariableNotify( "$AL::DiffuseLightViz", callback);
Con::removeVariableNotify( "$AL::SpecularLightViz", callback);
Con::removeVariableNotify( "$AL::DetailLightingViz", callback);
}
void AdvancedLightBinManager::consoleInit()
@ -157,6 +166,18 @@ void AdvancedLightBinManager::consoleInit()
Con::addVariable( "$AL::PSSMDebugRender", TypeBool, &smPSSMDebugRender,
"Enables debug rendering of the PSSM shadows.\n"
"@ingroup AdvancedLighting\n" );
Con::addVariable("$AL::DiffuseLightViz", TypeBool, &smDiffuseLightViz,
"Enables debug rendering of the PSSM shadows.\n"
"@ingroup AdvancedLighting\n");
Con::addVariable("$AL::SpecularLightViz", TypeBool, &smSpecularLightViz,
"Enables debug rendering of the PSSM shadows.\n"
"@ingroup AdvancedLighting\n");
Con::addVariable("$AL::DetailLightingViz", TypeBool, &smDetailLightingViz,
"Enables debug rendering of the PSSM shadows.\n"
"@ingroup AdvancedLighting\n");
}
bool AdvancedLightBinManager::setTargetSize(const Point2I &newTargetSize)
@ -447,6 +468,13 @@ AdvancedLightBinManager::LightMaterialInfo* AdvancedLightBinManager::_getLightMa
if ( smPSSMDebugRender )
shadowMacros.push_back( GFXShaderMacro( "PSSM_DEBUG_RENDER" ) );
if( smDiffuseLightViz )
shadowMacros.push_back(GFXShaderMacro("DIFFUSE_LIGHT_VIZ"));
else if (smSpecularLightViz)
shadowMacros.push_back(GFXShaderMacro("SPECULAR_LIGHT_VIZ"));
else if (smDetailLightingViz)
shadowMacros.push_back(GFXShaderMacro("DETAIL_LIGHTING_VIZ"));
// Now create the material info object.
info = new LightMaterialInfo( lightMatName, smLightMatVertex[ lightType ], shadowMacros );
}

View file

@ -103,6 +103,11 @@ public:
/// light to compile in the SSAO mask.
static bool smUseSSAOMask;
//Used to toggle the visualization of diffuse and specular light contribution
static bool smDiffuseLightViz;
static bool smSpecularLightViz;
static bool smDetailLightingViz;
// Used for console init
AdvancedLightBinManager( AdvancedLightManager *lm = NULL,
ShadowMapManager *sm = NULL,

View file

@ -1654,4 +1654,57 @@ DefineEngineFunction( containerRayCast, const char*,
return(returnBuffer);
}
DefineEngineFunction(materialRayCast, const char*,
(Point3F start, Point3F end, U32 mask, SceneObject* pExempt, bool useClientContainer), (nullAsType<SceneObject*>(), false),
"@brief Cast a ray from start to end, checking for collision against items matching mask.\n\n"
"If pExempt is specified, then it is temporarily excluded from collision checks (For "
"instance, you might want to exclude the player if said player was firing a weapon.)\n"
"@param start An XYZ vector containing the tail position of the ray.\n"
"@param end An XYZ vector containing the head position of the ray\n"
"@param mask A bitmask corresponding to the type of objects to check for\n"
"@param pExempt An optional ID for a single object that ignored for this raycast\n"
"@param useClientContainer Optionally indicates the search should be within the "
"client container.\n"
"@returns A string containing either null, if nothing was struck, or these fields:\n"
"<ul><li>The ID of the object that was struck.</li>"
"<li>The x, y, z position that it was struck.</li>"
"<li>The x, y, z of the normal of the face that was struck.</li>"
"<li>The distance between the start point and the position we hit.</li></ul>"
"@ingroup Game")
{
if (pExempt)
pExempt->disableCollision();
SceneContainer* pContainer = useClientContainer ? &gClientContainer : &gServerContainer;
RayInfo rinfo;
S32 ret = 0;
if (pContainer->castRayRendered(start, end, mask, &rinfo) == true)
ret = rinfo.object->getId();
if (pExempt)
pExempt->enableCollision();
// add the hit position and normal?
static const U32 bufSize = 512;
char* returnBuffer = Con::getReturnBuffer(bufSize);
if (ret)
{
dSprintf(returnBuffer, bufSize, "%d %g %g %g %g %g %g %g %g %g %s",
ret, rinfo.point.x, rinfo.point.y, rinfo.point.z,
rinfo.normal.x, rinfo.normal.y, rinfo.normal.z, rinfo.distance, rinfo.texCoord.x, rinfo.texCoord.y, rinfo.material ? rinfo.material->getMaterial()->getName() : "");
}
else
{
returnBuffer[0] = '0';
returnBuffer[1] = '\0';
}
return(returnBuffer);
}
ConsoleFunctionGroupEnd( Containers );

View file

@ -154,6 +154,10 @@ SceneObject::SceneObject()
mAccuTex = NULL;
mSelectionFlags = 0;
mPathfindingIgnore = false;
mGameObjectAssetId = StringTable->insert("");
mDirtyGameObject = false;
}
//-----------------------------------------------------------------------------
@ -611,6 +615,13 @@ void SceneObject::setHidden( bool hidden )
void SceneObject::initPersistFields()
{
addGroup("GameObject");
addField("GameObject", TypeGameObjectAssetPtr, Offset(mGameObjectAsset, SceneObject), "The asset Id used for the game object this entity is based on.");
addField("dirtyGameObject", TypeBool, Offset(mDirtyGameObject, SceneObject), "If this entity is a GameObject, it flags if this instance delinates from the template.",
AbstractClassRep::FieldFlags::FIELD_HideInInspectors);
endGroup("GameObject");
addGroup( "Transform" );
addProtectedField( "position", TypeMatrixPosition, Offset( mObjToWorld, SceneObject ),
@ -654,6 +665,14 @@ void SceneObject::initPersistFields()
Parent::initPersistFields();
}
bool SceneObject::_setGameObject(void* object, const char* index, const char* data)
{
// Sanity!
AssertFatal(data != NULL, "Cannot use a NULL asset Id.");
return true; //rbI->setMeshAsset(data);
}
//-----------------------------------------------------------------------------
bool SceneObject::_setFieldPosition( void *object, const char *index, const char *data )
@ -1532,4 +1551,4 @@ DefineEngineMethod(SceneObject, setForwardVector, void, (VectorF newForward, Vec
"@param (Optional) The up vector to use to help orient the rotation.")
{
object->setForwardVector(newForward, upVector);
}
}

View file

@ -67,6 +67,13 @@
#include "ts/collada/colladaUtils.h"
#endif
#ifndef _ASSET_PTR_H_
#include "assets/assetPtr.h"
#endif
#ifndef GAME_OBJECT_ASSET_H
#include "T3D/assets/GameObjectAsset.h"
#endif
class SceneManager;
class SceneRenderState;
class SceneTraversalState;
@ -204,6 +211,12 @@ class SceneObject : public NetObject, private SceneContainer::Link, public Proce
///
SimPersistID* mMountPID;
StringTableEntry mGameObjectAssetId;
AssetPtr<GameObjectAsset> mGameObjectAsset;
//Marked if this entity is a GameObject and deliniates from the parent GO asset
bool mDirtyGameObject;
/// @}
/// @name Zoning
@ -778,6 +791,8 @@ class SceneObject : public NetObject, private SceneContainer::Link, public Proce
static void initPersistFields();
static bool _setGameObject(void* object, const char* index, const char* data);
DECLARE_CONOBJECT( SceneObject );
private: