|
| 02 Apr 2015 07:02 PM |
Given a part and a lookVector, how would you find the distance from the part's position to the border of it (a point on the faces surrounding the center)?
i.e
There is a 2 x 1 x 4 part in workspace, and the given lookVector is (0, 1, 0), the distance from the center to the contact surface is V3(0, 0.5, 0).magnitude.
|
|
|
| Report Abuse |
|
|
| 02 Apr 2015 07:23 PM |
| Darn, I need to take rotation into consideration too. |
|
|
| Report Abuse |
|
|
| 02 Apr 2015 07:52 PM |
| lookVector already considers rotation. This (problem you descibed) is simple because of that. Just multiply the lookVector by half the Z size and add that to the position of the part. lookVector's direction is already rotation-affected. |
|
|
| Report Abuse |
|