Game Development Community

FxFoliageReplicator: Atlas not seen as terrain

by Marc Dreamora Schaerer · in Torque Game Engine Advanced · 02/28/2007 (8:03 am) · 4 replies

While adding forceBelowWater functionality to the fxFoliageReplicator for underwater fauna, I realized that AllowOnTerrain ignored Atlas terrains in TGEA 1.0 and thus even places them on atlas terrains when placing on terrains was not allowed at all. This might be the cause for some other bugs that some might have struggled over with foliage where it should / should not have been.

To fix that, replace
if (((CollisionType & TerrainObjectType) && !mFieldData.mAllowOnTerrain)	||

in Line 658 of fxFoliageReplicator.cpp with

if ((( (CollisionType & TerrainObjectType) || (CollisionType & AtlasObjectType) ) && !mFieldData.mAllowOnTerrain)	||


as well as

#define FXFOLIAGEREPLICATOR_NOWATER_COLLISION_MASK   (   TerrainObjectType      |   \
                                          InteriorObjectType      |   \
                                          StaticObjectType   )

in line 27++ of fxFoliageReplicator.h with

#define FXFOLIAGEREPLICATOR_NOWATER_COLLISION_MASK   (		TerrainObjectType		|   \
															AtlasObjectType			|   \
															InteriorObjectType      |   \
															StaticObjectType   )

#1
02/28/2007 (8:16 am)
Good stuff Marc. In general it seems that fxFoliageReplicator has been a low priority for GG to get working properly, and yet its so important to making good-looking environments.
#2
02/28/2007 (9:36 am)
I agree, fauna it is very important.

For that reason I am a little unhappy that there is no shapeReplicator in TGEA 1.0
It seems like there has been one somewhen as the declarations are present in the engine codebase, but I've "jumped on the TGEA" train with RC1 where the shapeReplicator that was present actually only was a copied over from TGE. No porting.
#3
02/28/2007 (6:28 pm)
Shape Replicator works fine, but it isn't included stock. There is a resource for it in the resources area, but be sure to use the fix in the comments which allows ut to work with MS4+. It should imo though go into head, it's a useful feature that would be nice for non-programmers to be able to get running easily.
#4
03/01/2007 (3:05 am)
Thanks for the fix marc, appreciated.

addikt