then load them up in the game map using the saved files.
The next step was to make them solid.
This would be exceptionally nice for non-plant objects - such as a barrel, box, or an entire building.
The problem is that my FPS is dropping from near 100 to 20-something just for putting in ONE tree.
Apparently i'm somehow overburdening the engine with Meta Triangle Selector.
(i say this because i have near the same FPS weather i use one tree or 300 trees.
it's me trying to include collisions with them that is lagging the program)
I'm wondering if I'm misunderstanding how to use the Meta triangle selector
Any help would be appreciated
Code: Select all
selector = smgr.CreateMetaTriangleSelector
' q3node = main map mesh.
ObjectOnMapSelector = smgr.CreateTriangleSelector(q3node.Mesh, q3node)
selector.AddTriangleSelector(ObjectOnMapSelector)
' PlantNodes = other objects added via map editor
For I As Integer = 0 To 100
If PlantNodes(I) IsNot Nothing Then
ObjectOnMapSelector = smgr.CreateTriangleSelector(PlantNodes(I).Mesh, PlantNodes(I))
selector.AddTriangleSelector(ObjectOnMapSelector)
End If
Next
q3node.TriangleSelector = selector
If i'm translating it to C dialect properly for you to read, then it should look something like this:
Code: Select all
selector = smgr::CreateMetaTriangleSelector;
// q3node is the main map mesh
ObjectOnMapSelector = smgr::CreateTriangleSelector(q3node::Mesh, q3node);
selector::AddTriangleSelector(ObjectOnMapSelector);
// plant nodes are objects added latter through the map editor
for (int ObjectCount = 0; ObjectCount <= 100; I++)
{
if (PlantNodes[ObjectCount] != nullptr)
{
ObjectOnMapSelector = smgr::CreateTriangleSelector(PlantNodes[ObjectCount]->Mesh, PlantNodes[ObjectCount]);
selector::AddTriangleSelector[ObjectOnMapSelector];
}
}
q3node->TriangleSelector = selector;
Any help on how i may be misusing the IMetaTriangleSelector would be greatly appreciated.
this FPS is KILLING ME!
(yes, i still have FPS tied to game loops for now - but just so i can notice excessive system burdens like I'm seeing now)