I want to check the collision of one model with another model.I use collision check function as follows:
private void builtBoudingSphere()
BoundingSphere sphere = new BoundingSphere(Vector3.Zero, 0);
foreach (ModelMesh mesh in Model.Meshes)
BoundingSphere tranformed = mesh.BoundingSphere.Transform(modelTranforms[mesh.ParentBone.Index]);
sphere = BoundingSphere.CreateMerged(sphere, tranformed);
this.boudingSphere = sphere;
public bool CheckColision(CModel otherModel)
public BoundingSphere BoudingSphere
Matrix worldTranform = Matrix.CreateScale(Scale) * Matrix.CreateTranslation(Positon);
BoundingSphere transformed = boudingSphere;
transformed = transformed.Transform(worldTranform);
The function CheckCollion is great with sphere model but not good with cube or any models because I'm use check BoudingSphere. Can help me check accurate collison? Especially check collision between cubes
Plan to split into smaller pieces to review collision.It can be a solution acceptable. Use BoudingSphere to check that pieces.
Example: the airplane, split: head airplane, tail airplane, wing airplane. And check each part for collision.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)