Merge branch 'ExpandsComponents' of https://github.com/Areloch/Torque3D into development

This commit is contained in:
Areloch 2019-05-04 16:09:09 -05:00
commit 7f37aced90
51 changed files with 4566 additions and 1710 deletions

View file

@ -36,7 +36,7 @@
#include "T3D/components/coreInterfaces.h"
#include "T3D/components/render/renderComponentInterface.h"
#include "T3D/components/collision/collisionInterfaces.h"
#include "T3D/components/collision/collisionComponent.h"
#include "gui/controls/guiTreeViewCtrl.h"
#include "assets/assetManager.h"
@ -1123,8 +1123,8 @@ bool Entity::buildPolyList(PolyListContext context, AbstractPolyList* polyList,
void Entity::buildConvex(const Box3F& box, Convex* convex)
{
Vector<BuildConvexInterface*> updaters = getComponents<BuildConvexInterface>();
for (Vector<BuildConvexInterface*>::iterator it = updaters.begin(); it != updaters.end(); it++)
Vector<CollisionComponent*> colliders = getComponents<CollisionComponent>();
for (Vector<CollisionComponent*>::iterator it = colliders.begin(); it != colliders.end(); it++)
{
(*it)->buildConvex(box, convex);
}
@ -1398,10 +1398,7 @@ void Entity::clearComponents(bool deleteComponents)
{
comp->onComponentRemove(); //in case the behavior needs to do cleanup on the owner
//we only need to delete them on the server side. they'll be cleaned up on the client side
//via the ghosting system for us
if (isServerObject())
comp->deleteObject();
comp->deleteObject();
}
}
}
@ -1915,12 +1912,9 @@ DefineEngineMethod(Entity, getMoveVector, VectorF, (),,
"Get the number of static fields on the object.\n"
"@return The number of static fields defined on the object.")
{
if (object->getControllingClient() != NULL)
{
//fetch our last move
if (object->lastMove.x != 0 || object->lastMove.y != 0 || object->lastMove.z != 0)
return VectorF(object->lastMove.x, object->lastMove.y, object->lastMove.z);
}
//fetch our last move
if (object->lastMove.x != 0 || object->lastMove.y != 0 || object->lastMove.z != 0)
return VectorF(object->lastMove.x, object->lastMove.y, object->lastMove.z);
return VectorF::Zero;
}
@ -1929,12 +1923,9 @@ DefineEngineMethod(Entity, getMoveRotation, VectorF, (), ,
"Get the number of static fields on the object.\n"
"@return The number of static fields defined on the object.")
{
if(object->getControllingClient() != NULL)
{
//fetch our last move
if (object->lastMove.pitch != 0 || object->lastMove.roll != 0 || object->lastMove.yaw != 0)
return VectorF(object->lastMove.pitch, object->lastMove.roll, object->lastMove.yaw);
}
//fetch our last move
if (object->lastMove.pitch != 0 || object->lastMove.roll != 0 || object->lastMove.yaw != 0)
return VectorF(object->lastMove.pitch, object->lastMove.roll, object->lastMove.yaw);
return VectorF::Zero;
}