/// <summary> /// Separa los modelos en dos listas, segun el testo contra el plano de corte /// </summary> private void splitByPlane(TGCPlane cutPlane, List <TgcMesh> modelos, List <TgcMesh> possitiveList, List <TgcMesh> negativeList) { TgcCollisionUtils.PlaneBoxResult c; foreach (var modelo in modelos) { c = TgcCollisionUtils.classifyPlaneAABB(cutPlane, modelo.BoundingBox); //possitive side if (c == TgcCollisionUtils.PlaneBoxResult.IN_FRONT_OF) { possitiveList.Add(modelo); } //negative side else if (c == TgcCollisionUtils.PlaneBoxResult.BEHIND) { negativeList.Add(modelo); } //both sides else { possitiveList.Add(modelo); negativeList.Add(modelo); } } }
/// <summary> /// Separa los objetos en dos listas, segun el testo contra el plano de corte /// </summary> private void splitByPlane(TGCPlane cutPlane, List <StaticObject> objetos, List <StaticObject> possitiveList, List <StaticObject> negativeList) { TgcCollisionUtils.PlaneBoxResult c; foreach (var objeto in objetos) { c = TgcCollisionUtils.classifyPlaneAABB(cutPlane, objeto.Meshes[0].BoundingBox); // TODO CALCULAR BOUNDING BOX DEL GAMEOBJECT //possitive side if (c == TgcCollisionUtils.PlaneBoxResult.IN_FRONT_OF) { possitiveList.Add(objeto); } //negative side else if (c == TgcCollisionUtils.PlaneBoxResult.BEHIND) { negativeList.Add(objeto); } //both sides else { possitiveList.Add(objeto); negativeList.Add(objeto); } } }
public bool IsColliding(Vehicle car) { foreach (TGCVector3 point in car.mesh.BoundingBox.computeCorners()) { if (!GlobalConcepts.GetInstance().IsInFrontOf(point, this.realPlane)) { return(true); } } return((int)TgcCollisionUtils.classifyPlaneAABB(this.realPlane, car.mesh.BoundingBox) != 1); }