Exemple #1
0
        public Mesh3dInstance AddInstance(TransformationManager transformation, string name = "unnamed")
        {
            var i = new Mesh3dInstance(transformation, name);

            Instances.Add(i);
            return(i);
        }
Exemple #2
0
        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;
                    }
                }
            }
        }
Exemple #3
0
 public PhysicalBody CreateBody(float mass, Mesh3dInstance mesh, CollisionShape shape)
 {
     return CreateBody(mass, mesh.Transformation, shape);
 }
Exemple #4
0
 public PhysicalBody CreateBody(float mass, Mesh3dInstance mesh, CollisionShape shape)
 {
     return(CreateBody(mass, mesh.Transformation, shape));
 }
Exemple #5
0
 public void AddInstance(Mesh3dInstance instance)
 {
     Instances.Add(instance);
 }
Exemple #6
0
 // Instance Managing
 public void RemoveInstance(Mesh3dInstance instance)
 {
     Instances.Remove(instance);
 }
Exemple #7
0
 // Instance Managing
 public void RemoveInstance(Mesh3dInstance instance)
 {
     Instances.Remove(instance);
 }
Exemple #8
0
 public Mesh3dInstance AddInstance(TransformationManager transformation, string name = "unnamed")
 {
     var i = new Mesh3dInstance(transformation, name);
     Instances.Add(i);
     return i;
 }
Exemple #9
0
 public void AddInstance(Mesh3dInstance instance)
 {
     Instances.Add(instance);
 }