JackStone Posted March 26, 2016 Share Posted March 26, 2016 Apologies for the slightly cryptic subject.I am relatively familiar with the intricacies of T3D's collision system, but, unless I am missing something, I can't seem to find an easy way to solve my problem.I am placing objects (Tsstatics and items) in a procedurally generated level. I would like to check to make sure that two objects don't collide with each other, ie, that one objects bounds doesn't intersect anothers. I cannot find a way to do this.I am looking for something like "if %obj.intersects(%obj2)". This doesn't seem to be available. Conventional collision works fine, ie, my player cant walk through walls, etc, but when I am placing the object with settransform() I need to know if they intersect with an already placed object. Could something like this be easily added?Thanks! Quote Link to comment Share on other sites More sharing options...
rlranft Posted March 26, 2016 Share Posted March 26, 2016 You could do a container search, using the center and "radius" of the object to look for all objects in that sphere. See game/scripts/server/radiusDamage.cs radiusDamage(). Basically, if you find anything in that search then there is a "collision." Quote Link to comment Share on other sites More sharing options...
JackStone Posted March 27, 2016 Author Share Posted March 27, 2016 You could do a container search, using the center and "radius" of the object to look for all objects in that sphere. See game/scripts/server/radiusDamage.cs radiusDamage(). Basically, if you find anything in that search then there is a "collision." That's a great idea actually,it's much simpler than what I was trying to do!I was trying to rewrite the isoverlapping() function from mBox.h into script, and it didn't seem to be working. Container radius search is a much better idea, thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.