Vegetation (trees)

Hi … I imported a tree from Speed ​​Tree to Lumberyard. But it only supports Physics legacy …I can’t add physX to the tree…Even with the vegetation system, it only supports legacy physics!!!
How can I use physX for trees??

Hey! @Itachi999 the PhysX system is still catching up to all the systems to fully replace the legacy physics system

The new vegetation is super powerful but still in its first public iteration so we should be seeing some more updates in the coming updates

hi! you can enumerate all trees (position and boundbox) and create for each tree - PhysX collider manually xD

			// #include <Vegetation\StaticVegetationBus.h>
			Vegetation::MapHandle mapHandle;
			Vegetation::StaticVegetationRequestBus::BroadcastResult(mapHandle, &Vegetation::StaticVegetationRequestBus::Events::GetStaticVegetation);

			const Vegetation::StaticVegetationMap* vegMap = mapHandle.Get();

			if (vegMap)
				for (auto it = vegMap->begin(); it != vegMap->end(); it++)
					Vegetation::StaticVegetationData svd = it->second;
					AZ_Printf("Vegetation::StaticVegetationData", "position %f %f %f", static_cast<float>(svd.m_position.GetX()), static_cast<float>(svd.m_position.GetY()), static_cast<float>(svd.m_position.GetZ()));

@TheDevShop you mean what new dyn vegetation system super powerful?) I don’t think so( this is some kind hell to use bunch of components for vegetation, then in old sys you can just select vegetation and paint it on terrain or put vegetations on static objects.
I prefer use old sys but with physX supporting. I hoping they add physx for old vegetation system too

just because its a different workflow doesnt mean it isnt powerful because it is, old system doesnt mesh with LY’s current vision and I prefer the modular building system, you can use the old system no problem but for building fast world and vegetated areas quickly, the tool is already top tier and its only the first version (for us anyway)

Can you add more detail how to do this? This code just shows how to loop through all the vegetation objects but it doesn’t really show the API calls to add collision components.

And if it really is this easy why hasn’t this already been implemented?

@wcb oh dude i do not using LY already a long time. On forum just in reading-mode) I’m forgot most of things that I coded before for LY(( so I do not remember how to add collider, but it’s should’t to be very hard)

I would say, what you need create pool of colliders and move/reuse they if colliders are outs of some radius from player position. Update pool of colliders position on every frame.