IMHOTEP Framework
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
TransformUtil.cs
1 using UnityEngine;
2 using System.Collections;
3 
4 public class TransformUtil {
5 
10  public static Bounds TransformBounds( Transform trans, Bounds localBounds )
11  {
12  Vector3 center = trans.TransformPoint (localBounds.center);
13  Vector3 extents = trans.TransformVector (localBounds.extents);
14  return new Bounds (center, extents * 2f);
15  }
20  public static Bounds InverseTransformBounds( Transform trans, Bounds worldBounds )
21  {
22  Vector3 center = trans.InverseTransformPoint (worldBounds.center);
23  Vector3 extents = trans.InverseTransformVector (worldBounds.extents);
24  return new Bounds (center, extents * 2f);
25  }
26 }
static Bounds InverseTransformBounds(Transform trans, Bounds worldBounds)
static Bounds TransformBounds(Transform trans, Bounds localBounds)