trueaxis.com Forum Index trueaxis.com
True Axis Physics SDK Forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

triggering a function during a collision

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    trueaxis.com Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
Erkokite
Guest





PostPosted: Mon Apr 25, 2005 2:27 pm    Post subject: triggering a function during a collision Reply with quote

Is there a way to trigger a user-defined function whenever an object collides with another? For example, in my game engine, each entity class has an OnCollision() function. It would need to be triggered whenever the entity's associated collision object collides with another.
Back to top
erkokite
Guest





PostPosted: Mon Apr 25, 2005 2:36 pm    Post subject: Reply with quote

PS, the object will usually not be a ghost.
Back to top
kurtz



Joined: 02 Apr 2005
Posts: 56

PostPosted: Tue Apr 26, 2005 2:49 am    Post subject: Reply with quote

For each dynamic object, you can obtain a collision iterator after each update that will give you all the collisions for that object during the last update. You can then look through all of the collisions and trigger the appropriate functions accordingly. Hope that helps.
Back to top
View user's profile Send private message
luke
Site Admin


Joined: 15 Oct 2004
Posts: 621

PostPosted: Tue Apr 26, 2005 1:01 pm    Post subject: Reply with quote

There have also been some new call back functions added in version 1.0.0.3 to TA::Physics. SetPreProcessCollisionCallBack and SetPostProcessCollisionCallBack. These can also be used.
Back to top
View user's profile Send private message Send e-mail
Erkokite
Guest





PostPosted: Tue Apr 26, 2005 4:28 pm    Post subject: Reply with quote

Excellent, thanks.
Back to top
benjamin
Guest





PostPosted: Wed Apr 27, 2005 6:26 am    Post subject: Reply with quote

What exactly are the semantics of thise collision callback functions?
are they called for each collision event separately or will they be called when all collisions for a physicobject are calculated?
Back to top
luke
Site Admin


Joined: 15 Oct 2004
Posts: 621

PostPosted: Wed Apr 27, 2005 10:12 pm    Post subject: Reply with quote

These functions are called for each individual collision.

If there are multiple collisions between 2 objects, the functions will get called multiple times, once for each collision between the 2 objects.
Back to top
View user's profile Send private message Send e-mail
benjamin
Guest





PostPosted: Thu Apr 28, 2005 6:39 am    Post subject: Reply with quote

Cool, thanks a lot
Back to top
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    trueaxis.com Forum Index -> General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group