|
|
@@ -9,7 +9,7 @@ https://github.com/blueloveTH/pocketpy/blob/main/include/typings/linalg.pyi
|
|
|
|
|
|
```python
|
|
|
from typing import overload
|
|
|
-from c import _StructLike
|
|
|
+from c import _StructLike, float_p
|
|
|
|
|
|
class vec2(_StructLike['vec2']):
|
|
|
x: float
|
|
|
@@ -19,6 +19,7 @@ class vec2(_StructLike['vec2']):
|
|
|
def __add__(self, other: vec2) -> vec2: ...
|
|
|
def __sub__(self, other: vec2) -> vec2: ...
|
|
|
def __mul__(self, other: float) -> vec2: ...
|
|
|
+ def __rmul__(self, other: float) -> vec2: ...
|
|
|
def __truediv__(self, other: float) -> vec2: ...
|
|
|
def dot(self, other: vec2) -> float: ...
|
|
|
def cross(self, other: vec2) -> float: ...
|
|
|
@@ -37,6 +38,7 @@ class vec3(_StructLike['vec3']):
|
|
|
def __add__(self, other: vec3) -> vec3: ...
|
|
|
def __sub__(self, other: vec3) -> vec3: ...
|
|
|
def __mul__(self, other: float) -> vec3: ...
|
|
|
+ def __rmul__(self, other: float) -> vec3: ...
|
|
|
def __truediv__(self, other: float) -> vec3: ...
|
|
|
def dot(self, other: vec3) -> float: ...
|
|
|
def cross(self, other: vec3) -> float: ...
|
|
|
@@ -54,6 +56,7 @@ class vec4(_StructLike['vec4']):
|
|
|
def __add__(self, other: vec4) -> vec4: ...
|
|
|
def __sub__(self, other: vec4) -> vec4: ...
|
|
|
def __mul__(self, other: float) -> vec4: ...
|
|
|
+ def __rmul__(self, other: float) -> vec4: ...
|
|
|
def __truediv__(self, other: float) -> vec4: ...
|
|
|
def dot(self, other: vec4) -> float: ...
|
|
|
def length(self) -> float: ...
|
|
|
@@ -90,6 +93,7 @@ class mat3x3(_StructLike['mat3x3']):
|
|
|
def __add__(self, other: mat3x3) -> mat3x3: ...
|
|
|
def __sub__(self, other: mat3x3) -> mat3x3: ...
|
|
|
def __mul__(self, other: float) -> mat3x3: ...
|
|
|
+ def __rmul__(self, other: float) -> mat3x3: ...
|
|
|
def __truediv__(self, other: float) -> mat3x3: ...
|
|
|
|
|
|
def __invert__(self) -> mat3x3: ...
|
|
|
@@ -118,4 +122,9 @@ class mat3x3(_StructLike['mat3x3']):
|
|
|
def transform_point(self, p: vec2) -> vec2: ...
|
|
|
def transform_vector(self, v: vec2) -> vec2: ...
|
|
|
|
|
|
+vec2_p = float_p
|
|
|
+vec3_p = float_p
|
|
|
+vec4_p = float_p
|
|
|
+mat3x3_p = float_p
|
|
|
+
|
|
|
```
|