trackgen: only create one .ac file for all individual objects
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9084 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: a4b6e240e8d911a8be7173f16591b8a529c8ed78 Former-commit-id: 69ce34f7489eb52fa04b2434a17f16e6ca3d6ef1
This commit is contained in:
parent
f37c44d889
commit
f70065eba7
2 changed files with 24 additions and 24 deletions
|
@ -98,7 +98,7 @@ public:
|
|||
|
||||
//! Constructor.
|
||||
Application::Application()
|
||||
: GfApplication("TrackGen", "1.6.0.27", "Terrain generator for tracks")
|
||||
: GfApplication("TrackGen", "1.6.0.28", "Terrain generator for tracks")
|
||||
, HeightSteps(30)
|
||||
, Bump(false)
|
||||
, Raceline(false)
|
||||
|
|
|
@ -493,37 +493,37 @@ GenerateObjects(tTrack *track, void *TrackHandle, void *CfgHandle, Ac3d &allAc3d
|
|||
|
||||
GfParmListSeekFirst(TrackHandle, TRK_SECT_TERRAIN_OBJECTS);
|
||||
|
||||
Ac3d Root;
|
||||
|
||||
index++;
|
||||
|
||||
do
|
||||
{
|
||||
Ac3d Root;
|
||||
|
||||
index++;
|
||||
|
||||
const tdble x = GfParmGetCurNum(TrackHandle, TRK_SECT_TERRAIN_OBJECTS, TRK_ATT_X, "m", 0);
|
||||
const tdble y = GfParmGetCurNum(TrackHandle, TRK_SECT_TERRAIN_OBJECTS, TRK_ATT_Y, "m", 0);
|
||||
const unsigned int color = (unsigned int)GfParmGetCurNum(TrackHandle, TRK_SECT_TERRAIN_OBJECTS, TRK_ATT_COLOR, nullptr, 0);
|
||||
|
||||
printf("found color: 0x%X x: %f y: %f\n", color, x, y);
|
||||
AddObject(track, TrackHandle, TrackRoot, Root, color, x + zeroX, y + zeroY, multipleMaterials, true);
|
||||
|
||||
Ac3d GroupRoot;
|
||||
GroupRoot.materials = Root.materials;
|
||||
Ac3d::Object object("group", "");
|
||||
GroupRoot.addObject(object);
|
||||
std::vector<Ac3d::Object *> Groups;
|
||||
|
||||
Group(track, TrackHandle, &Root.root, &GroupRoot.root.kids.front(), Groups);
|
||||
|
||||
const char *extName = GfParmGetStr(CfgHandle, "Files", "object", "obj");
|
||||
const std::string objectFile(outputFile + "-" + extName + "-" + std::to_string(index) + ".ac");
|
||||
saveACInner(&GroupRoot.root.kids.front(), GroupRoot);
|
||||
GroupRoot.flipAxes(false); // convert to track coordinate system
|
||||
GroupRoot.writeFile(objectFile, false);
|
||||
|
||||
if (all)
|
||||
{
|
||||
allAc3d.merge(GroupRoot, multipleMaterials);
|
||||
}
|
||||
} while (!GfParmListSeekNext(TrackHandle, TRK_SECT_TERRAIN_OBJECTS));
|
||||
|
||||
Ac3d GroupRoot;
|
||||
GroupRoot.materials = Root.materials;
|
||||
Ac3d::Object object("group", "");
|
||||
GroupRoot.addObject(object);
|
||||
std::vector<Ac3d::Object *> Groups;
|
||||
|
||||
Group(track, TrackHandle, &Root.root, &GroupRoot.root.kids.front(), Groups);
|
||||
|
||||
const char *extName = GfParmGetStr(CfgHandle, "Files", "object", "obj");
|
||||
const std::string objectFile(outputFile + "-" + extName + "-" + std::to_string(index) + ".ac");
|
||||
saveACInner(&GroupRoot.root.kids.front(), GroupRoot);
|
||||
GroupRoot.flipAxes(false); // convert to track coordinate system
|
||||
GroupRoot.writeFile(objectFile, false);
|
||||
|
||||
if (all)
|
||||
{
|
||||
allAc3d.merge(GroupRoot, multipleMaterials);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue