Example #1
0
 protected abstract bool ShapeQueryCircle(
     TSVector2 bodySpaceOrigin,
     FP radius);
Example #2
0
 protected override void ApplyBodyPosition()
 {
     this.worldSpaceOrigin =
         this.Body.BodyToWorldPointCurrent(this.bodySpaceOrigin);
     this.worldSpaceAABB = new VoltAABB(this.worldSpaceOrigin, this.radius);
 }
 internal TSVector2 WorldToBodyPoint(TSVector2 vector)
 {
     return(VoltMath.WorldToBodyPoint(this.position, this.facing, vector));
 }
Example #4
0
 protected abstract bool ShapeQueryPoint(
     TSVector2 bodySpacePoint);
Example #5
0
 public VoltAABB ComputeTopRight(TSVector2 center)
 {
     return(new VoltAABB(this.top, center.y, center.x, this.right));
 }
Example #6
0
 public VoltAABB ComputeBottomRight(TSVector2 center)
 {
     return(new VoltAABB(center.y, this.bottom, center.x, this.right));
 }
Example #7
0
 public static TSVector2 Right(this TSVector2 v)
 {
     return(new TSVector2(v.y, -v.x));
 }
Example #8
0
 public VoltAABB(TSVector2 center, FP radius)
     : this(center, new TSVector2(radius, radius))
 {
 }
Example #9
0
 public static TSVector2 WorldToBodyDirection(
     TSVector2 bodyFacing,
     TSVector2 vector)
 {
     return(vector.InvRotate(bodyFacing));
 }
Example #10
0
 public static TSVector2 BodyToWorldDirection(
     TSVector2 bodyFacing,
     TSVector2 vector)
 {
     return(vector.Rotate(bodyFacing));
 }
 internal TSVector2 BodyToWorldDirection(TSVector2 vector)
 {
     return(VoltMath.BodyToWorldDirection(this.facing, vector));
 }
 internal TSVector2 BodyToWorldPoint(TSVector2 vector)
 {
     return(VoltMath.BodyToWorldPoint(this.position, this.facing, vector));
 }
 internal TSVector2 WorldToBodyDirection(TSVector2 vector)
 {
     return(VoltMath.WorldToBodyDirection(this.facing, vector));
 }
Example #14
0
 internal Axis(TSVector2 normal, FP width)
 {
     this.normal = normal;
     this.width  = width;
 }
Example #15
0
 public static TSVector2 Left(this TSVector2 v)
 {
     return(new TSVector2(-v.y, v.x));
 }
Example #16
0
 public void QueryPoint(
     TSVector2 point,
     VoltBuffer <VoltBody> outBuffer)
 {
     outBuffer.Add(this.bodies, this.count);
 }
Example #17
0
 public static TSVector2 InvRotate(this TSVector2 v, TSVector2 b)
 {
     return(new TSVector2(v.x * b.x + v.y * b.y, v.y * b.x - v.x * b.y));
 }
Example #18
0
 public VoltAABB ComputeTopLeft(TSVector2 center)
 {
     return(new VoltAABB(this.top, center.y, this.left, center.x));
 }
Example #19
0
 public static FP Angle(this TSVector2 v)
 {
     return(TSMath.Atan2(v.y, v.x));
 }
Example #20
0
 public VoltAABB ComputeBottomLeft(TSVector2 center)
 {
     return(new VoltAABB(center.y, this.bottom, this.left, center.x));
 }
Example #21
0
 public static FP Cross(TSVector2 a, TSVector2 b)
 {
     return(a.x * b.y - a.y * b.x);
 }
 internal void SetContained(VoltShape shape)
 {
     this.shape    = shape;
     this.distance = 0.0f;
     this.normal   = TSVector2.zero;
 }
 internal void Store(ref HistoryRecord other)
 {
     this.aabb     = other.aabb;
     this.position = other.position;
     this.facing   = other.facing;
 }