데이터 타입 Vector2int16 는 2D 공간에 있는 벡터를 나타내며, 구성 요소에 대해 signed 16-bit integer 를 사용합니다. 이는 Vector2 와 동일한 수학 연산을 사용하지만, 일반적으로 사용되지 않는 벡터 함수를 사용하지
Vector2int16 은 이 혼동되면 안 됩니다.
- Vector2 , 2D 벡터를 위한 더 정확한 구현과 완료 구현.
- Vector3int16 , 3D 벡터와 유사한 구현.
각 구성 요소에 대해:
- 낮은 바인딩은 -2 15 또는 -32,768입니다.
- 상위 한도는 2 15 − 1, 또는 32,767 입니다.
Vector2로 변환
Datatype.Vector2int16을 Vector2로 변환하려면 각 Vector2의 1>Datatype. Vector21>를 4>Datatype. Vector2.new4>로 패스하여 변환합니다. :
local vector2int16 = Vector2int16.new(1, 2)local vector2 = Vector2.new(vector2int16.X, vector2int16.Y)print(vector2) --> 1, 2
Do not pass an entire Vector2int16 to Vector2.new(), as the constructor interprets a 1> Datatype. Vector2int161> as a 4> 04> within its parameters 7> without producing an error7>. This can lead to silent logic errors if you do something like:
local vector2int16 = Vector2int16.new(1, 2)local vector2 = Vector2.new(vector2int16)print(vector2) --> 0, 0
수학 연산
다음 수학 연산은 Vector2int16 데이터 입력대해 유효합니다. 모든 연산에 대해 서명된 16비트 정수와 관련된 제한 사항을 유의하십시오. 이전에 설명한 대로.
<tbody><tr><td><code>Datatype.Vector2int16</code><code>+</code><code>Datatype.Vector2int16</code></td><td>구성 요소는 데이터 유형 벡터입니다.Datatype.Vector2int16 의 요소입니다.</td></tr><tr><td><code>Datatype.Vector2int16</code><code>-</code><code>Datatype.Vector2int16</code></td><td>구성 요소는 차이 요소의 개별 구성 요소입니다.Produces a <code>Datatype.Vector2int16</code> whose components are the difference of the operands' respective components.</td></tr><tr><td><code>Datatype.Vector2int16</code><code>\*</code><code>Datatype.Vector2int16</code></td><td>구성 요소는 각 연산자의 구성 요소입니다.Produces a <code>Datatype.Vector2int16</code> whose components are the product of the operands' respective components.</td></tr><tr><td><code>Datatype.Vector2int16</code><code>/</code><code>Datatype.Vector2int16</code></td><td>Datatype.Vector2int16을 생성하는 구성 요소는 각 구성 요소의 비율입니다. 나눔의 결과는 반올림됩니다.</td></tr><tr><td><code>Datatype.Vector2int16</code><code>\*</code><code>숫자</code></td><td>각 구성 요소는 해당 구성 요소의 Datatype.Vector2int16 및 해당 구성 요소의 번호(요소)의 제품입니다. 이 작업은 중단됩니다.</td></tr><tr><td><code>Datatype.Vector2int16</code><code>/</code><code>숫자</code></td><td>각 구성 요소는 해당 데이터 유형의 배수이며 해당 데이터 유형의 배수(분할기)입니다. 나눔의 결과는 0으로 반올림됩니다.Produces a <code>Datatype.Vector2int16</code> whose components are the quotient of the respective <code>Datatype.Vector2int16</code> components and the number (divisor). The results of the division are rounded toward zero.</td></tr></tbody>
작업 | 설명 |
---|
요약
생성자
주어진 x 및 y 구성 요소에서 Vector2int16를 반환합니다.
수학 연산
구성 요소는 모든 연산자의 개별 구성 요소의 합계입니다.Produces a Vector2int16 whose components are the sum of the operands' respective components.
구성 요소는 차이 요소입니다.Produces a Vector2int16 whose components are the difference of the operands' respective components.
구성 요소는 각 연산자의 구성 요소입니다.Produces a Vector2int16 whose components are the product of the operands' respective components.
구성 요소는 각 구성 요소의 비율입니다.Produces a Vector2int16 whose components are the quotient of the operands' respective components.
각 구성 요소는 해당 구성 요소의 일부이며 해당 구성 요소의 일부인 번호(요소)입니다.Produces a Vector2int16 whose components are the product of the respective Vector2int16 components and the number (factor).
각 구성 요소는 해당 구성 요소의 배수이며 번호(분할기)입니다. Datatype.Vector2int16 구성 요소.
생성자
new
x 및 y 구성 요소를 기반으로 새로운 Vector2int16를 반환합니다. 부동 소수점은 반올림됩니다.
구성 요소는 범위 [-2 15 , 2 15 내에 떨어져야 합니다. 범위 외에는 정수 오버플로우가 발생할 수 있습니다. 예를 들어, 32,768 (2 15 과 동일) 을 구성 요소
속성
수학 연산
Datatype.Vector2int16의 구성 요소는 각 연산자의 구성 요소의 합입니다. 앞에서 설명한 싸인된 16비트 정수와 관련된 제한을 고려하십시오.
구성 요소는 차이 요소의 개별 구성 요소입니다. 서명된 16비트 정수와 관련된 제한을 고려하십시오. 이전에 설명한 16비트 정수와 관련된 제한을 고려하십시오.
작성된 16비트 정수와 관련된 한도에 대한 제한 사항을 고려하십시오. 이 정수의 구성 요소는 각 연산자의 구성 요소의 산물입니다. Datatype.Vector2int16 을 생성합니다.
Datatype.Vector2int16 의 구성 요소는 각 구성 요소의 비율입니다. 결과는 라운드 다운됩니다. 앞에서 설명한 앞서 언급한 16비트 정수와 관련된 제한 사항을 유의하십시오.
구성 요소는 각 구성 요소의 상위인 Vector2int16 구성 요소와 번호(요소)입니다. 이 작업은 중첩됩니다. 서명된 16비트 정수와 관련된 제한 사항을 고려하십시오. 이 작업은 중첩됩니다. 앞에 설명된 16비트 정수와 관련된 제한 사항을 고려하십시오.
구성 요소는 각 구성 요소의 합계이며 결과는 0으로 반올림됩니다. 앞에서 설명한 16비트 구성 요소의 합계와 번호(분할기)입니다. 앞에서 설명한 싸인 16비트 구성 요소와 관련된 한도는 주의하십시오.