generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Part intersections

Previous Thread :: Next Thread 
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
02 Apr 2015 09:27 PM
If I have two parts, at two different rotations and two different sizes, how would I check if any area of the first part is within the second? Basically, how would I check if the two parts touch each other at any place (like if a corner from the first part protrudes into the second, how would I make a function that returns true)?
Report Abuse
DonFeskeral is not online. DonFeskeral
Joined: 05 Feb 2014
Total Posts: 6555
02 Apr 2015 09:28 PM
bump for curiosity
Report Abuse
DrMathematica is not online. DrMathematica
Joined: 29 Aug 2008
Total Posts: 27268
02 Apr 2015 09:30 PM
Now this one is fun, because most people would do "point checking" which is easy, but won't tell you if any part of each part is colliding. The best way I've ever been presented has been a matrix box-collision algorithm by Axis Angles:

http://hastebin.com/zidawuzuli.lua
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
02 Apr 2015 09:37 PM
Do you think Roblox uses something like this for Region3s (I mean, I would guess not, but I could be wrong)? The :FindPartsInRegion3() method of workspace will get parts that have some cross-section with the region, so I was wondering.
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
02 Apr 2015 09:52 PM
@DrMathematica

*goes to link*
*starts to read comments*
'Don't even try to read it'
*tries to read it*
internal monologue: 'Hey, this isn't that bad..'
*scrolls down*
Report Abuse
DrMathematica is not online. DrMathematica
Joined: 29 Aug 2008
Total Posts: 27268
02 Apr 2015 09:53 PM
You know, I would honestly go out and say they use a 2-step 2D collision method. Where they measure the 2D intersection on the XY axis, and then the YZ axis.

For instance, imagine visualizing them from two sides of the Region3. You can test one side, and if it's inside the Region3, then move on to the next side to find out if it really is inside of it.
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
02 Apr 2015 09:58 PM
Also, I've done that before, with a similar setup, but about 5 billion times less intricate, so mine isn't effective at all for that purpose, but I wasn't using it to detect intersections I was using it as a tool to build maps and buildings by script, with each part having key points mapped out so I can do clean positioning and rotation around any of these points without having to guess and check.
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
02 Apr 2015 11:08 PM
i give up
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image