From 35cd62011c897cf749bc838f288ab3fe5d62a5a2 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Sun, 12 Feb 2023 23:08:45 +0800 Subject: [PATCH] DR_rs! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 上学去喽~ --- libs/Difficult_Rocket_rs/__init__.py | 4 ++++ libs/Difficult_Rocket_rs/src/src/lib.rs | 1 + libs/Difficult_Rocket_rs/src/src/render.rs | 25 ++++++++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/libs/Difficult_Rocket_rs/__init__.py b/libs/Difficult_Rocket_rs/__init__.py index e8ea900..dc0cd44 100644 --- a/libs/Difficult_Rocket_rs/__init__.py +++ b/libs/Difficult_Rocket_rs/__init__.py @@ -62,5 +62,9 @@ if TYPE_CHECKING: def __exit__(self, exc_type, exc_val, exc_tb) -> None: ... + class PartFrame_rs: + ... + + # class CenterCamera_rs(Camera_rs): # """ 用于依旧闲的没事 用 rust 写一个中央对齐的 camera """ diff --git a/libs/Difficult_Rocket_rs/src/src/lib.rs b/libs/Difficult_Rocket_rs/src/src/lib.rs index dd87cc2..c6849ab 100644 --- a/libs/Difficult_Rocket_rs/src/src/lib.rs +++ b/libs/Difficult_Rocket_rs/src/src/lib.rs @@ -36,5 +36,6 @@ fn module_init(_py: Python<'_>, m: &PyModule) -> PyResult<()> { m.add_function(wrap_pyfunction!(simulator::simluation, m)?)?; m.add_class::()?; m.add_class::()?; + m.add_class::()?; Ok(()) } \ No newline at end of file diff --git a/libs/Difficult_Rocket_rs/src/src/render.rs b/libs/Difficult_Rocket_rs/src/src/render.rs index 686d442..e9c15d5 100644 --- a/libs/Difficult_Rocket_rs/src/src/render.rs +++ b/libs/Difficult_Rocket_rs/src/src/render.rs @@ -127,3 +127,28 @@ pub mod camera { } } } + +pub mod screen { + use pyo3::prelude::*; + + #[pyclass] + #[pyo3(name = "PartFrame_rs")] + pub struct PartFrame { + pub box_size: i32, + pub width: i64, + pub height: i64, + // pub frame_box: Vec> + } + + #[pymethods] + impl PartFrame { + #[new] + pub fn py_new() -> PyResult { + Ok(PartFrame { + box_size: 111, + width: 111, + height: 111 + }) + } + } +}