PDA

View Full Version : viz.collision enabled lag


Gekitatsu
04-10-2012, 01:10 PM
Setup

-City enviorment (Buildings/tress/cars/etc)(As 1.ive file)
-Mainview placed at a location in the city.

Goal

Move the camera around the city without being able to move through any objects in the city.

Problem

When I add viz.collision(viz.On) to enable collision for MainView my framerate drops to 22 from 60. Anybody have any idea how to bring my framerate back up to 60 with a collision enabled mainview?


-Note The mainview is not linked to any objects.

Jeff
04-11-2012, 07:00 AM
Having a dense mesh can slow things down to a crawl if you try to do collisions with it. Instead it's common to build a much lighter collision mesh (eg, 10k polygons) for collisions. Hide the visibility of the collision mesh and disable collisions on the dense visible mesh.

farshizzo
04-11-2012, 09:20 AM
Along with using a lower poly mesh for collision tests, you can also use the viz.OPTIMIZE_INTERSECT_HINT flag to speed up collision tests with a particular mesh:model.hint(viz.OPTIMIZE_INTERSECT_HINT)