Skip to content

Commit

Permalink
002 - Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Yarwin committed Jan 24, 2025
1 parent 3aad1b2 commit f540704
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 282 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
*.pdb
*.so

# cargo
*.lock

# System/tool-specific ignores
.directory
.DS_Store
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ extends ProjectileConfig
class_name UserExtendedProjectileConfig
func _on_area_collided(area: Area2D, caster: Node2D, collision_data: Dictionary) -> bool:
func _on_area_collided(area: Area2D, collision_data: Dictionary, metadata: Variant) -> bool:
print("Hello Area!")
func _on_body_collided(area: Area2D, caster: Node2D, collision_data: Dictionary) -> bool:
func _on_body_collided(body: Body2D, collision_data: Dictionary, metadata: Variant) -> bool:
print("Hello body!")
func _on_projectile_removed(caster: Node2D, projectile_transform: Transform2D) -> bool:
func _on_projectile_removed(collision_data: Dictionary, metadata: Variant) -> bool:
print("Goodbay cruel world!")
```

Expand All @@ -46,7 +46,6 @@ class_name MyCaster
space, # World2D physics space
projectile_transform,
exclude,
self # (optional) caster (used only in callbacks).
self # Metadata attached to given projectile that can be used in callbacks.
)
```

273 changes: 0 additions & 273 deletions projectile_server_2d/Cargo.lock

This file was deleted.

1 change: 0 additions & 1 deletion projectile_server_2d/src/godot_api/projectile_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ pub(crate) struct ProjectileConfig {
#[export]
pub length: f32,
///
#[var(usage_flags = [GROUP, EDITOR, READ_ONLY])]
display: u32,
/// Enables physics interpolation for given projectile. See [member ProjectSettings.physics/common/physics_interpolation] and [member SceneTree.physics_interpolation] for the global setting.
Expand Down
6 changes: 3 additions & 3 deletions projectile_server_2d/src/servers/projectile_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl LiveProjectile {
params.set_collision_mask(projectile_config.collision_mask);
params.set_collide_with_areas(projectile_config.collide_with_areas);
params.set_collide_with_bodies(projectile_config.collide_with_bodies);
space_state.intersect_shape(params)
space_state.intersect_shape(&params)
};
for collision in collisions.iter_shared() {
Self::resolve_collision(projectile, collision);
Expand Down Expand Up @@ -88,7 +88,7 @@ impl LiveProjectile {
params.set_collide_with_areas(projectile_config_bind.collide_with_areas);
params.set_collide_with_bodies(projectile_config_bind.collide_with_bodies);
params.set_exclude(&projectile.exclude);
space_state.intersect_ray(params)
space_state.intersect_ray(&params)
};
projectile.update(delta);
if !cast.is_empty() {
Expand Down Expand Up @@ -192,7 +192,7 @@ pub struct ProjectileManager2D {
#[godot_api]
impl INode for ProjectileManager2D {
fn enter_tree(&mut self) {
Engine::singleton().register_singleton(&Self::singleton_name(), self.base().clone());
Engine::singleton().register_singleton(&Self::singleton_name(), &self.base().clone());
}

fn exit_tree(&mut self) {
Expand Down

0 comments on commit f540704

Please sign in to comment.