private void CornerPushTest(Unit target, bool moveGuarded) { var hitDef = GetHitDefData(); if (target is Character && target.GetBackStageDist() < new Number(5) / new Number(10)) { Number velX = 0; if (moveGuarded) { velX = hitDef.guardVel.X(); } else if (target.GetPhysicsType() == PhysicsType.A) { velX = hitDef.airVel.X(); } else { velX = hitDef.groundVel.X(); } if (this.GetPhysicsType() == PhysicsType.A) { this.moveCtr.VelAdd(-Number.Abs(velX) * hitDef.airCornerPush, 0); } else { this.moveCtr.VelAdd(-Number.Abs(velX) * hitDef.groundCornerPush, 0); } } }
public object ReadYaml(Core.IParser parser, System.Type type) { var value = ((Core.Events.Scalar)parser.Current).Value; parser.MoveNext(); if (value.Contains(".")) { int n = value.Length - value.IndexOf(".") - 1; Mugen3D.Core.Number result = int.Parse(value.Replace(".", "")); for (int i = 0; i < n; i++) { result = result / 10; } return(result); } return((Mugen3D.Core.Number) int.Parse(value)); }
public static bool RectColliderIntersectTest(Collider c1, Collider c2, out ContactInfo contactInfo) { var rc1 = c1 as RectCollider; var rc2 = c2 as RectCollider; contactInfo = null; bool intersect = !((rc1.xMin > rc2.xMax || rc2.xMin > rc1.xMax) || (rc1.yMin > rc2.yMax || rc2.yMin > rc1.yMax)); if (intersect) { Vector dir = new Vector(rc1.position.x > rc2.position.x ? 1 : -1, 0, 0); Number depth = (rc1.width + rc2.width) / 2 - Math.Abs(rc1.position.x - rc2.position.x); contactInfo = new ContactInfo() { recoverDir = dir, depth = depth }; return(true); } return(intersect); }
public void PosSet(Number x, Number y, Number z) { m_position.x = x; m_position.y = y; m_position.z = z; }
public void SetGravity(Number x, Number y) { m_gravity = new Vector(x, y, 0); }
public void VelAdd(Number deltaX, Number deltaY) { this.m_velocity.x += deltaX * owner.GetFacing(); this.m_velocity.y += deltaY; }
public void VelSet(Number velx, Number vely) { this.m_velocity = new Vector(velx * owner.GetFacing(), vely, 0); }
public void PosAdd(Number deltaX, Number deltaY, Number deltaZ) { m_position.x += deltaX; m_position.y += deltaY; m_position.z += deltaZ; }
public Rect(Rect rect) { this.position = rect.position; this.width = rect.width; this.height = rect.height; }
public Rect(Vector p1, Vector p2) { this.position = (p1 + p2) / 2; this.width = p2.x - p1.x; this.height = p2.y - p1.y; }
public Rect(Vector p, Number width, Number height) { this.position = p; this.width = width; this.height = height; }
public Rect() { this.position = Vector.zero; this.width = Number.Zero; this.height = Number.Zero; }