Logo
NativePhysicsNotifyTarget.h
1#pragma once
2
3namespace SharpKmyPhysics
4{
5 class NativePhysicsNotifyTarget : public kmyPhysics::PhysicsNotifyTarget
6 {
7 public:
8 void* operator new(size_t sz) {
9 return malloc(sz);
10 }
11 void operator delete(void* ptr) {
12 if (ptr)free(ptr);
13 }
14
15 NativePhysicsNotifyTarget(System::Runtime::InteropServices::GCHandle tgt);
16 void onUpdate()override;
17 void onStartContact(kmyPhysics::ContactInfo &c)override;
18 void onContact(kmyPhysics::ContactInfo &c)override;
19 void onEndContact(kmyPhysics::ContactInfo &c)override;
20 void onDestroy()override;
21
22 System::Runtime::InteropServices::GCHandle handle;
23 };
24
25 public ref class PhysicsNotifyTarget
26 {
27 public:
29 {
30 handle = System::Runtime::InteropServices::GCHandle::Alloc(this);
32 }
34 {
35 handle.Free();
36 delete nativetgt;
37 }
39 {
40
41 }
42 virtual void onUpdate() {}
46 virtual void onDestroy() {}
47
49 System::Runtime::InteropServices::GCHandle handle;
50 };
51
52}
Definition: NativePhysicsNotifyTarget.h:6
void onUpdate() override
Definition: NativePhysicsNotifyTarget.cpp:10
void onDestroy() override
Definition: NativePhysicsNotifyTarget.cpp:56
void onEndContact(kmyPhysics::ContactInfo &c) override
Definition: NativePhysicsNotifyTarget.cpp:43
void onContact(kmyPhysics::ContactInfo &c) override
Definition: NativePhysicsNotifyTarget.cpp:29
void onStartContact(kmyPhysics::ContactInfo &c) override
Definition: NativePhysicsNotifyTarget.cpp:16
NativePhysicsNotifyTarget(System::Runtime::InteropServices::GCHandle tgt)
Definition: NativePhysicsNotifyTarget.cpp:6
System::Runtime::InteropServices::GCHandle handle
Definition: NativePhysicsNotifyTarget.h:22
Definition: NativePhysicsNotifyTarget.h:26
~PhysicsNotifyTarget()
Definition: NativePhysicsNotifyTarget.h:38
PhysicsNotifyTarget()
Definition: NativePhysicsNotifyTarget.h:28
virtual void onStartContact(PhysicsNotifyTarget^ other, SharpKmyMath::Vector3 position, SharpKmyMath::Vector3 normal)
Definition: NativePhysicsNotifyTarget.h:43
virtual void onDestroy()
Definition: NativePhysicsNotifyTarget.h:46
virtual void onContact(PhysicsNotifyTarget^ other, SharpKmyMath::Vector3 position, SharpKmyMath::Vector3 normal)
Definition: NativePhysicsNotifyTarget.h:44
virtual void onUpdate()
Definition: NativePhysicsNotifyTarget.h:42
System::Runtime::InteropServices::GCHandle handle
Definition: NativePhysicsNotifyTarget.h:49
NativePhysicsNotifyTarget * nativetgt
Definition: NativePhysicsNotifyTarget.h:48
virtual void onEndContact(PhysicsNotifyTarget^ other, SharpKmyMath::Vector3 position, SharpKmyMath::Vector3 normal)
Definition: NativePhysicsNotifyTarget.h:45
Definition: Billboard.h:6
Definition: Vector3.h:8