public Mesh3dInstance AddInstance(TransformationManager transformation, string name = "unnamed") { var i = new Mesh3dInstance(transformation, name); Instances.Add(i); return(i); }
public void IterationSortInstancesByDistanceFrom(Vector3 point, int iterations) { Mesh3dInstance tmp = null; var cnt = Instances.Count - 1;// this is ok for (int x = 0; x < iterations; x++) { for (int i = 0; i < cnt; i++) { float dst1 = (Instances[i].Transformation.Position - point).Length; float dst2 = (Instances[i + 1].Transformation.Position - point).Length; if (dst1 < dst2) { tmp = Instances[i]; Instances[i] = Instances[i + 1]; Instances[i + 1] = tmp; } } } }
public PhysicalBody CreateBody(float mass, Mesh3dInstance mesh, CollisionShape shape) { return CreateBody(mass, mesh.Transformation, shape); }
public PhysicalBody CreateBody(float mass, Mesh3dInstance mesh, CollisionShape shape) { return(CreateBody(mass, mesh.Transformation, shape)); }
public void AddInstance(Mesh3dInstance instance) { Instances.Add(instance); }
// Instance Managing public void RemoveInstance(Mesh3dInstance instance) { Instances.Remove(instance); }
public Mesh3dInstance AddInstance(TransformationManager transformation, string name = "unnamed") { var i = new Mesh3dInstance(transformation, name); Instances.Add(i); return i; }