Logo
PhysicsObject.h
1#pragma once
2
3#include "Math/Matrix4.h"
4#include "math/Vector3.h"
5#include "math/Quat.h"
6
7namespace kmyPhysics {
8 class PhysicsObject;
9}
10
11namespace SharpKmyPhysics
12{
13 ref class RigidBody;
14 ref class Collider;
15
16 public ref class PhysicsObject
17 {
18 kmyPhysics::PhysicsObject* obj = nullptr;
19 bool ownptr = false;
20
21 public:
23 PhysicsObject(kmyPhysics::PhysicsObject* o);
25 void clearPhysics() {
26 if (obj)obj->clearPhysics();
27 }
28 void setFellowId(int id) {
29 if (obj)obj->setFellowId(id);
30 }
31
37
39 void addRigidBody(SharpKmyPhysics::RigidBody^ rb, System::String ^nodename, SharpKmyMath::Matrix4 offset, System::String^ objname, bool controlRigidBody);
40 void addCollider(SharpKmyPhysics::Collider^ cd, System::String ^nodename, SharpKmyMath::Matrix4 offset, System::String^ objname);
41 void addSixDofConstraint(System::String^ nameA, System::String^ nameB,
42 SharpKmyMath::Vector3 worldPivot,
43 SharpKmyMath::Vector3 lowerSlideLimit,
44 SharpKmyMath::Vector3 upperSlideLimit,
45 SharpKmyMath::Vector3 lowerAngularLimit,
46 SharpKmyMath::Vector3 upperAngularLimit,
47 array<bool> ^spring,
48 array<float> ^stiffnes,
49 array<float> ^damping);
51
52 SharpKmyMath::Matrix4 getNodeWorldMatrix(System::String^ name);
53 SharpKmyPhysics::RigidBody^ getRigidBody(System::String^ name);
54 SharpKmyPhysics::Collider^ getCollider(System::String^ name);
55
56 void setDisplayID(u32 displayID) { if (obj)obj->setDisplayID(displayID); }
57 u32 getDisplayID() { return obj ? obj->getDisplayID() : 0; }
58 void setParent(PhysicsObject^ parent, System::String^ nodename);
59 void updateMatrix();
61
62 void enable();
63 void disable();
64 void activate();
65 bool isEnabled();
66 };
67}
68
Definition: Matrix4.h:10
Definition: Collider.h:8
Definition: PhysicsObject.h:17
void setParent(PhysicsObject^ parent, System::String^ nodename)
Definition: PhysicsObject.cpp:153
void setRigidBody(SharpKmyPhysics::RigidBody^ rb, SharpKmyMath::Matrix4 offset)
Definition: PhysicsObject.cpp:24
void resetRigidBodyPosition()
Definition: PhysicsObject.cpp:110
void addRigidBody(SharpKmyPhysics::RigidBody^ rb, System::String ^nodename, SharpKmyMath::Matrix4 offset, System::String^ objname, bool controlRigidBody)
Definition: PhysicsObject.cpp:33
void addSixDofConstraint(System::String^ nameA, System::String^ nameB, SharpKmyMath::Vector3 worldPivot, SharpKmyMath::Vector3 lowerSlideLimit, SharpKmyMath::Vector3 upperSlideLimit, SharpKmyMath::Vector3 lowerAngularLimit, SharpKmyMath::Vector3 upperAngularLimit, array< bool > ^spring, array< float > ^stiffnes, array< float > ^damping)
Definition: PhysicsObject.cpp:53
kmyPhysics::PhysicsObject * obj
Definition: PhysicsObject.h:18
void addCollider(SharpKmyPhysics::Collider^ cd, System::String ^nodename, SharpKmyMath::Matrix4 offset, System::String^ objname)
Definition: PhysicsObject.cpp:43
SharpKmyMath::Matrix4 getNodeWorldMatrix(System::String^ name)
Definition: PhysicsObject.cpp:117
bool isEnabled()
Definition: PhysicsObject.cpp:228
~PhysicsObject()
Definition: PhysicsObject.cpp:16
void setLocalMatrixWithoutScale(SharpKmyMath::Matrix4 mtx)
Definition: PhysicsObject.cpp:179
void disable()
Definition: PhysicsObject.cpp:223
u32 getDisplayID()
Definition: PhysicsObject.h:57
void setTranslate(SharpKmyMath::Vector3 trans)
Definition: PhysicsObject.cpp:164
void enable()
Definition: PhysicsObject.cpp:218
void setFellowId(int id)
Definition: PhysicsObject.h:28
void clearPhysics()
Definition: PhysicsObject.h:25
SharpKmyPhysics::Collider getCollider(System::String^ name)
Definition: PhysicsObject.cpp:137
void setDisplayID(u32 displayID)
Definition: PhysicsObject.h:56
SharpKmyPhysics::RigidBody getRigidBody(System::String^ name)
Definition: PhysicsObject.cpp:128
bool ownptr
Definition: PhysicsObject.h:19
PhysicsObject()
Definition: PhysicsObject.cpp:5
void setLocalMatrix(SharpKmyMath::Matrix4 mtx)
Definition: PhysicsObject.cpp:193
void setScale(SharpKmyMath::Vector3 scale)
Definition: PhysicsObject.cpp:174
void updateMatrix()
Definition: PhysicsObject.cpp:160
void activate()
Definition: PhysicsObject.cpp:147
SharpKmyMath::Matrix4 getWorldMatrix()
Definition: PhysicsObject.cpp:209
void setRotate(SharpKmyMath::Quat q)
Definition: PhysicsObject.cpp:169
Definition: RigidBody.h:9
Definition: Billboard.h:6
Definition: PhysicsNode.h:7
Definition: Quat.h:5
Definition: Vector3.h:8