Skip to content

Commit a662389

Browse files
committed
Automatic filling source entity of body3d shape
1 parent 92a3913 commit a662389

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

editor/window/Properties.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6293,9 +6293,20 @@ void editor::Properties::drawBody3DComponent(ComponentType cpType, SceneProject*
62936293
shape.type = (Shape3DType)createShape3DType;
62946294
if (shape.type == Shape3DType::MESH){
62956295
shape.source = Shape3DSource::ENTITY_MESH;
6296+
if (sceneProject->scene->findComponent<MeshComponent>(entity)){
6297+
shape.sourceEntity = entity;
6298+
}
6299+
}else if (shape.type == Shape3DType::CONVEX_HULL){
6300+
shape.source = Shape3DSource::ENTITY_MESH;
6301+
if (sceneProject->scene->findComponent<MeshComponent>(entity)){
6302+
shape.sourceEntity = entity;
6303+
}
62966304
}else if (shape.type == Shape3DType::HEIGHTFIELD){
62976305
shape.source = Shape3DSource::ENTITY_HEIGHTFIELD;
62986306
shape.samplesSize = 256;
6307+
if (sceneProject->scene->findComponent<TerrainComponent>(entity)){
6308+
shape.sourceEntity = entity;
6309+
}
62996310
}
63006311

63016312
size_t shapeIdx = bodyComp->numShapes;

0 commit comments

Comments
 (0)