MTD and collision response

This topic is 2953 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

hello, I have successfully implemented SAT purely for the use of detecting collisions, however know i want to resolve them and i would like as much information as possible, firstly how to calculate the MTD and how to use it. My confusion probably comes from me thinking to far ahead but let me summarise it

-To which body to i apply the MTD to stop collision? or do i half it and apply to both?
-What if i dont want one of the things to translate i.e. infinite mass? i havent coded in mass and such yet but that will be the next step
-what collision response methods should i use? i like the sound of impulse method as it allows for objects at rest

also im having a bit of trouble getting the mtd as it stand here is the code

	if( minThisPoly > maxOtherPoly || maxThisPoly < minOtherPoly )	{		return YES;	//smallest amounts of test possible to see if the projected points along current axes are not overlapping	}	float mtd = (maxThisPoly < maxOtherPoly) ? (minOtherPoly - maxThisPoly) : (maxOtherPoly - minThisPoly);		if(mtd < [CInfo MTD])[CInfo setMTD:mtd];return NO;

its in objective C but the syntax shouldn't confuse you too much. my problem is i've seen you have to use square distances and such and stuff so i do not know how to proceed exactly, i project along an axis which is of unit length
any help or sources or tutorials are greatly appreciated

cheers

Share on other sites
Okay i have just realised one of my blunders, that the MTD should be a vector not a scalar value like im using now...oppsie, and as far as i can tell you apply the mTD to both objects

1. 1
2. 2
3. 3
Rutin
19
4. 4
5. 5
JoeJ
12

• 14
• 22
• 9
• 31
• 17
• Forum Statistics

• Total Topics
632617
• Total Posts
3007470
• Who's Online (See full list)

There are no registered users currently online

×