Logo
ModelInstance.h
1#pragma once
2
3#include "Types.h"
4
5#include "gfx/mdl/ModelData.h"
6#include "gfx/Material.h"
7
8namespace XXSharpKmyPhysics
9{
10 ref class PhysicsObject;
11}
12
13namespace XXSharpKmyGfx
14{
15 ref class MaterialInstance;
16 ref class NodeInstance;
17
18 private ref class ModelInstance
19 {
20 public:
21 kmyGfx::ModelInstance *obj2 = nullptr;
22 ModelData^ mdl = nullptr;
23
24 ModelInstance(ModelData^ data, array<Material^> ^list, System::Guid stampGUID);
25 ModelInstance(kmyGfx::ModelInstance* ptr);
26 ~ModelInstance();
27
28 ModelData ^getModel();
29 kmyGfx::ModelInstance* getNativeModelInstance() { return obj2; }
30
31 void setVisibility(bool flg);
32 void setDisplayID(unsigned int id);
33 void setPickupID(unsigned short id);
34 void setOverrideColor(float r, float g, float b, float a);
35 void setOpacityMultiplier(float p);
36 void setDrawHidden(bool flg);
37 void buildingLightOn(bool flg);
38 void enableFrustumCulling(bool flg);
39
40 void setIgnoreMotion(int channel, System::Collections::Generic::List<System::String^> ^list);
41 void addMotion(System::String ^name, ModelData ^motion, bool loop, bool useCombine);
42 void addMotion(System::String ^name, ModelData ^motion, bool loop, bool useCombine, System::String ^stackName);
43 void addMotion(System::String ^name, ModelData ^motion, float start, float end, bool loop, bool useCombine, System::String ^stackName);
44 void clearMotion();
45 void removeAnimatedTransform(bool clearAnimation);
46 void playMotion(System::String^ name, float blendTime, bool force);
47 void playMotion(System::String^ name, float blendTime) { playMotion(name, blendTime, false); }
48 void setMorphBlend(System::String ^name, float blend);
49 float getMorphBlend(System::String^ name);
50 bool containsMotion(System::String ^name);
51 int getMotionLoopCount();
52 System::Collections::Generic::List<System::String^>^ getMotionNameList();
53 System::Collections::Generic::List<System::String^>^ getMorphNameList();
54 System::Guid getStampGUID();
55
56 XXSharpKmyMath::Matrix4 getNodeMatrix(System::String ^name);
57 void setNodeMatrix(System::String ^name, XXSharpKmyMath::Matrix4 matrix);
58 NodeInstance^ getRootNode();
59
60 int getMaterialCount();
61 MaterialInstance^ getMaterialInstance(unsigned int idx);
62 void setMaterial(int index, Material^ mtl);
63
64 void getBound(XXSharpKmyMath::Vector3% min, XXSharpKmyMath::Vector3% max);
65 void stopPickup(bool flg);
66
67 XXSharpKmyPhysics::PhysicsObject^ getPhysicsObject();
68 void clearNodePosturePhysicsOverrideFlag();
69 float minX = 0, minY = 0, minZ = 0;
70 float maxX = 0, maxY = 0, maxZ = 0;
71
72 static System::Collections::Generic::List<ModelInstance^>^ getModelInstanceListByStampGUID(System::Guid guid);
73
74#ifdef KMY_USE_VRM
75 void vrmTeleportRequest();
76#endif
77 private:
78 };
79
80}