Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Is the physics collision engine faster than ordinary sprite collision?

Author
Message
Timshark
16
Years of Service
User Offline
Joined: 30th Jun 2007
Location: Oslo, Norway
Posted: 6th May 2013 08:56 Edited at: 6th May 2013 12:44
Salute

I've built the framework for my game and I'm moving on to collisions. I have a HUGE amount of sprites. They will of course not be involved in a collision test all the time, but in some sections there will a lot of them active. I already have some ideas for reducing iterations but before I begin I wondered if maybe I could benefit from using the 2dphysics engine even If don't use physics. Maybe set them to static physics objects.

There are some interesting commands like getFirstcontact which could be great for collision lists....


Is there any benefit?

I never want what I know.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 6th May 2013 17:01
its just check if the shapes overlaps,
i don't think that it is faster or slower.
i know that the physic engine let sprites goto sleep if they don't move for optimization and awake if they interact.

there is another good command GetSpriteFirstContact( iSprite1 )
you get only a collision list for this sprite like the playing piece.
Timshark
16
Years of Service
User Offline
Joined: 30th Jun 2007
Location: Oslo, Norway
Posted: 6th May 2013 21:37
But GetSpriteFirstContact() only works on sprites set up for physics, right? These firstContact commands looks really tempting.

I think I want som form of virtual dynamic list. I've checked out hodgey's hash table code -

http://forum.thegamecreators.com/?m=forum_view&t=204334&b=41

maybe a combination of this and the firstcontanct commands....

I never want what I know.

Login to post a reply

Server time is: 2024-05-03 19:25:10
Your offset time is: 2024-05-03 19:25:10