zoukankan      html  css  js  c++  java
  • Transform & Physics

    Transform & Physics

    1、Space。Unity定义了Space枚举值,此值如下:

      

      通常通过Space.World、Space.Self来区别一个Vector是按世界坐标系作用还是按本地坐标系作用。

    参考:file:///D:/Program%20Files%20(x86)/Unity/Editor/Data/Documentation/Documentation/ScriptReference/Space.html

    2、通过Transform.Translate()来移动对象。

      

      

      

      

      其中relativeTo:Transform参数指定按某对象的局部坐标系来应用vector,如果relativeTo为空则应用世界坐标系。

    参考:file:///D:/Program%20Files%20(x86)/Unity/Editor/Data/Documentation/Documentation/ScriptReference/Transform.Translate.html

    3、Local坐标系与World坐标系vector的转换。以下方法把Local坐标系的vector转换为World坐标系:

      

      

      以下方法把World坐标系转换为Local坐标系:

      

      

    4、Local坐标系与World坐标系point的转换。以下方法把Local转换为World:

      

      

      以下方法把World转换为Local:

      

      

    5、Physics.CheckSphere,用于判断某区域内是否有任何的其它Collider。

        

      Physics.OverlapSphere,用于获取区域内所有的Collider。

      

    参考:

    1、file:///D:/Program%20Files%20(x86)/Unity/Editor/Data/Documentation/Documentation/ScriptReference/Transform.html

    2、file:///D:/Program%20Files%20(x86)/Unity/Editor/Data/Documentation/Documentation/ScriptReference/Physics.OverlapSphere.html

      

  • 相关阅读:
    流媒体服务器搭建
    netcore问题总结
    Linux(Debian)网卡设置
    windows服务器让WEB通过防火墙的问题
    经典算法一 --- 过桥问题
    MySQL字段属性介绍
    什么是流程控制
    终于决定了,转行。
    浅析Openflow
    JavaScript 中 this 的详解
  • 原文地址:https://www.cnblogs.com/tekkaman/p/3818152.html
Copyright © 2011-2022 走看看