Ejemplo n.º 1
0
        public void CalculateWeeniePosition(ChessPieceCoord coord, ChessColor color, AFrame frame)
        {
            var heading = (uint)ChessBoard.PhysicsObj.Position.Frame.get_heading();

            heading += color == ChessColor.Black ? 180u : 0u;
            heading %= 360;

            frame.Origin += new Vector3(coord.X - 3.5f, coord.Y - 3.5f, 0.0f);
            frame.set_heading(heading);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Aligns an object to a plane
        /// </summary>
        public static AFrame ObjAlign(DatLoader.Entity.ObjectDesc obj, Plane plane, Vector3 loc)
        {
            var frame = new AFrame(obj.BaseLoc);

            frame.Origin = loc;
            var negNormal = -plane.Normal;
            var degrees   = negNormal.get_heading();

            frame.set_heading(degrees);
            return(frame);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Returns the rotation for a scenery object
        /// </summary>
        public static AFrame RotateObj(DatLoader.Entity.ObjectDesc obj, uint x, uint y, uint k, Vector3 loc)
        {
            var frame = new AFrame(obj.BaseLoc);

            frame.Origin = loc;
            if (obj.MaxRotation > 0.0f)
            {
                var degrees = (float)((1813693831 * y - (k + 63127) * (1360117743 * y * x + 1888038839) - 1109124029 * x) * 2.3283064e-10 * obj.MaxRotation);
                frame.set_heading(degrees);
            }
            return(frame);
        }