示例#1
0
 public override void UpdateCamera(int diffX, int diffY)
 {
     m_camera.Hor  = IPCUtils.ReadFloat(m_ipc, m_addressHor);
     m_camera.Vert = IPCUtils.ReadFloat(m_ipc, m_addressVert);
     m_camera.Update(-diffX * SensModifier, diffY * SensModifier);
     IPCUtils.WriteFloat(m_ipc, m_addressHor, m_camera.Hor);
     IPCUtils.WriteFloat(m_ipc, m_addressVert, m_camera.Vert);
 }
示例#2
0
 public override void UpdateCamera(int diffX, int diffY)
 {
     m_camera.X = IPCUtils.ReadFloat(m_ipc, m_address);
     m_camera.Y = IPCUtils.ReadFloat(m_ipc, m_address + 4);
     m_camera.Z = IPCUtils.ReadFloat(m_ipc, m_address + 8);
     m_camera.Update(diffX * SensModifier, -diffY * SensModifier);
     IPCUtils.WriteFloat(m_ipc, m_address, m_camera.X);
     IPCUtils.WriteFloat(m_ipc, m_address + 4, m_camera.Y);
     IPCUtils.WriteFloat(m_ipc, m_address + 8, m_camera.Z);
 }
示例#3
0
 public override void UpdateCamera(int diffX, int diffY)
 {
     if (DerefChain.VerifyChains(m_hor, m_vert))
     {
         m_camera.HorY = IPCUtils.ReadFloat(m_ipc, (uint)m_hor.Value);
         m_camera.HorX = IPCUtils.ReadFloat(m_ipc, (uint)(m_hor.Value + 4));
         m_camera.Vert = IPCUtils.ReadFloat(m_ipc, (uint)m_vert.Value);
         m_camera.Update(diffX * SensModifier, -diffY * SensModifier);
         IPCUtils.WriteFloat(m_ipc, (uint)m_hor.Value, m_camera.HorY);
         IPCUtils.WriteFloat(m_ipc, (uint)(m_hor.Value + 4), m_camera.HorX);
         IPCUtils.WriteFloat(m_ipc, (uint)m_vert.Value, m_camera.Vert);
     }
 }
示例#4
0
 public override void UpdateCamera(int diffX, int diffY)
 {
     if (IPCUtils.ReadU32(m_ipc, 0x13DD584) > 0) // MP player 1 initialized or something
     {
         m_addressHor  = 0x13DE760;
         m_addressVert = 0x13DE780;
     }
     else
     {
         m_addressHor  = 0xDA3D70;
         m_addressVert = 0xDA3D90;
     }
     base.UpdateCamera(diffX, diffY);
 }
示例#5
0
 public override void UpdateCamera(int diffX, int diffY)
 {
     if (IPCUtils.ReadU32(m_ipc, 0x348410) != 0) // Some MP thing idk
     {
         m_addressHor  = 0x349450;
         m_addressVert = 0x349470;
     }
     else
     {
         m_addressHor  = 0x36A910;
         m_addressVert = 0x36A930;
     }
     base.UpdateCamera(diffX, diffY);
 }
示例#6
0
        public override void UpdateCamera(int diffX, int diffY)
        {
            if (DerefChain.VerifyChains(m_hor, m_vert))
            {
                // the values are in degrees, so they need a deg -> rad conversion
                m_camera.Hor  = (float)(IPCUtils.ReadFloat(m_ipc, (uint)m_hor.Value) * (Math.PI / 180));
                m_camera.Vert = (float)(IPCUtils.ReadFloat(m_ipc, (uint)m_vert.Value) * (Math.PI / 180));

                // the vertical value needs to be clamped, these values seemed reasonable
                m_camera.Update(-diffX * SensModifier, diffY * SensModifier);
                m_camera.Vert = (float)Math.Clamp(m_camera.Vert, -60f * (Math.PI / 180), 75f * (Math.PI / 180));

                // the new values are in radians, so they need a rad -> deg conversion
                IPCUtils.WriteFloat(m_ipc, (uint)m_hor.Value, (float)(m_camera.Hor * (180 / Math.PI)));
                IPCUtils.WriteFloat(m_ipc, (uint)m_vert.Value, (float)(m_camera.Vert * (180 / Math.PI)));
            }
        }
示例#7
0
        private bool RecalculateInternal(int numSkipChains)
        {
            if (numSkipChains < 1)
            {
                Value = m_parent != null?IPCUtils.ReadU32(m_ipc, (uint)m_parent.Value) + m_offset : m_offset;

                if (PCSX2IPC.GetError(m_ipc) != PCSX2IPC.IPCStatus.Success)
                {
                    return(false);
                }
            }
            foreach (var child in m_children.Values)
            {
                if (!child.RecalculateInternal(numSkipChains > 0 ? numSkipChains - 1 : 0))
                {
                    return(false);
                }
            }
            return(true);
        }
示例#8
0
        public override void UpdateCamera(int diffX, int diffY)
        {
            // this would also be the place to alter the selection angle
            // in the weapon wheel. the selection angle is represented
            // as a regular degree angle, between 0 and 360, default is 90.

            // the object holding it is dynamically allocated. the weapon
            // wheel show/hide state can be determined from two addresses,
            // offsetted by -0x200 or -0x320 to the angle value respectively.
            // one of them will be -1, the other will be 1, when it's shown.

            // it would be strongly preferred, if this would only be put in
            // after a "selection wheel" facility is added to KAMI, to allow
            // proper reuse with other wheel-like menus in other games.

            // important to note, that none of the aforementioned values
            // ended up being writeable, unfortunately.

            // force-disable hor. and vert. auto-centering (game setting)
            // this is required, and it also makes for a better experience
            IPCUtils.WriteFloat(m_ipc, m_auto_center_addr + 0x0, 0x0);
            IPCUtils.WriteFloat(m_ipc, m_auto_center_addr + 0xC, 0x0);

            // read current 3D camera vector values
            m_camera.X = IPCUtils.ReadFloat(m_ipc, m_camera_addr + 0x0);
            m_camera.Y = IPCUtils.ReadFloat(m_ipc, m_camera_addr + 0x4);
            m_camera.Z = IPCUtils.ReadFloat(m_ipc, m_camera_addr + 0x8);

            // recalc the values
            m_camera.Update(diffX * SensModifier, -diffY * SensModifier);

            // write new 3D camera vector values back
            IPCUtils.WriteFloat(m_ipc, m_camera_addr + 0x0, m_camera.X);
            IPCUtils.WriteFloat(m_ipc, m_camera_addr + 0x4, m_camera.Y);
            IPCUtils.WriteFloat(m_ipc, m_camera_addr + 0x8, m_camera.Z);
        }
示例#9
0
        private bool VerifyInternal()
        {
            long actual = m_parent != null?IPCUtils.ReadU32(m_ipc, (uint)m_parent.Value) + m_offset : m_offset;

            return(actual == Value);
        }