Jump to content

Polymesh physics collision generation fails on complex models


mdgunn
 Share

Recommended Posts

I am trying to use some externally generated meshes as low-poly terrains but the editor is not generating the physics collision 'mesh' if I have terrains much above 10K (which doesn't seem very big).  It finds some faces then seems to give up.  Using Leadwerks terrain not an option as I want these terrains to be modeled meshes which are islands with underparts I want to be able to fly/go to.

Find attached 4 models based on OBJ files from World Machine taken into Blender and Exported to Leadwerks as FBX. Models are 50K, 25K, 15K, 10K.  Only the 10K generates the physics 'mesh' fully.

Attached maps directory from Leadwerks 4.5 EMPTY starting template project.  Contained all the files involved.  If anything else required please ask.  If someone has seen large poly mesh terrains work (regardless of these test files) then please let me know so I at least know it is....or was(?)  possible.  Thanks.

If there is a different approach please let me know, but using some sort of tile system is not my preferred choice at this time.

Maps.zip

System: AMD 1600X CPU / AMD RX 480 GPU / WIN 10 64 bit

NOT WORKING @ ~ 15K....

terrain_problem.thumb.png.f40882870d0d1a599d6b84dae5ac7f79.png

 

WORKING @~10K....

terrain_works.thumb.png.9c500cf328ab6bc78a100f4c7a0a4edc.png

Link to comment
Share on other sites

Tried doing it in lau code on terrain entity start but results seems the same....

function Script:Start()

	--Create a shape for the terrain based on the terrain
	local shape = Shape:PolyMesh((self.entity:GetSurface(0)))
	self.entity:SetShape(shape)	
	Debug:Assert(self.entity:GetShape()==shape)	
	shape:Release()
	self.entity:SetCollisionType(Collision.Scene)
	
end

Ball intersecting terrain and terrain showing where physics is and is not.

 

terrain.thumb.png.8980c651846a0be015f68cf16e9e5cdc.png

 

 

Link to comment
Share on other sites

YEEEEEEEAH that's it!  50K one works fine now.

It turns out that you MUST do the SCALE and then COLLAPSE.   Collapse first then scale and it doesn't work. 

Seems like a bug, in the very least not informing the user if it encounters a problem.  

MANY MANY THANKS!

 

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

I just ran through my code looking for an error and could not find one.

There is an issue if triangles are too small. Resizing then collapsing the model will fix that.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • Josh locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...