public static YnEntity3D[] CubeCollide(BaseCamera camera, YnGroup3D group) { List <YnEntity3D> collides = new List <YnEntity3D>(); int groupSize = group.Count; for (int i = 0; i < groupSize; i++) { if (camera.BoundingBox.Intersects(group[i].BoundingBox)) { collides.Add(group[i]); } } return(collides.ToArray()); }
/// <summary> /// Test if the model colliding another objects with there bounding box /// </summary> /// <param name="model">The model</param> /// <param name="group">A collection of models</param> /// <returns>Array of models that collides with model</returns> public static YnMeshModel[] CubeCollide(YnMeshModel model, YnGroup3D group) { List <YnMeshModel> collides = new List <YnMeshModel>(); int groupSize = group.Count; for (int i = 0; i < groupSize; i++) { if (group[i] is YnMeshModel) { if (CubeCollide(model, group[i] as YnMeshModel)) { collides.Add(group[i] as YnMeshModel); } } } return(collides.ToArray()); }
/// <summary> /// Check if the mouse cursor collide with a group of object on the scene /// </summary> /// <param name="camera">Active camera</param> /// <param name="group">Group of object</param> /// <returns></returns> public static CollideInformation[] MouseCollideWithGroup(BaseCamera camera, YnGroup3D group) { List <CollideInformation> collides = new List <CollideInformation>(); int groupSize = group.Count; for (int i = 0; i < groupSize; i++) { float distance = MouseCollideWithObject(camera, group[i]); if (distance > -1) { collides.Add(new CollideInformation() { Object3D = group[i], Distance = distance }); } } return(collides.ToArray()); }
/// <summary> /// Check if the mouse cursor collide with a group of object on the scene /// </summary> /// <param name="camera">Active camera</param> /// <param name="group">Group of object</param> /// <returns></returns> public static CollideInformation[] MouseCollideWithGroup(BaseCamera camera, YnGroup3D group) { List<CollideInformation> collides = new List<CollideInformation>(); int groupSize = group.Count; for (int i = 0; i < groupSize; i++) { float distance = MouseCollideWithObject(camera, group[i]); if (distance > -1) collides.Add(new CollideInformation() { Object3D = group[i], Distance = distance }); } return collides.ToArray(); }
public static YnEntity3D[] CubeCollide(BaseCamera camera, YnGroup3D group) { List<YnEntity3D> collides = new List<YnEntity3D>(); int groupSize = group.Count; for (int i = 0; i < groupSize; i++) { if (camera.BoundingBox.Intersects(group[i].BoundingBox)) collides.Add(group[i]); } return collides.ToArray(); }
/// <summary> /// Test if the model colliding another objects with there bounding box /// </summary> /// <param name="model">The model</param> /// <param name="group">A collection of models</param> /// <returns>Array of models that collides with model</returns> public static YnMeshModel[] CubeCollide(YnMeshModel model, YnGroup3D group) { List<YnMeshModel> collides = new List<YnMeshModel>(); int groupSize = group.Count; for (int i = 0; i < groupSize; i++) { if (group[i] is YnMeshModel) { if (CubeCollide(model, group[i] as YnMeshModel)) collides.Add(group[i] as YnMeshModel); } } return collides.ToArray(); }