File tree Expand file tree Collapse file tree 5 files changed +40
-6
lines changed Expand file tree Collapse file tree 5 files changed +40
-6
lines changed Original file line number Diff line number Diff line change @@ -393,6 +393,12 @@ void SceneMesh::Render() {
393393 }
394394 }
395395
396+ bool useVertexBuffer = this ->useVertexBuffer ;
397+
398+ if (useVertexBuffer && skeleton && !sendBoneMatricesToMaterial) {
399+ useVertexBuffer = false ;
400+ }
401+
396402 if (useVertexBuffer) {
397403 VertexBuffer *vb = mesh->getVertexBuffer ();
398404 if (vb){
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ class EntityEditorPropertyView : public UIElement {
6161 SceneCurveSheet *curveSheet;
6262 CameraSheet *cameraSheet;
6363 EntityPropSheet *propSheet;
64+ SceneMeshSheet *sceneMeshSheet;
6465
6566 ShaderTexturesSheet *shaderTexturesSheet;
6667 ShaderOptionsSheet *shaderOptionsSheet;
Original file line number Diff line number Diff line change @@ -722,7 +722,7 @@ class SceneLightSheet : public PropSheet {
722722 SliderProp *shadowMapFOVProp;
723723 NumberProp *shadowResolutionProp;
724724};
725- /*
725+
726726class SceneMeshSheet : public PropSheet {
727727 public:
728728 SceneMeshSheet ();
@@ -733,9 +733,10 @@ class SceneMeshSheet : public PropSheet {
733733
734734 private:
735735
736+ BoolProp *gpuSkinningProp;
736737 SceneMesh *sceneMesh;
737738};
738- */
739+
739740
740741class ScenePrimitiveSheet : public PropSheet {
741742public:
Original file line number Diff line number Diff line change @@ -70,6 +70,10 @@ EntityEditorPropertyView::EntityEditorPropertyView() : UIElement() {
7070 primitiveSheet = new ScenePrimitiveSheet ();
7171 entityProps->addPropSheet (primitiveSheet);
7272 primitiveSheet->addEventListener (this , PropEvent::EVENT_PROP_CHANGE);
73+
74+ sceneMeshSheet = new SceneMeshSheet ();
75+ entityProps->addPropSheet (sceneMeshSheet);
76+ sceneMeshSheet->addEventListener (this , PropEvent::EVENT_PROP_CHANGE);
7377
7478 soundSheet = new SoundSheet ();
7579 entityProps->addPropSheet (soundSheet);
@@ -165,7 +169,9 @@ void EntityEditorPropertyView::setEntity(Entity *entity) {
165169 } else {
166170 primitiveSheet->setScenePrimitive (NULL );
167171 }
168-
172+
173+ sceneMeshSheet->setSceneMesh (sceneMesh);
174+
169175 SceneSound *sound = dynamic_cast <SceneSound*>(entity);
170176 soundSheet->setSound (sound);
171177
Original file line number Diff line number Diff line change @@ -2838,24 +2838,44 @@ void SceneLightSheet::handleEvent(Event *event) {
28382838 }
28392839 PropSheet::handleEvent (event);
28402840}
2841- /*
2842- SceneMeshSheet::SceneMeshSheet() : PropSheet("MESH FILE ", "scene_mesh_file ") {
2841+
2842+ SceneMeshSheet::SceneMeshSheet () : PropSheet(" SCENE MESH " , " scene_mesh " ) {
28432843 enabled = false ;
28442844 sceneMesh = NULL ;
2845+
2846+ gpuSkinningProp = new BoolProp (" GPU Skinning" );
2847+ addProp (gpuSkinningProp);
28452848}
28462849
28472850SceneMeshSheet::~SceneMeshSheet () {
28482851
28492852}
28502853
28512854void SceneMeshSheet::setSceneMesh (SceneMesh *mesh) {
2855+ this ->sceneMesh = mesh;
28522856
2857+ if (sceneMesh) {
2858+
2859+ gpuSkinningProp->set (sceneMesh->sendBoneMatricesToMaterial );
2860+
2861+ enabled = true ;
2862+ } else {
2863+ enabled = false ;
2864+ }
28532865}
28542866
28552867void SceneMeshSheet::handleEvent (Event *event) {
2868+ if (!sceneMesh) {
2869+ return ;
2870+ }
28562871
2872+ if (event->getDispatcher () == gpuSkinningProp) {
2873+ sceneMesh->sendBoneMatricesToMaterial = gpuSkinningProp->get ();
2874+ }
2875+
2876+ PropSheet::handleEvent (event);
28572877}
2858- */
2878+
28592879
28602880ScenePrimitiveSheet::ScenePrimitiveSheet () : PropSheet(" PRIMITIVE" , " scene_primitive" ) {
28612881 typeProp = new ComboProp (" Type" );
You can’t perform that action at this time.
0 commit comments