zoukankan      html  css  js  c++  java
  • 桁架系统控制

    桁架系统模拟

    //键盘控制
    void ControllerObjectByKeyBoard()
    {
        if (Input.GetKey(KeyCode.LeftShift) && Input.GetKey(KeyCode.W))
        {
            // 获取Player变量指定的对象的三围坐标
            Vector3 arm_postion = armRootTransform.position;
            // 获取X,Y,Z值
            float x = arm_postion.x;
            float y = arm_postion.y;
            float z = arm_postion.z;
    
            //armObject.transform.Translate();
            armRootTransform.position = arm_postion + new Vector3(0, 0, 0.01f);
        }
    
        if (Input.GetKey(KeyCode.LeftShift) && Input.GetKey(KeyCode.S))
        {
            // 获取Player变量指定的对象的三围坐标
            Vector3 arm_postion = armRootTransform.position;
            // 获取X,Y,Z值
            float x = arm_postion.x;
            float y = arm_postion.y;
            float z = arm_postion.z;
    
            //armObject.transform.Translate();
            armRootTransform.position = arm_postion + new Vector3(0, 0, -0.01f);
        }
    
    
        if (Input.GetKey(KeyCode.LeftShift) && Input.GetKey(KeyCode.A))
        {
            // 获取Player变量指定的对象的三围坐标
            Vector3 arm_postion = hookRootTransform.position;
            // 获取X,Y,Z值
            float x = arm_postion.x;
            float y = arm_postion.y;
            float z = arm_postion.z;
    
            //armObject.transform.Translate();
            hookRootTransform.position = arm_postion + new Vector3(0.01f,0, 0);
        }
    
        if (Input.GetKey(KeyCode.LeftShift) && Input.GetKey(KeyCode.F))
        {
            // 获取Player变量指定的对象的三围坐标
            Vector3 arm_postion = hookRootTransform.position;
            // 获取X,Y,Z值
            float x = arm_postion.x;
            float y = arm_postion.y;
            float z = arm_postion.z;
    
            //armObject.transform.Translate();
            hookRootTransform.position = arm_postion + new Vector3(-0.01f,0, 0);
        }
    
        if (Input.GetKey(KeyCode.LeftShift) && Input.GetKey(KeyCode.G))
        {
            // 获取Player变量指定的对象的三围坐标
            Vector3 arm_postion = hookRootTransform.position;
            // 获取X,Y,Z值
            float x = arm_postion.x;
            float y = arm_postion.y;
            float z = arm_postion.z;
    
            //armObject.transform.Translate();
            hookRootTransform.position = arm_postion + new Vector3(0, 0.01f, 0);
        }
    
        if (Input.GetKey(KeyCode.LeftShift) && Input.GetKey(KeyCode.H))
        {
            // 获取Player变量指定的对象的三围坐标
            Vector3 arm_postion = hookRootTransform.position;
            // 获取X,Y,Z值
            float x = arm_postion.x;
            float y = arm_postion.y;
            float z = arm_postion.z;
    
            //armObject.transform.Translate();
            hookRootTransform.position = arm_postion + new Vector3(0, -0.01f, 0);
        }
    
    
        if (Input.GetKey(KeyCode.LeftShift) && Input.GetKey(KeyCode.R))
        {
            // 获取Player变量指定的对象的三围坐标
            Quaternion arm_rotation = hookHeaderTransform.rotation;
            float y = arm_rotation.y;
            ////Debug.Log(y);
            float y_f = y + 0.0f;
            hookHeaderTransform.Rotate(new Vector3(0, y_f, 0));
    
        }
    
    
        if (Input.GetKey(KeyCode.LeftShift) && Input.GetKey(KeyCode.T))
        {
            // 获取Player变量指定的对象的三围坐标
            Quaternion arm_rotation = hookHeaderTransform.rotation;
            float y = arm_rotation.y;
            ////Debug.Log(y);
            float y_f = (y + 0.0f)*(-1.0f);
            hookHeaderTransform.Rotate(new Vector3(0, y_f, 0));
    
        }
    
    
    
    }

     

    ######################

    QQ 3087438119
  • 相关阅读:
    4--Python入门--Python数据集合类型--集合
    3--Python入门--Python数据集合类型--元组
    2--Python入门--Python数据集合类型--列表
    1--Python 入门--Python基础数据类型
    1--Testng功能简介
    2--JAVA+Maven+TestNG搭建接口测试框架搭建
    2--linux命令--查看磁盘空间
    登录功能测试总结
    在Linux环境下搭建Tomcat+mysql+jdk环境
    如何在Linux系统下挂载光盘
  • 原文地址:https://www.cnblogs.com/herd/p/15325292.html
Copyright © 2011-2022 走看看