예제 #1
0
        public WRot QuantizeOrientation(Actor self, WRot orientation)
        {
            // Map yaw to the closest facing
            var numDirs = Info.QuantizedFacings == -1 ? anim.CurrentSequence.Facings : Info.QuantizedFacings;
            var facing  = Util.QuantizeFacing(orientation.Yaw.Angle / 4, numDirs) * (256 / numDirs);

            // Roll and pitch are always zero
            return(new WRot(WAngle.Zero, WAngle.Zero, WAngle.FromFacing(facing)));
        }
예제 #2
0
        public WRot QuantizeOrientation(WRot orientation, int facings)
        {
            // Quantization disabled
            if (facings == 0)
            {
                return(orientation);
            }

            // Map yaw to the closest facing
            var facing = Util.QuantizeFacing(orientation.Yaw.Angle / 4, facings) * (256 / facings);

            // Roll and pitch are always zero if yaw is quantized
            return(new WRot(WAngle.Zero, WAngle.Zero, WAngle.FromFacing(facing)));
        }