mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 07:34:45 +00:00
groundframe generation cleanup work
This commit is contained in:
parent
6548ed1425
commit
ec7f7df5f1
2 changed files with 25 additions and 10 deletions
|
|
@ -86,7 +86,7 @@ bool TSMesh::smUseEncodedNormals = false;
|
||||||
|
|
||||||
const F32 TSMesh::VISIBILITY_EPSILON = 0.0001f;
|
const F32 TSMesh::VISIBILITY_EPSILON = 0.0001f;
|
||||||
|
|
||||||
S32 TSMesh::smMaxInstancingVerts = 2000;
|
S32 TSMesh::smMaxInstancingVerts = 20000;
|
||||||
MatrixF TSMesh::smDummyNodeTransform(1);
|
MatrixF TSMesh::smDummyNodeTransform(1);
|
||||||
|
|
||||||
// quick function to force object to face camera -- currently throws out roll :(
|
// quick function to force object to face camera -- currently throws out roll :(
|
||||||
|
|
|
||||||
|
|
@ -1473,7 +1473,7 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq,
|
||||||
S32 seqIndex = srcShape->findSequence(oldName);
|
S32 seqIndex = srcShape->findSequence(oldName);
|
||||||
if (seqIndex < 0)
|
if (seqIndex < 0)
|
||||||
{
|
{
|
||||||
Con::errorf("TSShape::addSequence: Could not find sequence named '%s'", oldName.c_str());
|
Con::errorf("TSShape::addSequence (%s): Could not find sequence named '%s'", path.getFullPath().c_str(), oldName.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1481,16 +1481,16 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq,
|
||||||
const TSShape::Sequence* srcSeq = &srcShape->sequences[seqIndex];
|
const TSShape::Sequence* srcSeq = &srcShape->sequences[seqIndex];
|
||||||
if ((startFrame < 0) || (startFrame >= srcSeq->numKeyframes))
|
if ((startFrame < 0) || (startFrame >= srcSeq->numKeyframes))
|
||||||
{
|
{
|
||||||
Con::warnf("TSShape::addSequence: Start keyframe (%d) out of range (0-%d) for sequence '%s'",
|
Con::warnf("TSShape::addSequence (%s): Start keyframe (%d) out of range (0-%d) for sequence '%s'",
|
||||||
startFrame, srcSeq->numKeyframes-1, oldName.c_str());
|
path.getFullPath().c_str(), startFrame, srcSeq->numKeyframes-1, oldName.c_str());
|
||||||
startFrame = 0;
|
startFrame = 0;
|
||||||
}
|
}
|
||||||
if (endFrame < 0)
|
if (endFrame < 0)
|
||||||
endFrame = srcSeq->numKeyframes - 1;
|
endFrame = srcSeq->numKeyframes - 1;
|
||||||
else if (endFrame >= srcSeq->numKeyframes)
|
else if (endFrame >= srcSeq->numKeyframes)
|
||||||
{
|
{
|
||||||
Con::warnf("TSShape::addSequence: End keyframe (%d) out of range (0-%d) for sequence '%s'",
|
Con::warnf("TSShape::addSequence (%s): End keyframe (%d) out of range (0-%d) for sequence '%s'",
|
||||||
endFrame, srcSeq->numKeyframes-1, oldName.c_str());
|
path.getFullPath().c_str(), endFrame, srcSeq->numKeyframes-1, oldName.c_str());
|
||||||
endFrame = srcSeq->numKeyframes - 1;
|
endFrame = srcSeq->numKeyframes - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1573,12 +1573,27 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq,
|
||||||
|
|
||||||
seq.numGroundFrames *= ratio;
|
seq.numGroundFrames *= ratio;
|
||||||
seq.firstGroundFrame = groundTranslations.size();
|
seq.firstGroundFrame = groundTranslations.size();
|
||||||
groundTranslations.reserve(groundTranslations.size() + seq.numGroundFrames);
|
groundTranslations.reserve(mMin(groundTranslations.size() + seq.numGroundFrames, srcShape->groundTranslations.size()));
|
||||||
groundRotations.reserve(groundRotations.size() + seq.numGroundFrames);
|
groundRotations.reserve(mMin(groundRotations.size() + seq.numGroundFrames, srcShape->groundRotations.size()));
|
||||||
for (S32 i = 0; i < seq.numGroundFrames; i++)
|
for (S32 i = 0; i < seq.numGroundFrames; i++)
|
||||||
{
|
{
|
||||||
groundTranslations.push_back(srcShape->groundTranslations[groundBase + i]);
|
S32 offset = groundBase + i;
|
||||||
groundRotations.push_back(srcShape->groundRotations[groundBase + i]);
|
if (offset >= srcShape->groundTranslations.size())
|
||||||
|
{
|
||||||
|
Con::errorf("%s groundTranslations out of bounds! [%i/%i] ", path.getFullPath().c_str(), groundBase + i, srcShape->groundTranslations.size());
|
||||||
|
offset = srcShape->groundTranslations.size() - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
groundTranslations.push_back(srcShape->groundTranslations[offset]);
|
||||||
|
|
||||||
|
S32 offset2 = groundBase + i;
|
||||||
|
if (offset2 >= srcShape->groundRotations.size())
|
||||||
|
{
|
||||||
|
Con::errorf("%s groundRotations out of bounds! [%i/%i] ", path.getFullPath().c_str(), groundBase + i, srcShape->groundRotations.size());
|
||||||
|
offset2 = srcShape->groundRotations.size() - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
groundRotations.push_back(srcShape->groundRotations[offset2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add triggers
|
// Add triggers
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue