www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: kiffa on August 28, 2013, 05:32:14 am

Title: How to avoid the creating of new objects in Collision detection.
Post by: kiffa on August 28, 2013, 05:32:14 am
In my game, I called Object3D.checkForCollisionEllipsoid() per frame, and I found there are some creating of new objects per call(Seems they are CollisionInfo and SimpleVector).

Is there any way to avoid this? I use the Allocation Tracker tool of Android to do the profiling, and there is the report:

(http://s1.upload.tf/3/1377660838x1249754962.jpg)
Title: Re: How to avoid the creating of new objects in Collision detection.
Post by: EgonOlsen on August 28, 2013, 09:39:17 am
Is there any way to avoid this?
No, there isn't. Object creation in that method is already down to the bare minimum.