Skip to content

Commit 1b916db

Browse files
committed
phys::Constraint work
1 parent 6118d22 commit 1b916db

File tree

9 files changed

+599
-28
lines changed

9 files changed

+599
-28
lines changed

data/uking_functions.csv

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -82486,32 +82486,32 @@ Address,Quality,Size,Name
8248682486
0x0000007100f69d2c,U,000004,nullsub_4196
8248782487
0x0000007100f69d30,U,000004,nullsub_4197
8248882488
0x0000007100f69d34,U,000004,nullsub_4198
82489-
0x0000007100f69d38,U,000180,Constraint::ctor
82489+
0x0000007100f69d38,M,000180,_ZN4ksys4phys10ConstraintC1EP21hkpConstraintInstancePNS0_9RigidBodyES5_P13hkQuaternionfPv
8249082490
0x0000007100f69dec,U,000376,Constraint::dtor
8249182491
0x0000007100f69f64,U,000036,Constraint::dtorDelete
8249282492
0x0000007100f69f88,U,000036,getPhysicsMemSysField190Or
8249382493
0x0000007100f69fac,U,000044,
8249482494
0x0000007100f69fd8,U,000024,
82495-
0x0000007100f69ff0,U,000132,
82496-
0x0000007100f6a074,U,000136,
82497-
0x0000007100f6a0fc,U,000132,
82498-
0x0000007100f6a180,U,000088,Constraint::x
82499-
0x0000007100f6a1d8,U,000068,
82500-
0x0000007100f6a21c,U,000012,
82501-
0x0000007100f6a228,U,000184,
82502-
0x0000007100f6a2e0,U,000032,
82503-
0x0000007100f6a300,U,000372,
82504-
0x0000007100f6a474,U,000340,
82505-
0x0000007100f6a5c8,U,000212,
82506-
0x0000007100f6a69c,U,000092,
82507-
0x0000007100f6a6f8,U,000372,
82495+
0x0000007100f69ff0,O,000132,_ZN4ksys4phys10Constraint14sub_7100F69FF0Ev
82496+
0x0000007100f6a074,O,000136,_ZN4ksys4phys10Constraint14sub_7100F6A074Ev
82497+
0x0000007100f6a0fc,O,000132,_ZN4ksys4phys10Constraint20setConstraintWeightsEff
82498+
0x0000007100f6a180,O,000088,_ZN4ksys4phys10Constraint23allocConstraintListenerEPN4sead4HeapE
82499+
0x0000007100f6a1d8,O,000068,_ZN4ksys4phys10Constraint12unlinkIf2SetEv
82500+
0x0000007100f6a21c,O,000012,_ZN4ksys4phys10Constraint6unlinkEv
82501+
0x0000007100f6a228,m,000184,_ZN4ksys4phys10Constraint4wakeEv
82502+
0x0000007100f6a2e0,O,000032,_ZNK4ksys4phys10Constraint15checkIsSleepingEv
82503+
0x0000007100f6a300,O,000372,_ZN4ksys4phys10Constraint12setRigidBodyEPNS0_9RigidBodyES3_
82504+
0x0000007100f6a474,m,000340,_ZN4ksys4phys10Constraint10addToWorldEb
82505+
0x0000007100f6a5c8,m,000212,_ZN4ksys4phys10Constraint8calcMassEv
82506+
0x0000007100f6a69c,O,000092,_ZN4ksys4phys10Constraint14clearRigidBodyENS1_15ConstrainedTypeE
82507+
0x0000007100f6a6f8,m,000372,_ZN4ksys4phys10Constraint23unlinkConstrainedBodiesEbb
8250882508
0x0000007100f6a86c,O,000020,_ZN4ksys4phys10Constraint7destroyEPS1_
82509-
0x0000007100f6a880,U,000012,
82510-
0x0000007100f6a88c,U,000160,
82511-
0x0000007100f6a92c,U,000168,
82512-
0x0000007100f6a9d4,U,000208,
82513-
0x0000007100f6aaa4,U,000308,
82514-
0x0000007100f6abd8,U,000044,Constraint::x_0
82509+
0x0000007100f6a880,O,000012,_ZNK4ksys4phys10Constraint10isFlag2SetEv
82510+
0x0000007100f6a88c,O,000160,_ZN4ksys4phys10Constraint10initParentEPNS0_9RigidBodyE
82511+
0x0000007100f6a92c,O,000168,_ZN4ksys4phys10Constraint9initChildEPNS0_9RigidBodyE
82512+
0x0000007100f6a9d4,O,000208,_ZN4ksys4phys10Constraint13initWithGroupEPNS0_28StaticCompoundRigidBodyGroupE
82513+
0x0000007100f6aaa4,m,000308,_ZN4ksys4phys10Constraint10initBodiesEPNS0_9RigidBodyES3_
82514+
0x0000007100f6abd8,W,000044,_ZNK4ksys4phys10Constraint12getRigidBodyEi
8251582515
0x0000007100f6ac04,U,000092,
8251682516
0x0000007100f6ac60,U,000008,
8251782517
0x0000007100f6ac68,U,000064,
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#pragma once
2+
3+
#include <Havok/Common/Base/Types/hkBaseTypes.h>
4+
5+
class hkpConstraintInstance;
6+
class hkpWorld;
7+
8+
struct hkpConstraintBrokenEvent {
9+
enum EventSource {
10+
EVENT_SOURCE_UNKNOWN,
11+
EVENT_SOURCE_BREAKABLE_CONSTRAINT,
12+
EVENT_SOURCE_FLEXIBLE_JOINT,
13+
};
14+
15+
hkpConstraintBrokenEvent(hkpWorld* world, hkpConstraintInstance* i, EventSource es)
16+
: m_world(world), m_constraintInstance(i), m_eventSource(es), m_eventSourceDetails(0),
17+
m_constraintBroken(true), m_actualImpulse(0.0f), m_impulseLimit(0.0f) {}
18+
19+
hkpWorld* m_world;
20+
hkpConstraintInstance* m_constraintInstance;
21+
22+
hkEnum<EventSource, hkUint8> m_eventSource;
23+
hkUint8 m_eventSourceDetails;
24+
hkBool m_constraintBroken;
25+
hkReal m_actualImpulse;
26+
hkReal m_impulseLimit;
27+
};
28+
29+
class hkpConstraintListener {
30+
public:
31+
virtual ~hkpConstraintListener() {}
32+
33+
virtual void constraintAddedCallback(hkpConstraintInstance* constraint) {}
34+
35+
virtual void constraintRemovedCallback(hkpConstraintInstance* constraint) {}
36+
37+
virtual void constraintDeletedCallback(hkpConstraintInstance* constraint) {}
38+
39+
virtual void constraintBreakingCallback(const hkpConstraintBrokenEvent& event) {}
40+
};

src/KingSystem/Physics/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ target_sources(uking PRIVATE
88

99
Constraint/physConstraint.cpp
1010
Constraint/physConstraint.h
11+
Constraint/physConstraintListener.h
1112

1213
Ragdoll/physRagdollConfig.cpp
1314
Ragdoll/physRagdollConfig.h
@@ -194,4 +195,4 @@ target_sources(uking PRIVATE
194195
physLayerMaskBuilder.h
195196
physMaterialMask.cpp
196197
physMaterialMask.h
197-
)
198+
)

0 commit comments

Comments
 (0)