데이터 타입 Vector3int16 는 3D 공간에 있는 벡터를 나타내며, 구성 요소에 대해 signed 16-bit integer 를 사용합니다. 이는 Vector3 와 동일한 아리텍티 연산을 허용하지만, 일반적으로 사용되지 않는 벡터 함수
Vector3int16 은 이 혼동되면 안 됩니다.
- Vector3 , 3D 벡터를 위한 더 정확한 구현을 위해.
- Vector2int16 , 2D 벡터에 대한 유사한 구현.
각 구성 요소에 대해:
- 낮은 바인딩은 -2 15 또는 -32,768입니다.
- 상위 한도는 2 15 − 1, 또는 32,767 입니다.
Vector3로 변환
Datatype.Vector3int16를 Vector3로 변환하려면 각 Vector3 의 구성 요소를 건설하십시오. 1>Datatype.Vector31> 에 대해 모든 구성 요소를 전달하면 됩니다. :
local vector3int16 = Vector3int16.new(1, 2, 3)local vector3 = Vector3.new(vector3int16.X, vector3int16.Y, vector3int16.Z)print(vector3) --> 1, 2, 3
Do not pass an entire Vector3int16 to Vector3.new() , as the constructor interprets a 1> Datatype.Vector3int161> 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 vector3int16 = Vector3int16.new(1, 2, 3)local vector3 = Vector3.new(vector3int16)print(vector3) --> 0, 0, 0
수학 연산
다음 수학 연산은 Vector3int16 데이터 입력대해 유효합니다. 모든 연산에 대해 서명된 16비트 정수와 관련된 제한 사항을 유의하십시오.
<tbody><tr><td><code>Datatype.Vector3int16</code><code>+</code><code>Datatype.Vector3int16</code></td><td>구성 요소는 데이터 유형 벡터입니다.Datatype.Vector3int16 의 요소입니다.</td></tr><tr><td><code>Datatype.Vector3int16</code><code>-</code><code>Datatype.Vector3int16</code></td><td>구성 요소는 차이 요소의 개별 구성 요소입니다.Produces a <code>Datatype.Vector3int16</code> whose components are the difference of the operands' respective components.</td></tr><tr><td><code>Datatype.Vector3int16</code><code>\*</code><code>Datatype.Vector3int16</code></td><td>구성 요소는 각 연산자의 구성 요소입니다.Produces a <code>Datatype.Vector3int16</code> whose components are the product of the operands' respective components.</td></tr><tr><td><code>Datatype.Vector3int16</code><code>/</code><code>Datatype.Vector3int16</code></td><td>Datatype.Vector3int16을 생성하는 구성 요소는 각 구성 요소의 비율입니다. 나눔의 결과는 반올림됩니다.</td></tr><tr><td><code>Datatype.Vector3int16</code><code>\*</code><code>숫자</code></td><td>각 구성 요소는 해당 구성 요소의 Datatype.Vector3int16 및 숫자(요소)의 제품입니다. 이 작업은 중단됩니다.</td></tr><tr><td><code>Datatype.Vector3int16</code><code>/</code><code>숫자</code></td><td>각 구성 요소가 해당 데이터 유형의 배수인 Datatype.Vector3int16 구성 요소와 번호(분할기)인 결과를 생성합니다. 결과는 반올림하여 0으로 반올림됩니다.</td></tr></tbody>
작업 | 설명 |
---|
요약
생성자
주어진 x, y 및 z 구성 요소에서 새로운 Vector3int16를 반환합니다.
속성
Datatype.Vector3int16의 x-좌표.
Datatype.Vector3int16의 y-좌표.
Datatype.Vector3int16의 z-좌표.
수학 연산
구성 요소는 모두 기본 구성 요소의 합계입니다.Produces a Vector3int16 whose components are the sum of the operands' respective components.
구성 요소는 차이 요소입니다.Produces a Vector3int16 whose components are the difference of the operands' respective components.
구성 요소는 각 연산자의 구성 요소입니다.Produces a Vector3int16 whose components are the product of the operands' respective components.
Datatype.Vector3int16의 구성 요소인 연산자 구성 요소의 합계를 생성합니다. 결과는 반올림됩니다.
각 구성 요소는 해당 구성 요소의 Vector3int16 및 숫자(요소)의 제품입니다. 이 작업은 중단됩니다.
각 구성 요소가 해당 구성 요소의 곱(Vector3int16), 번호(Vector3int16 및 분수(Datatype.Vector3int16)인 2>Datatype.Vector3int162>의 곱을 생성합니다. 결과는 반올림 된 0으로 반올림됩니다.
생성자
new
주어진 x, y 및 z 구성 요소에서 새로운 Vector3int16를 반환합니다. 부동 소수점은 반올림됩니다.
구성 요소는 범위 [-2 15 , 2 15 ) 내에 떨어져야 합니다. 이 범위 외에는 정수 오버플로우가 발생할 수 있습니다. 예를 들어, 2 15 을 구성 요소로 제공하면
속성
수학 연산
Datatype.Vector3int16의 구성 요소는 각 연산자의 구성 요소의 합입니다. 앞에서 설명한 싸인된 16비트 정수와 관련된 제한을 고려하십시오.
구성 요소는 차이 요소의 개별 구성 요소입니다. 서명된 16비트 정수와 관련된 제한을 고려하십시오. 이전에 설명한 16비트 정수와 관련된 제한을 고려하십시오.
작성된 16비트 정수와 관련된 한도에 대한 제한 사항을 고려하십시오. 이 정수의 구성 요소는 각 연산자의 구성 요소의 산물입니다. Datatype.Vector3int16 을 생성합니다.
Datatype.Vector3int16 의 구성 요소는 각 구성 요소의 비율입니다. 결과는 라운드 다운됩니다. 앞에서 설명한 앞서 언급한 16비트 정수와 관련된 제한 사항을 유의하십시오.
구성 요소는 각 구성 요소의 하위 요소이며 해당 구성 요소의 하위 요소는 해당 구성 요소의 하위 요소이며 해당 요소의 번호(요소). 이 작업은 중첩됩니다. 앞에 설명된 서명된 16비트 정수와 관련된 제한 사항을 유의하십시오.
구성 요소는 각 구성 요소의 합계이며 결과는 0으로 반올림됩니다. 앞에서 설명한 16비트 구성 요소의 합계와 번호(분할기)입니다. 앞에서 설명한 싸인 16비트 구성 요소와 관련된 한도는 주의하십시오.