Is there anyway to know the size of the ModelEntity as SIMD3? Once, I get the size, I want to pass it to the CollisionComponent.
let box = ModelEntity(mesh: MeshResource.generateBox(size: 0.2),
materials: [SimpleMaterial(color: .green, isMetallic: true)])
box.position.y = 0.3
box.generateCollisionShapes(recursive: true)
box.physicsBody = PhysicsBodyComponent(massProperties: .default,
material: .default,
mode: .dynamic)
// I know I can use the following
box.collision = CollisionComponent(shapes: [.generateBox(size: [0.2,0.2,0.2])],
mode: .trigger,
filter: .sensor)
// but why not just pass the size of the box I created earlier.
box.collision = CollisionComponent(shapes: [PASS BOX SIZE HERE],
mode: .trigger,
filter: .sensor)