Skip to content

Commit

Permalink
Register AncestorMarker
Browse files Browse the repository at this point in the history
  • Loading branch information
Jondolf committed Jul 21, 2024
1 parent 47bf699 commit 3d14581
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/sync/ancestor_marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,18 @@ impl<C: Component> Plugin for AncestorMarkerPlugin<C> {
///
/// This is added and removed automatically by the [`AncestorMarkerPlugin`] if it is enabled.
#[derive(Component, Reflect)]
#[reflect(Component, Default)]
pub struct AncestorMarker<C: Component> {
#[reflect(ignore)]
_phantom: PhantomData<C>,
}

impl<C: Component> Clone for AncestorMarker<C> {
fn clone(&self) -> Self {
Self::default()
}
}

impl<C: Component> Default for AncestorMarker<C> {
fn default() -> Self {
Self {
Expand Down
4 changes: 3 additions & 1 deletion src/type_registration.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
prelude::*,
sync::{PreviousGlobalTransform, SyncConfig},
sync::{ancestor_marker::AncestorMarker, PreviousGlobalTransform, SyncConfig},
};
use bevy::prelude::*;
use broad_phase::AabbIntersections;
Expand Down Expand Up @@ -68,6 +68,8 @@ impl Plugin for PhysicsTypeRegistrationPlugin {
.register_type::<ColliderConstructor>()
.register_type::<ColliderConstructorHierarchy>()
.register_type::<ColliderConstructorHierarchyConfig>()
.register_type::<AncestorMarker<RigidBody>>()
.register_type::<AncestorMarker<ColliderMarker>>()
.register_type::<RayCaster>()
.register_type::<ShapeCaster>()
.register_type::<DistanceJoint>()
Expand Down

0 comments on commit 3d14581

Please sign in to comment.