unity性能分析手册(unity中文API之Vector2)
unity性能分析手册(unity中文API之Vector2)
2024-09-28 07:23:13  作者:迂腐的人类  网址:https://m.xinb2b.cn/life/dpm106603.html
Vector2 二维向量


Description 描述

Representation of 2D vectors and points.

表示 2D 的向量和点。

This structure is used in some places to represent 2D positions and vectors (e.g. texture coordinates in a Mesh or texture offsets in Material). In the majority of other cases a Vector3 is used.

这个结构用于在一些地方表示2D的位置和向量(例如:网格中的纹理坐标,或者材质中的纹理偏移)。在其他情况下大多数使用Vector3。

Static Variables 静态变量

one Shorthand for writing Vector2(1, 1).

Vector2(1, 1)的简写。 right Shorthand for writing Vector2(1, 0).

Vector2(1, 0)的简写。 up Shorthand for writing Vector2(0, 1).

Vector2(0, 1)的简写。 zero Shorthand for writing Vector2(0, 0).

Vector2(0, 0)的简写。

Variables 变量

magnitude Returns the length of this vector (Read Only).

返回向量的长度(只读)。 normalized Returns this vector with a magnitude of 1 (Read Only).

返回向量的长度为1(只读)。 sqrMagnitude Returns the squared length of this vector (Read Only).

返回这个向量的长度的平方(只读)。 this[int] Access the x or y component using [0] or [1] respectively.

使用(索引器)[0]或者[1]分别访问组件x或者y组件。 x X component of the vector.

向量的X组件。 y Y component of the vector.

向量的Y组件。

Constructors 构造器

Vector2 Constructs a new vector with given x, y components.

创建一个新的具有给定x,y组件的向量。

Functions 函数

Normalize Makes this vector have a magnitude of 1.

使向量的长度为1。 Set Set x and y components of an existing Vector2.

设置已知二维变量的x和y。 ToString Returns a nicely formatted string for this vector.

返回该向量一个格式化好的字符串。

Static Functions 静态函数

Angle Returns the angle in degrees between from and to.

在from和to之间返回一个角度。 ClampMagnitude Returns a copy of vector with its magnitude clamped to maxLength.

返回向量的长度,最大不超过maxLength所指示的长度。 Distance Returns the distance between a and b.

返回a和b之间的距离。 Dot Dot Product of two vectors.

两个向量的点乘积。 Lerp Linearly interpolates between two vectors.

两个向量之间的线性插值。 Max Returns a vector that is made from the largest components of two vectors.

返回一个由两个向量的最大组件组成的向量。 Min Returns a vector that is made from the smallest components of two vectors.

返回一个由两个向量的最小组件组成的向量。 MoveTowards Moves a point current towards target.

当前的地点移向目标。 Reflect Reflects a vector off the vector defined by a normal.

定义在正常情况下映射向量离开向量。 Scale Multiplies two vectors component-wise.

两个矢量组件对应相乘。 SmoothDamp Gradually changes a vector towards a desired goal over time.

随着时间的推移逐渐改变一个向量朝着期望的目标。

operators 运算符

operator - Subtracts one vector from another.

一个向量减去另一个向量。 operator != Returns true if vectors different.

如果向量不同返回真。 operator * Multiplies a vector by a number.

一个向量乘以一个数字。 operator / Divides a vector by a number.

一个向量除以一个数字。 operator Adds two vectors.

两个向量相加。 operator == Returns true if the vectors are equal.

如果向量相等返回真。 operator Vector2 Converts a Vector3 to a Vector2.

将一个Vector3转化成一个Vector2。 operator Vector3 Converts a Vector2 to a Vector3.

将一个Vector2转化成一个Vector3。

  • 与君初相识师兄的手绢哪儿来的(师父你们男人要看耍大刀)
  • 2024-09-28师父你们男人要看耍大刀说回正文!同样一部电影,男女感官就是完!全!不!一!样!譬如《火星救援》,男人们在科幻的世界里不能自拔,女人们只关心,哎呀,马特戴蒙好帅,哎呀,他居然会种土豆耶,哎呀,你们快去救他呀!好吧,我说的是一。
  • 瑞虎7油耗高吗 1.5t(实测全新瑞虎71.5T出力不错)
  • 2024-09-28实测全新瑞虎71.5T出力不错就在前几日,阿贵看车应网友的需要,对全新一代瑞虎7(下文简称全新瑞虎7)进行了简单的静态实拍,在经过几天的驾驶体验后,我们也对这款SUV有了更深的了解所以本次就对其进行动力、油耗、空间、多媒体等方面的。
  • darren真人版(Darren狮城遇正宫范文芳)
  • 2024-09-28Darren狮城遇正宫范文芳记者林奕如/台北报导Darren邱凯伟、张本渝主演台视《700岁旅程》,日前赴新加坡出席「2016亚洲电视节」宣传他之前曾和影帝李铭顺合作《亲爱的,我爱上别人了》,剧中当小三,他这次现场巧遇他老婆范文。
  • 玄天之剑实力测试(玄天之剑神兵内测)
  • 2024-09-28玄天之剑神兵内测玄天世界中神魔并起,时逢乱世,正邪并无明确的界定天魔有情,而正道糜腐天降神器,引的数万江湖人士蜂拥而抢,群雄更是为夺至尊之位,而搏击争锋!斗魂乃玄天间神秘之物,可排山倒海,倾覆江湖,更有胜者可开天辟地。
  • 豆腐和什么食物搭配食用更有营养(豆腐的四种黄金搭配)
  • 2024-09-28豆腐的四种黄金搭配在我们的日常生活中有很多人爱吃豆腐,它营养丰富,含有铁、钙、磷、镁等人体必需的多种微量元素,还含有糖类、植物油和丰富的优质蛋白,素有“植物肉”之美称但是有些朋友却说不知道怎么搭配好吃,今天就来教大家几。
  • 夏季小众迷幻香(这几瓶火了100年的商业香)
  • 2024-09-28这几瓶火了100年的商业香不知道大家还记不记得,就在月初三八妇女节的时候,辛芷蕾被网民骂上了热搜起因是妇女节的时候,辛芷蕾发布了一条微博动态,配文“不会用香水的女人没有未来”这么带有标签色彩的语句,难免让人觉得不适但事实上辛芷。
  • rm金钟国宋智孝下车后第一期(金钟国宋智孝确定下车)
  • 2024-09-28金钟国宋智孝确定下车今早平地一声雷,直接把毛线炸醒了……继Gary退出《runningman》之后,宋智孝和金钟国也宣布要退出了唉……据韩媒报道,7个人的《RM》就要结束了,《RM》第二季将重新出发,彻底改版,成员也会大。
  • 西岳华山之横空栈道(游览西岳自古一条路)
  • 2024-09-28游览西岳自古一条路作者:大华山智慧旅游自古华山一条路,大家应该都听过,可是经历时代的变迁,享受着社会进步的成果;我们也亲眼目睹着华山一点一滴的改变与进步,如今华山有四条登山道路供大家选择,今天小编给大家科普一下第一条路。