From 49063b079e3eccbbc3f5330ee3e5e88bb7796f70 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 6 Dec 2021 09:57:05 +0800 Subject: *misc --- Client/Source/Phy2D/Collision/BoxCollider.cpp | 0 Client/Source/Phy2D/Collision/BoxCollider.h | 0 Client/Source/Phy2D/Collision/CapsuleCollider.cpp | 0 Client/Source/Phy2D/Collision/CapsuleCollider.h | 0 Client/Source/Phy2D/Collision/Collider.h | 0 Client/Source/Phy2D/Collision/PolygonCollider.cpp | 0 Client/Source/Phy2D/Collision/PolygonCollider.h | 0 Client/Source/Phy2D/Common/Type.h | 8 ++++++-- Client/Source/Phy2D/Documents/Phy2D.xlsx | Bin 15199 -> 489741 bytes Client/Source/Phy2D/Dynamic/RigidBody.cpp | 0 Client/Source/Phy2D/Dynamic/RigidBody.h | 23 ++++++++++++++++++++++ Client/Source/Phy2D/Dynamic/World.cpp | 0 Client/Source/Phy2D/Dynamic/World.h | 0 Client/Source/Phy2D/Joints/FixedJoint.cpp | 0 Client/Source/Phy2D/Joints/FixedJoint.h | 15 ++++++++++++++ Client/Source/Phy2D/Joints/Joint.cpp | 0 Client/Source/Phy2D/Joints/Joint.h | 11 +++++++++++ Client/Source/Phy2D/Phy2D.h | 1 + 18 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 Client/Source/Phy2D/Collision/BoxCollider.cpp create mode 100644 Client/Source/Phy2D/Collision/BoxCollider.h create mode 100644 Client/Source/Phy2D/Collision/CapsuleCollider.cpp create mode 100644 Client/Source/Phy2D/Collision/CapsuleCollider.h create mode 100644 Client/Source/Phy2D/Collision/Collider.h create mode 100644 Client/Source/Phy2D/Collision/PolygonCollider.cpp create mode 100644 Client/Source/Phy2D/Collision/PolygonCollider.h create mode 100644 Client/Source/Phy2D/Dynamic/RigidBody.cpp create mode 100644 Client/Source/Phy2D/Dynamic/RigidBody.h create mode 100644 Client/Source/Phy2D/Dynamic/World.cpp create mode 100644 Client/Source/Phy2D/Dynamic/World.h create mode 100644 Client/Source/Phy2D/Joints/FixedJoint.cpp create mode 100644 Client/Source/Phy2D/Joints/FixedJoint.h create mode 100644 Client/Source/Phy2D/Joints/Joint.cpp create mode 100644 Client/Source/Phy2D/Joints/Joint.h (limited to 'Client/Source/Phy2D') diff --git a/Client/Source/Phy2D/Collision/BoxCollider.cpp b/Client/Source/Phy2D/Collision/BoxCollider.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Client/Source/Phy2D/Collision/BoxCollider.h b/Client/Source/Phy2D/Collision/BoxCollider.h new file mode 100644 index 0000000..e69de29 diff --git a/Client/Source/Phy2D/Collision/CapsuleCollider.cpp b/Client/Source/Phy2D/Collision/CapsuleCollider.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Client/Source/Phy2D/Collision/CapsuleCollider.h b/Client/Source/Phy2D/Collision/CapsuleCollider.h new file mode 100644 index 0000000..e69de29 diff --git a/Client/Source/Phy2D/Collision/Collider.h b/Client/Source/Phy2D/Collision/Collider.h new file mode 100644 index 0000000..e69de29 diff --git a/Client/Source/Phy2D/Collision/PolygonCollider.cpp b/Client/Source/Phy2D/Collision/PolygonCollider.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Client/Source/Phy2D/Collision/PolygonCollider.h b/Client/Source/Phy2D/Collision/PolygonCollider.h new file mode 100644 index 0000000..e69de29 diff --git a/Client/Source/Phy2D/Common/Type.h b/Client/Source/Phy2D/Common/Type.h index c985d99..4c0088d 100644 --- a/Client/Source/Phy2D/Common/Type.h +++ b/Client/Source/Phy2D/Common/Type.h @@ -1,9 +1,13 @@ #include "fix32/fix32.hpp" +#include "libfixmath/libfixmath/fix16.hpp" namespace Phy2D { - using fixed = Fix32; + // Phy2D里的数值类型用real表示 + using real = Fix32; -} + // constants + static real kPI = real(1ll); +} \ No newline at end of file diff --git a/Client/Source/Phy2D/Documents/Phy2D.xlsx b/Client/Source/Phy2D/Documents/Phy2D.xlsx index 5b6ba93..c03b2b7 100644 Binary files a/Client/Source/Phy2D/Documents/Phy2D.xlsx and b/Client/Source/Phy2D/Documents/Phy2D.xlsx differ diff --git a/Client/Source/Phy2D/Dynamic/RigidBody.cpp b/Client/Source/Phy2D/Dynamic/RigidBody.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Client/Source/Phy2D/Dynamic/RigidBody.h b/Client/Source/Phy2D/Dynamic/RigidBody.h new file mode 100644 index 0000000..0301a05 --- /dev/null +++ b/Client/Source/Phy2D/Dynamic/RigidBody.h @@ -0,0 +1,23 @@ +#pragma once + +namespace Phy2D +{ + class Collider; + class BoxCollider; + + enum RigidBodyType + { + BodyType_Static, + BodyType_Kinematic, + BodyType_Dynamic, + }; + + // 可以被施加力、冲量、扭矩 + class RigidBody + { + public: + + private: + + }; +} \ No newline at end of file diff --git a/Client/Source/Phy2D/Dynamic/World.cpp b/Client/Source/Phy2D/Dynamic/World.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Client/Source/Phy2D/Dynamic/World.h b/Client/Source/Phy2D/Dynamic/World.h new file mode 100644 index 0000000..e69de29 diff --git a/Client/Source/Phy2D/Joints/FixedJoint.cpp b/Client/Source/Phy2D/Joints/FixedJoint.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Client/Source/Phy2D/Joints/FixedJoint.h b/Client/Source/Phy2D/Joints/FixedJoint.h new file mode 100644 index 0000000..585f502 --- /dev/null +++ b/Client/Source/Phy2D/Joints/FixedJoint.h @@ -0,0 +1,15 @@ +#pragma once + +#include "Joint.h" + + +namespace Phy2D +{ + + class FixedJoint : public Joint + { + public: + + }; + +} diff --git a/Client/Source/Phy2D/Joints/Joint.cpp b/Client/Source/Phy2D/Joints/Joint.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Client/Source/Phy2D/Joints/Joint.h b/Client/Source/Phy2D/Joints/Joint.h new file mode 100644 index 0000000..2a16888 --- /dev/null +++ b/Client/Source/Phy2D/Joints/Joint.h @@ -0,0 +1,11 @@ +#pragma once + +namespace Phy2D +{ + + class Joint + { + + }; + +} \ No newline at end of file diff --git a/Client/Source/Phy2D/Phy2D.h b/Client/Source/Phy2D/Phy2D.h index 2f41e80..723e729 100644 --- a/Client/Source/Phy2D/Phy2D.h +++ b/Client/Source/Phy2D/Phy2D.h @@ -1,5 +1,6 @@ #pragma once // 定点数的物理引擎 +// Φ2D -- cgit v1.1-26-g67d0