我的世界开发日志2——什么是Vector3
来源:互联网 发布:java接口中的静态方法 编辑:程序博客网 时间:2024/04/29 10:15
Vector 是向量,矢量的意思,向量既有大小,又有方向,Verctor3 就是三维向量,一个三维向量会有三个分量,分别是 x,y,z,在 Unity 中每一个游戏对象都至少会有一个组件叫 Transform,Transform 主要用来控制游戏对象的位置,旋转和缩放。
Vector3向量既可以用来表示位置,也可以用来表示方向。在数学与物理中,既有大小又有方向的量叫做向量(亦称矢量),与标量相对。
Variables变量
- xX component of the vector.
向量的X组件。 - yY component of the vector.
向量的Y组件。 - zZ component of the vector.
向量的Z组件。 - this [int index]Access the x, y, z components using [0], [1], [2] respectively.
使用[0], [1], [2]分别访问组件x, y, z组件。简单来说就是用索引号代替x, y, z组件。 - normalizedReturns this vector with a magnitude of 1 (Read Only).
返回向量的长度为1(只读)。 - magnitudeReturns the length of this vector (Read Only).
返回向量的长度(只读)。 - sqrMagnitudeReturns the squared length of this vector (Read Only).
返回这个向量的长度的平方(只读)。
Constructors构造器
- Vector3Creates a new vector with given x, y, z components.
创建一个新的具有给定x, y, z组件的向量。
Functions函数
- ScaleMultiplies every component of this vector by the same component of scale.
由缩放的相同的组件对应乘以这个矢量的每个组件。 - NormalizeMakes this vector have a magnitude of 1.
使向量的长度为1。 - ToStringReturns a nicely formatted string for this vector.
返回此向量格式化的字符串。
Class Variables类变量
- zeroShorthand for writing Vector3(0, 0, 0)
写Vector3(0, 0, 0)的简码。 - oneShorthand for writing Vector3(1, 1, 1)
写Vector3(1, 1, 1)的简码。 - forwardShorthand for writing Vector3(0, 0, 1)
写Vector3(0, 0, 1)的简码,也就是向z轴。 - upShorthand for writing Vector3(0, 1, 0)
写Vector3(0, 1, 0)的简码,也就是向y轴。 - rightShorthand for writing Vector3(1, 0, 0)
写Vector3(1, 0, 0)的简码,也就是向x轴。
Class Functions类函数
- LerpLinearly interpolates between two vectors.
两个向量之间的线性插值。 - SlerpSpherically interpolates between two vectors.
球形插值在两个向量之间。 - OrthoNormalizeMakes vectors normalized and orthogonal to each other.
使向量规范化并且彼此相互垂直。 - MoveTowardsMoves a point current towards target.
当前的地点移向目标。 - RotateTowardsRotates a vector current towards target.
当前的向量转向目标。 - SmoothDampGradually changes a vector towards a desired goal over time.
随着时间的推移,逐渐改变一个向量朝向预期的目标。 - ScaleMultiplies two vectors component-wise.
两个矢量组件对应相乘。 - CrossCross Product of two vectors.
两个向量的交叉乘积。返回lhs x rhs - ReflectReflects the vector along the normal.
沿着法线反射向量。 - DotDot Product of two vectors.
两个向量的点乘积。 - ProjectProjects a vector onto another vector.
投影一个向量到另一个向量。 - AngleReturns the angle in degrees between from and to.
由from和to两者返回一个角度。 - DistanceReturns the distance between a and b.
返回a和b之间的距离。 - ClampMagnitudeReturns a copy of vector with its magnitude clamped to maxLength.
返回向量的长度,最大不超过maxLength所指示的长度。 - MinReturns a vector that is made from the smallest components of two vectors.
返回一个由两个向量的最小组件组成的向量。 - MaxReturns a vector that is made from the largest components of two vectors.
返回一个由两个向量的最大组件组成的向量。 - operator +Adds two vectors.
两个向量相加。 - operator -Subtracts one vector from another.
一个向量减另一个向量。 - operator *Multiplies a vector by a number.
由一个数乘以一个向量。 - operator /Divides a vector by a number.
由一个数除一个向量。也就是a/b。 - operator ==Returns true if the vectors are equal.
如果两个向量相等,返回真。 - operator !=Returns true if vectors different.
如果向量不同返回真。
阅读全文
0 0
- 我的世界开发日志2——什么是Vector3
- 我的世界开发日志1——什么是Mesh
- 我的世界开发日志3——什么是RequireComponent
- 我的世界开发日志4——什么是MonoBehaviour?
- 我的世界开发日志5——什么是协程序
- Vector3——简单的3D向量类
- 毕设帮(5188.help)开发日志2——我的构想有市场吗?
- 我的共享软件开发日志
- 我对Unity中Quaternion * Vector3的理解
- 我的Unity3D学习日记-03(Input,GameObject,Vector3)
- 我对Unity中Quaternion * Vector3的理解
- 编程世界,我的世界。
- 《世界因你不同》——我的出生
- 《世界因你不同》——回忆我的父亲
- 征服程序世界—我的AI-CODE
- Vector3.Dot和Vector3.Cross的使用
- 走进VR开发世界(4)——走进VR游戏开发的世界
- 【我的世界】游戏开发:Markus Persson,34岁,发明家
- 分布式锁的一点理解
- Oracle和MySQL分组后字段间拼接问题,自己记录一下
- App推广中如何寻找200个以上渠道
- 发布 APK 到 Google Play 之 uses-featrue 的配置
- Java学习(一) 初识Java及开发环境搭建
- 我的世界开发日志2——什么是Vector3
- 2020 排序相减
- nmap命令检查在线IP与在线IP的开放端口情况
- 为什么你今年的去哪儿产品经理面试挂了?
- kylin之 java
- java 学习书籍pdf 里面有很多高清资源下载
- 停止对互联网的意淫吧,它不过是个信息技术啊
- html字符串中匹配所有img的src
- PHPCMS V9 自定义函数——根据模型ID和信息ID获取信息点击数