Merge branch 'GarageGames/master' into ueberengine-dev

Conflicts:
	Engine/source/T3D/fps/guiCrossHairHud.cpp
This commit is contained in:
Duion 2016-07-27 13:44:27 +02:00
commit 81750f3deb
2827 changed files with 315755 additions and 121398 deletions

View file

@ -24,7 +24,7 @@
#define _COLLADA_APPMESH_H_
#ifndef _TDICTIONARY_H_
#include "core/tDictionary.h"
#include "core/util/tDictionary.h"
#endif
#ifndef _APPMESH_H_
#include "ts/loader/appMesh.h"

View file

@ -24,7 +24,7 @@
#define _COLLADA_APPNODE_H_
#ifndef _TDICTIONARY_H_
#include "core/tDictionary.h"
#include "core/util/tDictionary.h"
#endif
#ifndef _APPNODE_H_
#include "ts/loader/appNode.h"

View file

@ -168,7 +168,7 @@ DefineConsoleFunction( loadColladaLights, bool, (const char * filename, const ch
// the MissionGroup if not specified.
SimGroup* missionGroup = dynamic_cast<SimGroup*>(Sim::findObject("MissionGroup"));
SimGroup* group = 0;
if (!dStrIsEmpty(parentGroup)){
if (!String::isEmpty(parentGroup)){
if (!Sim::findObject(parentGroup, group)) {
// Create the group if it could not be found
group = new SimGroup;
@ -187,7 +187,7 @@ DefineConsoleFunction( loadColladaLights, bool, (const char * filename, const ch
// Optional object to provide the base transform
MatrixF offset(true);
if (!dStrIsEmpty(baseObject)){
if (!String::isEmpty(baseObject)){
SceneObject *obj;
if (Sim::findObject(baseObject, obj))
offset = obj->getTransform();

View file

@ -529,6 +529,16 @@ bool ColladaShapeLoader::canLoadCachedDTS(const Torque::Path& path)
}
}
//assume the dts is good since it was zipped on purpose
Torque::FS::FileSystemRef ref = Torque::FS::GetFileSystem(cachedPath);
if (ref && !dStrcmp("Zip", ref->getTypeStr()))
{
bool forceLoadDAE = Con::getBoolVariable("$collada::forceLoadDAE", false);
if (!forceLoadDAE && Torque::FS::IsFile(cachedPath))
return true;
}
return false;
}
@ -709,11 +719,17 @@ TSShape* loadColladaShape(const Torque::Path &path)
#ifndef DAE2DTS_TOOL
// Cache the Collada model to a DTS file for faster loading next time.
FileStream dtsStream;
if (dtsStream.open(cachedPath.getFullPath(), Torque::FS::File::Write))
{
Torque::FS::FileSystemRef ref = Torque::FS::GetFileSystem(daePath);
if (ref && !dStrcmp("Zip", ref->getTypeStr()))
Con::errorf("No cached dts file found in archive for %s. Forcing cache to disk.", daePath.getFullFileName().c_str());
Con::printf("Writing cached COLLADA shape to %s", cachedPath.getFullPath().c_str());
tss->write(&dtsStream);
}
#endif // DAE2DTS_TOOL
// Add collada materials to materials.cs

View file

@ -1630,7 +1630,12 @@ bool TSMesh::castRayOpcode( const Point3F &s, const Point3F &e, RayInfo *info, T
}
// slerp
Point3F s = ( (max - min) - (facePoint - min) ) / (max - min);
Point3F divSafe = (max - min);
if (divSafe.x == 0.0f) divSafe.x = POINT_EPSILON;
if (divSafe.y == 0.0f) divSafe.y = POINT_EPSILON;
if (divSafe.z == 0.0f) divSafe.z = POINT_EPSILON;
Point3F s = ( (max - min) - (facePoint - min) ) / divSafe;
// compute axis
S32 bestAxis = 0;

View file

@ -57,7 +57,7 @@
# include "platformXbox/platformXbox.h"
#endif
GFXPrimitiveType drawTypes[] = { GFXTriangleList, GFXTriangleStrip, GFXTriangleFan };
GFXPrimitiveType drawTypes[] = { GFXTriangleList, GFXTriangleStrip };
#define getDrawType(a) (drawTypes[a])
@ -2442,7 +2442,6 @@ void TSMesh::_createVBIB( TSVertexBufferHandle &vb, GFXPrimitiveBufferHandle &pb
break;
case GFXTriangleStrip:
case GFXTriangleFan:
pInfo.type = drawType;
pInfo.numPrimitives = draw.numElements - 2;
pInfo.startIndex = draw.start;
@ -3006,17 +3005,6 @@ void TSMesh::createTangents(const Vector<Point3F> &_verts, const Vector<Point3F>
}
break;
}
case GFXTriangleFan:
{
p1Index = baseIdx[0];
p2Index = baseIdx[1];
for( U32 j = 2; j < numElements; j++ )
{
findTangent( p1Index, p2Index, baseIdx[j], tan0.address(), tan1, _verts );
p2Index = baseIdx[j];
}
break;
}
default:
AssertFatal( false, "TSMesh::createTangents: unknown primitive type!" );

View file

@ -593,7 +593,7 @@ S32 TSShapeInstance::setDetailFromDistance( const SceneRenderState *state, F32 s
// 4:3 aspect ratio, we've changed the reference value
// to 300 to be more compatible with legacy shapes.
//
const F32 pixelScale = state->getViewport().extent.y / 300.0f;
const F32 pixelScale = (state->getViewport().extent.x / state->getViewport().extent.y);
// This is legacy DTS support for older "multires" based
// meshes. The original crossbow weapon uses this.