| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9609267 commit 01136fd
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,6 +8,8 @@ APyActor::APyActor() | |||
| 8 | 8 | PrimaryActorTick.bCanEverTick = true; | |
| 9 | 9 | ||
| 10 | 10 | this->OnActorBeginOverlap.AddDynamic(this, &APyActor::PyOnActorBeginOverlap); | |
| 11 | + this->OnActorEndOverlap.AddDynamic(this, &APyActor::PyOnActorEndOverlap); | ||
| 12 | + this->OnActorHit.AddDynamic(this, &APyActor::PyOnActorHit); | ||
| 11 | 13 | this->OnClicked.AddDynamic(this, &APyActor::PyOnActorClicked); | |
| 12 | 14 | ||
| 13 | 15 | // pre-generate PyUObject (for performance) | |
@@ -116,6 +118,32 @@ void APyActor::PyOnActorBeginOverlap(AActor *overlapped, AActor *other) | |||
| 116 | 118 | Py_DECREF(ret); | |
| 117 | 119 | } | |
| 118 | 120 | ||
| 121 | + void APyActor::PyOnActorEndOverlap(AActor *overlapped, AActor *other) | ||
| 122 | + { | ||
| 123 | + if (!py_actor_instance) | ||
| 124 | + return; | ||
| 125 | + | ||
| 126 | + PyObject *ret = PyObject_CallMethod(py_actor_instance, "on_actor_end_overlap", "O", (PyObject *)ue_get_python_wrapper(other)); | ||
| 127 | + if (!ret) { | ||
| 128 | + unreal_engine_py_log_error(); | ||
| 129 | + return; | ||
| 130 | + } | ||
| 131 | + Py_DECREF(ret); | ||
| 132 | + } | ||
| 133 | + | ||
| 134 | + void APyActor::PyOnActorHit(AActor *self_actor, AActor *other, FVector impulse_normal, const FHitResult &hit) | ||
| 135 | + { | ||
| 136 | + if (!py_actor_instance) | ||
| 137 | + return; | ||
| 138 | + | ||
| 139 | + PyObject *ret = PyObject_CallMethod(py_actor_instance, "on_actor_hit", "O(fff)(fff)(fff)", (PyObject *)ue_get_python_wrapper(other), impulse_normal.X, impulse_normal.Y, impulse_normal.Z, hit.ImpactPoint.X, hit.ImpactPoint.Y, hit.ImpactPoint.Z, hit.ImpactNormal.X, hit.ImpactNormal.Y, hit.ImpactNormal.Z); | ||
| 140 | + if (!ret) { | ||
| 141 | + unreal_engine_py_log_error(); | ||
| 142 | + return; | ||
| 143 | + } | ||
| 144 | + Py_DECREF(ret); | ||
| 145 | + } | ||
| 146 | + | ||
| 119 | 147 | void APyActor::PyOnActorClicked(AActor *touched_actor, FKey button_pressed) | |
| 120 | 148 | { | |
| 121 | 149 | if (!py_actor_instance) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,6 +47,12 @@ class APyActor : public AActor | |||
| 47 | 47 | UFUNCTION() | |
| 48 | 48 | void PyOnActorBeginOverlap(AActor *overlapped, AActor *other); | |
| 49 | 49 | ||
| 50 | + UFUNCTION() | ||
| 51 | + void PyOnActorEndOverlap(AActor *overlapped, AActor *other); | ||
| 52 | + | ||
| 53 | + UFUNCTION() | ||
| 54 | + void PyOnActorHit(AActor *self_actor, AActor *other, FVector normal_impulse, const FHitResult &hit); | ||
| 55 | + | ||
| 50 | 56 | UFUNCTION() | |
| 51 | 57 | void PyOnActorClicked(AActor *touched_actor, FKey button_pressed); | |
| 52 | 58 | }; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments