コード例 #1
0
    public void netRot(Quaternion r)
    {
        NetQuaternion rotUpdate = new NetQuaternion();

        rotUpdate.value = r;
        nm.nc.Send(900, rotUpdate);
    }
コード例 #2
0
    public void netArmRot(Quaternion r)
    {
        NetQuaternion armRotUpdate = new NetQuaternion();

        armRotUpdate.value = r;
        nm.nc.Send(907, armRotUpdate);
    }
コード例 #3
0
ファイル: LeapHandData.cs プロジェクト: wsycarlos/OrionServer
 public static void Write(BinaryWriter w, NetQuaternion v)
 {
     w.Write(v.x);
     w.Write(v.y);
     w.Write(v.z);
     w.Write(v.w);
 }
コード例 #4
0
ファイル: Firebolt.cs プロジェクト: ajmed/blink
    public override void DoAbility(HeroManager hero)
    {
        Vector3       center            = hero.characterController.bounds.center;
        Vector3       start             = center + hero.transform.forward.normalized * 0.5f;
        NetVector3    netStart          = new NetVector3(start);
        NetQuaternion quaternion        = new NetQuaternion(Quaternion.identity);
        string        spawnableResource = "Firebolt";

        hero.heroCombat.CmdSpawnHomingAbility(netStart, quaternion, spawnableResource, hero.gameObject, hero.heroCombat.target.gameObject);
    }
コード例 #5
0
ファイル: LeapHandData.cs プロジェクト: wsycarlos/OrionServer
    public static NetQuaternion Read(BinaryReader r)
    {
        NetQuaternion v = new NetQuaternion();

        v.x = r.ReadSingle();
        v.y = r.ReadSingle();
        v.z = r.ReadSingle();
        v.w = r.ReadSingle();
        return(v);
    }
コード例 #6
0
    public void CmdSpawnHomingAbility(NetVector3 vector, NetQuaternion quaternion, string spawnableResource, GameObject self, GameObject target)
    {
        GameObject firebolt = (GameObject)GameObject.Instantiate(Resources.Load(spawnableResource));
        Ability    ability;

        AbilityMap.masterAbilityMap.TryGetValue(spawnableResource, out ability);
        HomingAbility homingAbility = firebolt.GetComponent <HomingAbility>();

        homingAbility.Initialize(vector.vector, quaternion.quaternion, ability, self.GetComponent <HeroManager>(), target.GetComponent <HeroManager>());
        NetworkServer.Spawn(firebolt);
    }
コード例 #7
0
ファイル: ModelsUtil.cs プロジェクト: IfURunWithMe/Poc
    public static NetQuaternion ToNet(this Quaternion qua)
    {
        NetQuaternion q = new NetQuaternion()
        {
            x = qua.x,
            y = qua.y,
            z = qua.z,
            w = qua.w
        };

        return(q);
    }
コード例 #8
0
    void OnPlayerArmRot(NetworkMessage netMsg)
    {
        NetQuaternion    netArmRot = netMsg.ReadMessage <NetQuaternion>();
        PlayerQuaternion armRot    = new PlayerQuaternion();

        armRot.id         = netMsg.conn.connectionId;
        armRot.quaternion = netArmRot.value;
        sendToAllExcept(netMsg.conn.connectionId, 917, armRot);

        /*foreach(User u in ConnectedUsers.FindAll(x => x.id != netMsg.conn.connectionId)){
         *              NetworkServer.SendToClient(u.id,910,playerRot);
         *      }*/
    }
コード例 #9
0
    void OnPlayerRotationChange(NetworkMessage netMsg)
    {
        NetQuaternion    rotUpdate = netMsg.ReadMessage <NetQuaternion>();
        PlayerQuaternion playerRot = new PlayerQuaternion();

        playerRot.id         = netMsg.conn.connectionId;
        playerRot.quaternion = rotUpdate.value;
        sendToAllExcept(netMsg.conn.connectionId, 910, playerRot);

        /*foreach(User u in ConnectedUsers.FindAll(x => x.id != netMsg.conn.connectionId)){
         *              NetworkServer.SendToClient(u.id,910,playerRot);
         *      }*/
        ConnectedUsers.Find(x => x.id == netMsg.conn.connectionId).rotation = rotUpdate.value;
    }
コード例 #10
0
ファイル: LeapHandData.cs プロジェクト: wsycarlos/OrionServer
 public static void Write(BinaryWriter w, NetHand h)
 {
     if (h.Fingers == null || h.Fingers.Count == 0)
     {
         w.Write(0);
     }
     else
     {
         w.Write(h.Fingers.Count);
         foreach (NetFinger f in h.Fingers)
         {
             NetFinger.Write(w, f);
         }
     }
     w.Write(h.IsLeft);
     NetVector.Write(w, h.PalmPosition);
     NetVector.Write(w, h.PalmNormal);
     NetQuaternion.Write(w, h.Rotation);
     NetVector.Write(w, h.XBasis);
 }
コード例 #11
0
ファイル: LeapHandData.cs プロジェクト: wsycarlos/OrionServer
    public static NetHand Read(BinaryReader r)
    {
        NetHand h     = new NetHand();
        int     count = r.ReadInt32();

        h.Fingers = new List <NetFinger>();
        if (count > 0)
        {
            for (int i = 0; i < count; i++)
            {
                NetFinger f = NetFinger.Read(r);
                h.Fingers.Add(f);
            }
        }
        h.IsLeft       = r.ReadBoolean();
        h.PalmPosition = NetVector.Read(r);
        h.PalmNormal   = NetVector.Read(r);
        h.Rotation     = NetQuaternion.Read(r);
        h.XBasis       = NetVector.Read(r);

        return(h);
    }
コード例 #12
0
ファイル: ModelsUtil.cs プロジェクト: IfURunWithMe/Poc
    public static Quaternion ToUnity(this NetQuaternion qua)
    {
        Quaternion q = new Quaternion(qua.x, qua.y, qua.z, qua.w);

        return(q);
    }