Jump to content

Performing "Manual" collision checks in T3D


JackStone

Recommended Posts

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!

Link to comment
Share on other sites

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."

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...