|
|
@@ -117,9 +117,9 @@ static Vec2 SmoothDamp(Vec2 current, Vec2 target, PyVec2& currentVelocity, float
|
|
|
}, {}, BindType::STATICMETHOD);
|
|
|
|
|
|
vm->bind__repr__(PK_OBJ_GET(Type, type), [](VM* vm, PyObject* obj){
|
|
|
- PyVec2& self = _CAST(PyVec2&, obj);
|
|
|
- std::stringstream ss;
|
|
|
- ss << std::fixed << std::setprecision(3);
|
|
|
+ Vec2 self = _CAST(PyVec2&, obj);
|
|
|
+ SStream ss;
|
|
|
+ ss.setprecision(3);
|
|
|
ss << "vec2(" << self.x << ", " << self.y << ")";
|
|
|
return VAR(ss.str());
|
|
|
});
|
|
|
@@ -165,9 +165,9 @@ static Vec2 SmoothDamp(Vec2 current, Vec2 target, PyVec2& currentVelocity, float
|
|
|
});
|
|
|
|
|
|
vm->bind__repr__(PK_OBJ_GET(Type, type), [](VM* vm, PyObject* obj){
|
|
|
- PyVec3& self = _CAST(PyVec3&, obj);
|
|
|
- std::stringstream ss;
|
|
|
- ss << std::fixed << std::setprecision(3);
|
|
|
+ Vec3 self = _CAST(PyVec3&, obj);
|
|
|
+ SStream ss;
|
|
|
+ ss.setprecision(3);
|
|
|
ss << "vec3(" << self.x << ", " << self.y << ", " << self.z << ")";
|
|
|
return VAR(ss.str());
|
|
|
});
|
|
|
@@ -202,9 +202,9 @@ static Vec2 SmoothDamp(Vec2 current, Vec2 target, PyVec2& currentVelocity, float
|
|
|
});
|
|
|
|
|
|
vm->bind__repr__(PK_OBJ_GET(Type, type), [](VM* vm, PyObject* obj){
|
|
|
- PyVec4& self = _CAST(PyVec4&, obj);
|
|
|
- std::stringstream ss;
|
|
|
- ss << std::fixed << std::setprecision(3);
|
|
|
+ Vec4 self = _CAST(PyVec4&, obj);
|
|
|
+ SStream ss;
|
|
|
+ ss.setprecision(3);
|
|
|
ss << "vec4(" << self.x << ", " << self.y << ", " << self.z << ", " << self.w << ")";
|
|
|
return VAR(ss.str());
|
|
|
});
|
|
|
@@ -261,9 +261,9 @@ static Vec2 SmoothDamp(Vec2 current, Vec2 target, PyVec2& currentVelocity, float
|
|
|
});
|
|
|
|
|
|
vm->bind__repr__(PK_OBJ_GET(Type, type), [](VM* vm, PyObject* obj){
|
|
|
- PyMat3x3& self = _CAST(PyMat3x3&, obj);
|
|
|
- std::stringstream ss;
|
|
|
- ss << std::fixed << std::setprecision(3);
|
|
|
+ const PyMat3x3& self = _CAST(PyMat3x3&, obj);
|
|
|
+ SStream ss;
|
|
|
+ ss.setprecision(3);
|
|
|
ss << "mat3x3([" << self._11 << ", " << self._12 << ", " << self._13 << ",\n";
|
|
|
ss << " " << self._21 << ", " << self._22 << ", " << self._23 << ",\n";
|
|
|
ss << " " << self._31 << ", " << self._32 << ", " << self._33 << "])";
|