ios – Methods to create correct CollisionShapes for my 3D .USDZ mannequin?

[ad_1]

That is how my mannequin seems like and it is collision shapes (pink shade).

enter image description here

My downside with that is that when I attempt to faucet on the bottommost a part of my mannequin (the circle), I am unable to do this, as a result of the uppermost a part of the mannequin’s CollisionShape is in the way in which.

That is how i attempted to create an correct collisionShape for my mannequin:

@objc personal func placeObject() {
 
let entity = attempt! Entity.load(named: "Laryngeal")
let geom = entity.findEntity(named: "Geom")
 
for kids in geom!.kids {
  let childModelEntity = kids as! ModelEntity
  childModelEntity.collision = CollisionComponent(shapes: [ShapeResource.generateConvex(from: childModelEntity.model!.mesh)])
}
 
let modelEntity = ModelEntity()
modelEntity.addChild(entity)
 
let anchorEntity = AnchorEntity(airplane: .horizontal)
anchorEntity.addChild(modelEntity)

arView.installGestures([.all],for: modelEntity)

arView.scene.addAnchor(anchorEntity)
 

}

So my query is, how am i able to create essentially the most correct collisionShape which completely suits my mannequin?

[ad_2]

Leave a Reply