Skip to content

Commit

Permalink
Merge pull request #7 from sebosp/feature/rerun-0.7-upgrade
Browse files Browse the repository at this point in the history
Upgrade to rerun 0.7
  • Loading branch information
sebosp authored Jun 23, 2023
2 parents 830b401 + 3d8fcbe commit 7d39949
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description = "Visualizer experiments for Starcraft II - Replay data"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
rerun = {version = "0.6.0", features = ["native_viewer"] }
rerun = {version = "0.7.0", features = ["native_viewer"] }
s2protocol = "1.1.1"
nom-mpq = "0.1.1"
colored = "2.0.0"
Expand Down
19 changes: 12 additions & 7 deletions src/game_events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
use super::*;
use rerun::components::Arrow3D;
use rerun::transform::TranslationRotationScale3D;
use rerun::{
components::{Box3D, Quaternion, Radius, Rigid3, Transform, Vec3D},
components::{Box3D, Radius, Transform3D, Vec3D},
MsgSender,
};
use s2protocol::game_events::*;
Expand All @@ -21,13 +22,17 @@ pub fn register_camera_update(
MsgSender::new(format!("Unit/999{}/Player", user_id))
.with_time(sc2_rerun.timeline, game_loop)
.with_splat(Box3D::new(3.0, 3.0, 0.0))?
.with_splat(Transform::Rigid3(Rigid3 {
rotation: Quaternion::new(0., 0., 0., 0.),
translation: Vec3D::new(
(target.x as f32 / 250f32) - 1.5,
(-1. * target.y as f32 / 250f32) - 1.5,
0.,
.with_splat(Transform3D::new(TranslationRotationScale3D {
translation: Some(
[
(target.x as f32 / 250f32) - 1.5,
(-1. * target.y as f32 / 250f32) - 1.5,
0.,
]
.into(),
),
rotation: None,
scale: None,
}))?
.with_splat(user_color(user_id))?
.send(recording_stream)?;
Expand Down

0 comments on commit 7d39949

Please sign in to comment.