|
|
|
|
|
|
|
|
|
|
var mat = probe.localToWorld; |
|
|
|
|
|
|
|
Vector3 vx = mat.GetColumn(0); |
|
|
|
Vector3 vy = mat.GetColumn(1); |
|
|
|
Vector3 vz = mat.GetColumn(2); |
|
|
|
Vector3 vw = mat.GetColumn(3); |
|
|
|
vx.Normalize(); // Scale shouldn't affect the probe or its bounds
|
|
|
|
vy.Normalize(); |
|
|
|
vz.Normalize(); |
|
|
|
|
|
|
|
//Vector3 C = bnds.center; // P + boxOffset;
|
|
|
|
var C = mat.MultiplyPoint(boxOffset); // same as commented out line above when rot is identity
|
|
|
|
var C = vx * boxOffset.x + vy * boxOffset.y + vz * boxOffset.z + vw; |
|
|
|
|
|
|
|
Vector3 vx = mat.GetColumn(0); |
|
|
|
Vector3 vy = mat.GetColumn(1); |
|
|
|
Vector3 vz = mat.GetColumn(2); |
|
|
|
|
|
|
|
// transform to camera space (becomes a left hand coordinate frame in Unity since Determinant(worldToView)<0)
|
|
|
|
vx = worldToView.MultiplyVector(vx); |
|
|
|