Exemplo n.º 1
0
 public AxisAlignedBox3f(Vector3F vCenter)
 {
     Min = Max = vCenter;
 }
Exemplo n.º 2
0
 public Frame3f Translated(Vector3F v)
 {
     return(new Frame3f(this.origin + v, this.rotation));
 }
Exemplo n.º 3
0
 public AxisAlignedBox3f(float fWidth, float fHeight, float fDepth)
 {
     Min = new Vector3F(0, 0, 0);
     Max = new Vector3F(fWidth, fHeight, fDepth);
 }
Exemplo n.º 4
0
 public AxisAlignedBox3f(Vector3F vCenter, float fHalfWidth, float fHalfHeight, float fHalfDepth)
 {
     Min = new Vector3F(vCenter.x - fHalfWidth, vCenter.y - fHalfHeight, vCenter.z - fHalfDepth);
     Max = new Vector3F(vCenter.x + fHalfWidth, vCenter.y + fHalfHeight, vCenter.z + fHalfDepth);
 }
Exemplo n.º 5
0
 public float Distance(Vector3F v)
 {
     return((float)Math.Sqrt(DistanceSquared(v)));
 }
Exemplo n.º 6
0
 //! relative translation
 public void Translate(Vector3F vTranslate)
 {
     Min.Add(vTranslate);
     Max.Add(vTranslate);
 }
Exemplo n.º 7
0
 public float DistanceToPlaneSigned(Vector3F p, int nNormal)
 {
     return((p - origin).Dot(GetAxis(nNormal)));
 }
Exemplo n.º 8
0
 public AxisAlignedBox3f(bool bIgnore)
 {
     Min = new Vector3F(float.MaxValue, float.MaxValue, float.MaxValue);
     Max = new Vector3F(float.MinValue, float.MinValue, float.MinValue);
 }
Exemplo n.º 9
0
 public Frame3f Scaled(Vector3F scale)
 {
     return(new Frame3f(scale * this.origin, this.rotation));
 }
Exemplo n.º 10
0
 public float DistanceToPlane(Vector3F p, int nNormal)
 {
     return(Math.Abs((p - origin).Dot(GetAxis(nNormal))));
 }
Exemplo n.º 11
0
 public void Scale(Vector3F scale)
 {
     origin *= scale;
 }
Exemplo n.º 12
0
 public void Scale(float f)
 {
     origin *= f;
 }
Exemplo n.º 13
0
 public Frame3f(Frame3f copy)
 {
     this.rotation = copy.rotation;
     this.origin   = copy.origin;
 }
Exemplo n.º 14
0
 public static Frame3f Interpolate(Frame3f f1, Frame3f f2, float alpha)
 {
     return(new Frame3f(
                Vector3F.Lerp(f1.origin, f2.origin, alpha),
                Quaternionf.Slerp(f1.rotation, f2.rotation, alpha)));
 }
Exemplo n.º 15
0
 public Frame3f(Vector3D origin)
 {
     rotation    = Quaternionf.Identity;
     this.origin = (Vector3F)origin;
 }
Exemplo n.º 16
0
 public Frame3f(Vector3F origin, Quaternionf orientation)
 {
     rotation    = orientation;
     this.origin = origin;
 }
Exemplo n.º 17
0
 ///<summary> Map point *into* local coordinates of Frame </summary>
 public Vector3F ToFrameP(Vector3F v)
 {
     v = v - this.origin;
     v = Quaternionf.Inverse(this.rotation) * v;
     return(v);
 }
Exemplo n.º 18
0
 public bool Contains(Vector3F v)
 {
     return((Min.x <= v.x) && (Min.y <= v.y) && (Min.z <= v.z) &&
            (Max.x >= v.x) && (Max.y >= v.y) && (Max.z >= v.z));
 }
Exemplo n.º 19
0
 /// <summary> Map point *from* local frame coordinates into "world" coordinates </summary>
 public Vector3F FromFrameP(Vector3F v)
 {
     return(this.rotation * v + this.origin);
 }
Exemplo n.º 20
0
 public AxisAlignedBox3f(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
 {
     Min = new Vector3F(xmin, ymin, zmin);
     Max = new Vector3F(xmax, ymax, zmax);
 }
Exemplo n.º 21
0
 ///<summary> Map vector *into* local coordinates of Frame </summary>
 public Vector3F ToFrameV(Vector3F v)
 {
     return(Quaternionf.Inverse(this.rotation) * v);
 }
Exemplo n.º 22
0
 public AxisAlignedBox3f(float fCubeSize)
 {
     Min = new Vector3F(0, 0, 0);
     Max = new Vector3F(fCubeSize, fCubeSize, fCubeSize);
 }
Exemplo n.º 23
0
 /// <summary> Map vector *from* local frame coordinates into "world" coordinates </summary>
 public Vector3F FromFrameV(Vector3F v)
 {
     return(this.rotation * v);
 }
Exemplo n.º 24
0
 public AxisAlignedBox3f(Vector3F vMin, Vector3F vMax)
 {
     Min = new Vector3F(Math.Min(vMin.x, vMax.x), Math.Min(vMin.y, vMax.y), Math.Min(vMin.z, vMax.z));
     Max = new Vector3F(Math.Max(vMin.x, vMax.x), Math.Max(vMin.y, vMax.y), Math.Max(vMin.z, vMax.z));
 }
Exemplo n.º 25
0
 public Frame3f(Vector3F origin, Vector3F setZ)
 {
     rotation    = Quaternionf.FromTo(Vector3F.AxisZ, setZ);
     this.origin = origin;
 }
Exemplo n.º 26
0
 public AxisAlignedBox3f(Vector3F vCenter, float fHalfSize)
 {
     Min = new Vector3F(vCenter.x - fHalfSize, vCenter.y - fHalfSize, vCenter.z - fHalfSize);
     Max = new Vector3F(vCenter.x + fHalfSize, vCenter.y + fHalfSize, vCenter.z + fHalfSize);
 }
Exemplo n.º 27
0
 public Frame3f(Vector3D origin, Vector3D setZ)
 {
     rotation    = Quaternionf.FromTo(Vector3F.AxisZ, (Vector3F)setZ);
     this.origin = (Vector3F)origin;
 }
Exemplo n.º 28
0
 public Vector3D(Vector3F copy)
 {
     x = copy.x; y = copy.y; z = copy.z;
 }
Exemplo n.º 29
0
 public void Translate(Vector3F v)
 {
     origin += v;
 }