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 SharpKmyPhysics
9{
10 ref class PhysicsObject;
11}
12
13namespace SharpKmyGfx
14{
15 ref class MaterialInstance;
16 ref class NodeInstance;
17
18 public 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);
27
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);
52 System::Collections::Generic::List<System::String^>^ getMotionNameList();
53 System::Collections::Generic::List<System::String^>^ getMorphNameList();
54 System::Guid getStampGUID();
55
56 SharpKmyMath::Matrix4 getNodeMatrix(System::String ^name);
57 void setNodeMatrix(System::String ^name, SharpKmyMath::Matrix4 matrix);
59
60 int getMaterialCount();
61 MaterialInstance^ getMaterialInstance(unsigned int idx);
62 void setMaterial(int index, Material^ mtl);
63
65 void stopPickup(bool flg);
66
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 private:
75 };
76
77}
Definition: Material.h:6
Definition: MaterialInstance.h:6
Definition: ModelData.h:17
Definition: ModelInstance.h:19
~ModelInstance()
Definition: ModelInstance.cpp:43
void clearNodePosturePhysicsOverrideFlag()
Definition: ModelInstance.cpp:392
void buildingLightOn(bool flg)
Definition: ModelInstance.cpp:366
void clearMotion()
Definition: ModelInstance.cpp:137
float minX
Definition: ModelInstance.h:69
void playMotion(System::String^ name, float blendTime)
Definition: ModelInstance.h:47
void removeAnimatedTransform(bool clearAnimation)
Definition: ModelInstance.cpp:144
SharpKmyMath::Matrix4 getNodeMatrix(System::String ^name)
Definition: ModelInstance.cpp:283
static System::Collections::Generic::List< ModelInstance^> getModelInstanceListByStampGUID(System::Guid guid)
Definition: ModelInstance.cpp:400
MaterialInstance getMaterialInstance(unsigned int idx)
Definition: ModelInstance.cpp:320
void addMotion(System::String ^name, ModelData ^motion, bool loop, bool useCombine)
Definition: ModelInstance.cpp:97
kmyGfx::ModelInstance * obj2
Definition: ModelInstance.h:21
ModelInstance(ModelData^ data, array< Material^> ^list, System::Guid stampGUID)
Definition: ModelInstance.cpp:7
kmyGfx::ModelInstance * getNativeModelInstance()
Definition: ModelInstance.h:29
void enableFrustumCulling(bool flg)
Definition: ModelInstance.cpp:373
int getMotionLoopCount()
Definition: ModelInstance.cpp:265
void setDrawHidden(bool flg)
Definition: ModelInstance.cpp:244
float maxY
Definition: ModelInstance.h:70
void setOpacityMultiplier(float p)
Definition: ModelInstance.cpp:258
void setNodeMatrix(System::String ^name, SharpKmyMath::Matrix4 matrix)
Definition: ModelInstance.cpp:299
void setMaterial(int index, Material^ mtl)
Definition: ModelInstance.cpp:330
System::Collections::Generic::List< System::String^> getMorphNameList()
Definition: ModelInstance.cpp:214
void setVisibility(bool flg)
Definition: ModelInstance.cpp:50
void getBound(SharpKmyMath::Vector3% min, SharpKmyMath::Vector3% max)
Definition: ModelInstance.cpp:346
void stopPickup(bool flg)
Definition: ModelInstance.cpp:339
void setPickupID(unsigned short id)
Definition: ModelInstance.cpp:71
ModelData getModel()
Definition: ModelInstance.cpp:57
bool containsMotion(System::String ^name)
Definition: ModelInstance.cpp:185
void setIgnoreMotion(int channel, System::Collections::Generic::List< System::String^> ^list)
Definition: ModelInstance.cpp:78
float minZ
Definition: ModelInstance.h:69
float minY
Definition: ModelInstance.h:69
void setMorphBlend(System::String ^name, float blend)
Definition: ModelInstance.cpp:161
SharpKmyPhysics::PhysicsObject getPhysicsObject()
Definition: ModelInstance.cpp:380
void setOverrideColor(float r, float g, float b, float a)
Definition: ModelInstance.cpp:251
int getMaterialCount()
Definition: ModelInstance.cpp:312
System::Guid getStampGUID()
Definition: ModelInstance.cpp:232
void playMotion(System::String^ name, float blendTime, bool force)
float maxX
Definition: ModelInstance.h:70
float getMorphBlend(System::String^ name)
Definition: ModelInstance.cpp:172
float maxZ
Definition: ModelInstance.h:70
void setDisplayID(unsigned int id)
Definition: ModelInstance.cpp:64
ModelData mdl
Definition: ModelInstance.h:22
NodeInstance getRootNode()
Definition: ModelInstance.cpp:273
System::Collections::Generic::List< System::String^> getMotionNameList()
Definition: ModelInstance.cpp:196
Definition: NodeInstance.h:6
Definition: Matrix4.h:12
Definition: PhysicsObject.h:17
Definition: Asset.h:4
Definition: Billboard.h:6
Definition: Vector3.h:7