ronghester
Member
|
Vehicle collision
What would be the best way to check collision of vehicle with other actors, mostly i am interested to find out when vehicle collides with something with great force. So simple collision routine check may not work i guess.
What could be the possible way, to find out when vehicle bang something (with great force).
|
|
08-24-2018 05:58 PM |
|
Esenthel
Administrator
|
RE: Vehicle collision
I think this could help:
Physics.
PhysicsClass& reportContact(Int group_a, Int group_b, Bool report=true ); // allow contact reporting between 'group_a' and 'group_b' actor group pairs (ACTOR_GROUP), this will enable calling 'ReportContact' function which can be specified in 'reportContact' method
PhysicsClass& reportContact(void (*ReportContact)(ActorInfo &actor_a, ActorInfo &actor_b, C PhysContact *contact, Int contacts)); // set custom function for reporting physical contacts, this function will be called for actor group pairs that have been enabled using the 'reportContact' method, 'ReportContact' function will be called during physical contacts between actors in physical simulation, this function will not be called if the actors aren't in contact or have their collisions disabled or are asleep, creating or deleting physical objects inside callbacks is forbidden, instead you should record information about contacts, and perform operations on them outside of the callback, 'contact'=array of contacts, 'contacts'=number of elements in 'contact' array
|
|
08-24-2018 11:38 PM |
|
ronghester
Member
|
RE: Vehicle collision
contact->force is exactly what i wanted!
Thanks a lot
|
|
08-25-2018 01:45 PM |
|