public override void Reset()
 {
     multiplier     = 1.0f;
     mapToPlane     = AxisPlane.XZ;
     storeVector    = null;
     storeMagnitude = null;
 }
Esempio n. 2
0
        public static void BuildRectangle(
            Action <int, Vertex> vertexReceiver, Action <int, Triangle> triangleReceiver,
            Vector2 size, AxisPlane plane, bool clockwise = true)
        {
            Ensure.Argument.NotNull(vertexReceiver, nameof(vertexReceiver));
            Ensure.Argument.NotNull(triangleReceiver, nameof(triangleReceiver));

            int normalAxis = (int)plane.GetNormalAxis();
            var hs         = size / 2;

            for (int i = 0; i < 4; ++i)
            {
                float v1 = i < 2 ? -1 : 1, v2 = Index.Loop(i + 1, 4) < 2 ? -1 : 1;
                var   pos = new Vector3
                {
                    [normalAxis] = 0,
                    [Index.Loop(normalAxis + 1, 3)] = v1 * hs.x,
                    [Index.Loop(normalAxis + 2, 3)] = v2 * hs.y
                };

                float t0 = i < 2 ? 0 : 1, t1 = Index.Loop(i + 1, 4) < 2 ? 0 : 1;
                var   uv = new Vector2 {
                    [0] = t0, [1] = t1
                };

                vertexReceiver(i, new Vertex(pos, uv));
            }

            BuildRectangleTriangles(triangleReceiver, clockwise, 0, 1, 2, 3);
        }
Esempio n. 3
0
 public override void Reset()
 {
     horizontalInput = null;
     verticalInput   = null;
     multiplier      = 1.0f;
     mapToPlane      = AxisPlane.XZ;
     storeVector     = null;
     storeMagnitude  = null;
 }
		public override void Reset()
		{
			horizontalInput = null;
			verticalInput = null;
			multiplier = 1.0f;
			mapToPlane = AxisPlane.XZ;
			storeVector = null;
			storeMagnitude = null;
		}
Esempio n. 5
0
 public override void Reset () {
     horizontalAxis = new ConcreteStringVar();
     verticalAxis = new ConcreteStringVar();
     mapToPlane = AxisPlane.XZ;
     relativeTo = new ConcreteGameObjectVar(this.self);
     multiplier = 1f;
     normalize = false;
     storeInput = new ConcreteVector3Var();
 }
Esempio n. 6
0
 public override void Reset()
 {
     horizontalAxis = "Horizontal";
     verticalAxis   = "Vertical";
     multiplier     = 1.0f;
     mapToPlane     = GetAxisVector.AxisPlane.XZ;
     storeVector    = null;
     storeMagnitude = null;
 }
Esempio n. 7
0
		public override void Reset()
		{
			horizontalAxis = "Horizontal";
			verticalAxis = "Vertical";
			multiplier = 1.0f;
			mapToPlane = GetAxisVector.AxisPlane.XZ;
			storeVector = null;
			storeMagnitude = null;
		}
Esempio n. 8
0
        public static (Vertex[] vertices, Triangle[] triangles) BuildRectangle(
            Vector2 size, AxisPlane plane, bool clockwise = true)
        {
            var vertices  = new Vertex[4];
            var triangles = new Triangle[2];

            BuildRectangle(vertices, triangles, size, plane, clockwise);
            return(vertices, triangles);
        }
 public override void Reset()
 {
     deviceIndex    = 0;
     horizontalAxis = InputControlType.LeftStickLeft;
     verticalAxis   = InputControlType.LeftStickUp;
     multiplier     = 1.0f;
     mapToPlane     = AxisPlane.XZ;
     storeVector    = null;
     storeMagnitude = null;
 }
Esempio n. 10
0
 public override void Reset()
 {
     horizontalAxis = new ConcreteStringVar();
     verticalAxis   = new ConcreteStringVar();
     mapToPlane     = AxisPlane.XZ;
     relativeTo     = new ConcreteGameObjectVar(this.self);
     multiplier     = 1f;
     normalize      = false;
     storeInput     = new ConcreteVector3Var();
 }
        public override void Reset()
        {
            base.Reset();

            multiplier      = 1.0f;
            mapToPlane      = AxisPlane.XZ;
            relativeTo      = null;
            storeMagnitude  = null;
            storeMoveVector = null;
        }
Esempio n. 12
0
 public override void Reset()
 {
     horizontalAxis    = "Horizontal";
     verticalAxis      = "Vertical";
     multiplier        = 1.0f;
     mapToPlane        = AxisPlane.XZ;
     storeVector       = null;
     storeMagnitude    = null;
     storeAngle        = null;
     checkAngleIfAxis0 = true;
 }
Esempio n. 13
0
        public static Axis GetNormalAxis(this AxisPlane plane)
        {
            switch (plane)
            {
            case AxisPlane.XY: return(Axis.Z);

            case AxisPlane.YZ: return(Axis.X);

            case AxisPlane.ZX: return(Axis.Y);

            default: throw new ArgumentOutOfRangeException(nameof(plane), plane, null);
            }
        }
Esempio n. 14
0
 public override void Reset()
 {
     horizontalAxis = new FsmFloat()
     {
         UseVariable = true
     };
     verticalAxis = new FsmFloat()
     {
         UseVariable = true
     };
     multiplier     = 1.0f;
     mapToPlane     = AxisPlane.XZ;
     storeVector    = null;
     storeMagnitude = null;
 }
Esempio n. 15
0
        public static void BuildRectangle(
            IList <Vertex> vertices, int vertexStartIndex, IList <Triangle> triangles, int triangleStartIndex,
            Vector2 size, AxisPlane plane, bool clockwise = true)
        {
            Ensure.Argument.NotNull(vertices, nameof(vertices));
            if (vertices.Count < vertexStartIndex + 4)
            {
                throw new ArgumentException("Insufficient size for vertices.", nameof(vertices));
            }

            Ensure.Argument.NotNull(triangles, nameof(triangles));
            if (triangles.Count < triangleStartIndex + 2)
            {
                throw new ArgumentException("Insufficient size for triangles.", nameof(vertices));
            }

            BuildRectangle((index, vertex) => { vertices[vertexStartIndex + index] = vertex; },
                           (index, triangle) => { triangles[triangleStartIndex + index] = triangle; },
                           size, plane, clockwise);
        }
Esempio n. 16
0
 public static void BuildRectangle(
     IList <Vertex> vertices, IList <Triangle> triangles,
     Vector2 size, AxisPlane plane, bool clockwise = true)
 {
     BuildRectangle(vertices, 0, triangles, 0, size, plane, clockwise);
 }