mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 07:04:36 +00:00
Merge branch 'development' into style-cleanup
Conflicts: Engine/source/console/astNodes.cpp Engine/source/console/codeBlock.cpp Engine/source/console/compiledEval.cpp Engine/source/ts/collada/colladaAppMesh.cpp Engine/source/ts/tsShape.cpp Engine/source/ts/tsShapeConstruct.cpp
This commit is contained in:
commit
33ff180593
2053 changed files with 172002 additions and 69530 deletions
|
|
@ -623,7 +623,7 @@ void ColladaAppMesh::getPrimitives(const domGeometry* geometry)
|
|||
delete meshPrims[iPrim];
|
||||
}
|
||||
|
||||
void ColladaAppMesh::getVertexData(const domGeometry* geometry, F32 time, const MatrixF& objectOffset,
|
||||
void ColladaAppMesh::getVertexData(const domGeometry* geometry, F32 time, const MatrixF& objOffset,
|
||||
Vector<Point3F>& v_points,
|
||||
Vector<Point3F>& v_norms,
|
||||
Vector<ColorI>& v_colors,
|
||||
|
|
@ -693,7 +693,7 @@ void ColladaAppMesh::getVertexData(const domGeometry* geometry, F32 time, const
|
|||
if (mAppNode->invertMeshes)
|
||||
points_array[iVert].z = -points_array[iVert].z;
|
||||
|
||||
objectOffset.mulP(points_array[iVert]);
|
||||
objOffset.mulP(points_array[iVert]);
|
||||
}
|
||||
|
||||
if (appendValues || ((tuple.mUV >= 0) && (tuple.mUV < streams.mUVs.size()))) {
|
||||
|
|
@ -755,7 +755,7 @@ void ColladaAppMesh::getVertexData(const domGeometry* geometry, F32 time, const
|
|||
delete meshPrims[iPrim];
|
||||
}
|
||||
|
||||
void ColladaAppMesh::getMorphVertexData(const domMorph* morph, F32 time, const MatrixF& objectOffset,
|
||||
void ColladaAppMesh::getMorphVertexData(const domMorph* morph, F32 time, const MatrixF& objOffset,
|
||||
Vector<Point3F>& v_points,
|
||||
Vector<Point3F>& v_norms,
|
||||
Vector<ColorI>& v_colors,
|
||||
|
|
@ -807,7 +807,7 @@ void ColladaAppMesh::getMorphVertexData(const domMorph* morph, F32 time, const M
|
|||
return;
|
||||
|
||||
getPrimitives(baseGeometry);
|
||||
getVertexData(baseGeometry, time, objectOffset, v_points, v_norms, v_colors, v_uvs, v_uv2s, true);
|
||||
getVertexData(baseGeometry, time, objOffset, v_points, v_norms, v_colors, v_uvs, v_uv2s, true);
|
||||
|
||||
// Get pointers to the arrays of base geometry data
|
||||
Point3F* points_array = &v_points[v_points.size() - mVertTuples.size()];
|
||||
|
|
@ -863,7 +863,7 @@ void ColladaAppMesh::getMorphVertexData(const domMorph* morph, F32 time, const M
|
|||
if (uv2s_array)
|
||||
targetUv2s.set(uv2s_array, mVertTuples.size());
|
||||
|
||||
getVertexData(targetGeoms[iTarget], time, objectOffset, targetPoints, targetNorms, targetColors, targetUvs, targetUv2s, false);
|
||||
getVertexData(targetGeoms[iTarget], time, objOffset, targetPoints, targetNorms, targetColors, targetUvs, targetUv2s, false);
|
||||
|
||||
// Combine with base geometry
|
||||
for (S32 iVert = 0; iVert < mVertTuples.size(); iVert++) {
|
||||
|
|
@ -883,7 +883,7 @@ void ColladaAppMesh::getMorphVertexData(const domMorph* morph, F32 time, const M
|
|||
}
|
||||
}
|
||||
|
||||
void ColladaAppMesh::lockMesh(F32 t, const MatrixF& objectOffset)
|
||||
void ColladaAppMesh::lockMesh(F32 t, const MatrixF& objOffset)
|
||||
{
|
||||
// Find the geometry element for this mesh. Could be one of 3 things:
|
||||
// 1) a simple static mesh (Collada <geometry> element)
|
||||
|
|
@ -922,11 +922,10 @@ void ColladaAppMesh::lockMesh(F32 t, const MatrixF& objectOffset)
|
|||
|
||||
// Now get the vertex data at the specified time
|
||||
if (geometry->getElementType() == COLLADA_TYPE::GEOMETRY) {
|
||||
getPrimitives(daeSafeCast<domGeometry>(geometry));
|
||||
getVertexData(daeSafeCast<domGeometry>(geometry), t, objectOffset, mPoints, mNormals, mColors, mUVs, mUV2s, true);
|
||||
getPrimitives(daeSafeCast<domGeometry>(geometry));(daeSafeCast<domGeometry>(geometry), t, objOffset, mPoints, mNormals, mColors, mUVs, mUV2s, true);
|
||||
}
|
||||
else if (geometry->getElementType() == COLLADA_TYPE::MORPH) {
|
||||
getMorphVertexData(daeSafeCast<domMorph>(geometry), t, objectOffset, mPoints, mNormals, mColors, mUVs, mUV2s);
|
||||
getMorphVertexData(daeSafeCast<domMorph>(geometry), t, objOffset, mPoints, mNormals, mColors, mUVs, mUV2s);
|
||||
}
|
||||
else {
|
||||
daeErrorHandler::get()->handleWarning(avar("Unsupported geometry type "
|
||||
|
|
|
|||
|
|
@ -109,11 +109,11 @@ protected:
|
|||
bool checkGeometryType(const daeElement* element);
|
||||
void getPrimitives(const domGeometry* geometry);
|
||||
|
||||
void getVertexData( const domGeometry* geometry, F32 time, const MatrixF& objectOffset,
|
||||
void getVertexData( const domGeometry* geometry, F32 time, const MatrixF& objOffset,
|
||||
Vector<Point3F>& points, Vector<Point3F>& norms, Vector<ColorI>& colors,
|
||||
Vector<Point2F>& uvs, Vector<Point2F>& uv2s, bool appendValues);
|
||||
|
||||
void getMorphVertexData( const domMorph* morph, F32 time, const MatrixF& objectOffset,
|
||||
void getMorphVertexData( const domMorph* morph, F32 time, const MatrixF& objOffset,
|
||||
Vector<Point3F>& points, Vector<Point3F>& norms, Vector<ColorI>& colors,
|
||||
Vector<Point2F>& uvs, Vector<Point2F>& uv2s );
|
||||
|
||||
|
|
@ -211,8 +211,8 @@ public:
|
|||
/// Generate the vertex, normal and triangle data for the mesh.
|
||||
///
|
||||
/// @param time Time at which to generate the mesh data
|
||||
/// @param objectOffset Transform to apply to the generated data (bounds transform)
|
||||
void lockMesh(F32 time, const MatrixF& objectOffset);
|
||||
/// @param objOffset Transform to apply to the generated data (bounds transform)
|
||||
void lockMesh(F32 time, const MatrixF& objOffset);
|
||||
|
||||
/// Get the transform of this mesh at a certain time
|
||||
///
|
||||
|
|
|
|||
|
|
@ -139,13 +139,13 @@ ConsoleFunction( enumColladaForImport, bool, 3, 3,
|
|||
GuiTreeViewCtrl* tree;
|
||||
if (!Sim::findObject(argv[2], tree))
|
||||
{
|
||||
Con::errorf("enumColladaScene::Could not find GuiTreeViewCtrl '%s'", argv[2]);
|
||||
Con::errorf("enumColladaScene::Could not find GuiTreeViewCtrl '%s'", (const char*)argv[2]);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if a cached DTS is available => no need to import the collada file
|
||||
// if we can load the DTS instead
|
||||
Torque::Path path(argv[1]);
|
||||
Torque::Path path((const char*)argv[1]);
|
||||
if (ColladaShapeLoader::canLoadCachedDTS(path))
|
||||
return false;
|
||||
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ ConsoleFunction( loadColladaLights, bool, 2, 4,
|
|||
"@ingroup Editors\n"
|
||||
"@internal")
|
||||
{
|
||||
Torque::Path path(argv[1]);
|
||||
Torque::Path path((const char*)argv[1]);
|
||||
|
||||
// Optional group to add the lights to. Create if it does not exist, and use
|
||||
// the MissionGroup if not specified.
|
||||
|
|
@ -172,7 +172,7 @@ ConsoleFunction( loadColladaLights, bool, 2, 4,
|
|||
if (!Sim::findObject(argv[2], group)) {
|
||||
// Create the group if it could not be found
|
||||
group = new SimGroup;
|
||||
if (group->registerObject(argv[2])) {
|
||||
if (group->registerObject((const char*)argv[2])) {
|
||||
if (missionGroup)
|
||||
missionGroup->addObject(group);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,15 @@
|
|||
#include "core/util/zip/zipVolume.h"
|
||||
#include "gfx/bitmap/gBitmap.h"
|
||||
|
||||
MODULE_BEGIN( ColladaShapeLoader )
|
||||
MODULE_INIT_AFTER( ShapeLoader )
|
||||
MODULE_INIT
|
||||
{
|
||||
TSShapeLoader::addFormat("Collada", "dae");
|
||||
TSShapeLoader::addFormat("Google Earth", "kmz");
|
||||
}
|
||||
MODULE_END;
|
||||
|
||||
//
|
||||
static DAE sDAE; // Collada model database (holds the last loaded file)
|
||||
static Torque::Path sLastPath; // Path of the last loaded Collada file
|
||||
|
|
|
|||
|
|
@ -430,6 +430,8 @@ public:
|
|||
class BasePrimitive
|
||||
{
|
||||
public:
|
||||
virtual ~BasePrimitive() { }
|
||||
|
||||
/// Return true if the element is a geometric primitive type
|
||||
static bool isPrimitive(const daeElement* element)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue