public override void GetBoundingBox(ref TSMatrix orientation, out TSBBox box) { TSMatrix tSMatrix; TSMath.Absolute(ref orientation, out tSMatrix); TSVector max; TSVector.Transform(ref this.halfSize, ref tSMatrix, out max); box.max = max; TSVector.Negate(ref max, out box.min); }
public void Transform(ref TSMatrix orientation) { TSVector value = FP.Half * (this.max - this.min); TSVector value2 = FP.Half * (this.max + this.min); TSVector.Transform(ref value2, ref orientation, out value2); TSMatrix tSMatrix; TSMath.Absolute(ref orientation, out tSMatrix); TSVector.Transform(ref value, ref tSMatrix, out value); this.max = value2 + value; this.min = value2 - value; }
public override void GetBoundingBox(ref TSMatrix orientation, out TSBBox box) { box.min = this.mInternalBBox.min; box.max = this.mInternalBBox.max; TSVector tSVector = FP.Half * (box.max - box.min); TSVector tSVector2 = FP.Half * (box.max + box.min); TSVector value; TSVector.Transform(ref tSVector2, ref orientation, out value); TSMatrix tSMatrix; TSMath.Absolute(ref orientation, out tSMatrix); TSVector value2; TSVector.Transform(ref tSVector, ref tSMatrix, out value2); box.max = value + value2; box.min = value - value2; }
internal void InverseTransform(ref TSVector position, ref TSMatrix orientation) { TSVector.Subtract(ref this.max, ref position, out this.max); TSVector.Subtract(ref this.min, ref position, out this.min); TSVector tSVector; TSVector.Add(ref this.max, ref this.min, out tSVector); tSVector.x *= FP.Half; tSVector.y *= FP.Half; tSVector.z *= FP.Half; TSVector tSVector2; TSVector.Subtract(ref this.max, ref this.min, out tSVector2); tSVector2.x *= FP.Half; tSVector2.y *= FP.Half; tSVector2.z *= FP.Half; TSVector.TransposedTransform(ref tSVector, ref orientation, out tSVector); TSMatrix tSMatrix; TSMath.Absolute(ref orientation, out tSMatrix); TSVector.TransposedTransform(ref tSVector2, ref tSMatrix, out tSVector2); TSVector.Add(ref tSVector, ref tSVector2, out this.max); TSVector.Subtract(ref tSVector, ref tSVector2, out this.min); }