FxFoliageReplicator detecting pz ... need some help
by Name · in Torque Game Engine · 01/31/2005 (9:21 pm) · 0 replies
Hey All,
I need a little help with the foliage Replicator... I want it to not "plant" in areas i have designated as physical zones... so I added some what I thought would be simple code, But that seems to have failed.
in fxFoliageReplicator.h I added
----------------------------------------------------------------------------------------------
#define FXFOLIAGEREPLICATOR_COLLISION_MASK ( TerrainObjectType | \
InteriorObjectType | \
StaticObjectType | \
WaterObjectType | \
PhysicalZoneObjectType ) //THIS LINE ADDED
#define FXFOLIAGEREPLICATOR_NOWATER_COLLISION_MASK ( TerrainObjectType | \
InteriorObjectType | \
StaticObjectType | \
PhysicalZoneObjectType ) //THIS LINE ADDED
//Further down
bool mAllowOnPZ;
//even Further down
mAllowOnPZ = false;
-----------------------------------------------------------------------------------------------
in fxFoilageReplicator.cc I added
------------------------------------------------------------------------------------------------
// Yes, so get it's type.
U32 CollisionType = RayEvent.object->getTypeMask();
// Check Illegal Placements, fail if we hit a disallowed type.
if (((CollisionType & TerrainObjectType) && !mFieldData.mAllowOnTerrain) ||
((CollisionType & InteriorObjectType) && !mFieldData.mAllowOnInteriors) ||
((CollisionType & StaticTSObjectType) && !mFieldData.mAllowStatics) ||
((CollisionType & WaterObjectType) && !mFieldData.mAllowOnWater) ||
((CollisionType & PhysicalZoneObjectType) && !mFieldData.mAllowOnPZ)) //THIS LINE ADDED
continue;
------------------------------------------------------------------------------------------------
to me this seems like perfect logic... the PZ is above the ground so it should be collided with first... Therefore by my masterfull skills of deduction my guess is that raycasts may not detect physical zones... which would be rediculous... but this will be the next thing I look into.
if anyone has any advice/help with this I would appreciate it, or perhaps a suggestion on a better method of keeping the replicator from spawning in a specific area (like a pathway or camp) I am quite happy to change my ways.
Thanks in advance
Chad.
I need a little help with the foliage Replicator... I want it to not "plant" in areas i have designated as physical zones... so I added some what I thought would be simple code, But that seems to have failed.
in fxFoliageReplicator.h I added
----------------------------------------------------------------------------------------------
#define FXFOLIAGEREPLICATOR_COLLISION_MASK ( TerrainObjectType | \
InteriorObjectType | \
StaticObjectType | \
WaterObjectType | \
PhysicalZoneObjectType ) //THIS LINE ADDED
#define FXFOLIAGEREPLICATOR_NOWATER_COLLISION_MASK ( TerrainObjectType | \
InteriorObjectType | \
StaticObjectType | \
PhysicalZoneObjectType ) //THIS LINE ADDED
//Further down
bool mAllowOnPZ;
//even Further down
mAllowOnPZ = false;
-----------------------------------------------------------------------------------------------
in fxFoilageReplicator.cc I added
------------------------------------------------------------------------------------------------
// Yes, so get it's type.
U32 CollisionType = RayEvent.object->getTypeMask();
// Check Illegal Placements, fail if we hit a disallowed type.
if (((CollisionType & TerrainObjectType) && !mFieldData.mAllowOnTerrain) ||
((CollisionType & InteriorObjectType) && !mFieldData.mAllowOnInteriors) ||
((CollisionType & StaticTSObjectType) && !mFieldData.mAllowStatics) ||
((CollisionType & WaterObjectType) && !mFieldData.mAllowOnWater) ||
((CollisionType & PhysicalZoneObjectType) && !mFieldData.mAllowOnPZ)) //THIS LINE ADDED
continue;
------------------------------------------------------------------------------------------------
to me this seems like perfect logic... the PZ is above the ground so it should be collided with first... Therefore by my masterfull skills of deduction my guess is that raycasts may not detect physical zones... which would be rediculous... but this will be the next thing I look into.
if anyone has any advice/help with this I would appreciate it, or perhaps a suggestion on a better method of keeping the replicator from spawning in a specific area (like a pathway or camp) I am quite happy to change my ways.
Thanks in advance
Chad.