Esempio n. 1
0
 public static EditorObject GetObjectFromScreenPoint(Vec2 pt, out Vec3 hitPos, bool includeFrozen, EditorObjectSelection ignore)
 {
     EditorObject result;
     using (PhysEntityVector vector = PhysEntityVector.Create())
     {
         ignore.GetPhysEntities(vector);
         result = new EditorObject(Binding.FCE_ObjectManager_GetObjectFromScreenPoint(pt.X, pt.Y, out hitPos.X, out hitPos.Y, out hitPos.Z, includeFrozen, vector.Pointer));
     }
     return result;
 }
Esempio n. 2
0
 public static EditorObject GetObjectFromScreenPoint(Vec2 pt, out Vec3 hitPos, bool includeFrozen, EditorObject ignore)
 {
     PhysEntityVector vector = PhysEntityVector.Null;
     if (ignore.IsValid)
     {
         vector = PhysEntityVector.Create();
         ignore.GetPhysEntities(vector);
     }
     EditorObject result = new EditorObject(Binding.FCE_ObjectManager_GetObjectFromScreenPoint(pt.X, pt.Y, out hitPos.X, out hitPos.Y, out hitPos.Z, includeFrozen, vector.Pointer));
     if (vector.IsValid)
     {
         vector.Dispose();
     }
     return result;
 }
Esempio n. 3
0
 public void Unapply(EditorObject obj)
 {
     CoordinateSystem coordinateSystem = CoordinateSystem.FromAngles(obj.Angles);
     AABB localBounds = obj.LocalBounds;
     Vec3 vec = (localBounds.max + localBounds.min) * 0.5f;
     Vec3 vec2 = localBounds.Length * 0.5f;
     this.position -= obj.Position + vec.X * coordinateSystem.axisX + vec.Y * coordinateSystem.axisY;
     this.position = coordinateSystem.ConvertFromWorld(this.position);
     this.normal = coordinateSystem.ConvertFromWorld(this.normal);
     this.normalUp = coordinateSystem.ConvertFromWorld(this.normalUp);
     this.position.X = this.position.X / vec2.X;
     this.position.Y = this.position.Y / vec2.Y;
     if (this.position.X > 1f)
     {
         this.position.X = 1f;
     }
     else
     {
         if (this.position.X < -1f)
         {
             this.position.X = -1f;
         }
     }
     if (this.position.Y > 1f)
     {
         this.position.Y = 1f;
     }
     else
     {
         if (this.position.Y < -1f)
         {
             this.position.Y = -1f;
         }
     }
     if (this.position.Z > 1f)
     {
         this.position.Z = 1f;
     }
     else
     {
         if (this.position.Z < -1f)
         {
             this.position.Z = -1f;
         }
     }
     this.normal.Z = 0f;
     this.normalUp = new Vec3(0f, 0f, 1f);
 }
 public void ToggleObject(EditorObject obj)
 {
     Binding.FCE_ObjectSelection_ToggleObject(this.m_selPtr, obj.Pointer);
 }
 public int IndexOf(EditorObject obj)
 {
     for (int i = 0; i < this.Count; i++)
     {
         if (this[i].Pointer == obj.Pointer)
         {
             return i;
         }
     }
     return -1;
 }
 public bool Contains(EditorObject obj)
 {
     return this.IndexOf(obj) != -1;
 }
 public void AddObject(EditorObject obj)
 {
     Binding.FCE_ObjectSelection_Add(this.m_selPtr, obj.Pointer);
 }
Esempio n. 8
0
 public void AddObject(EditorObject obj)
 {
     Binding.FCE_ObjectSelection_Add(this.m_selPtr, obj.Pointer);
 }
Esempio n. 9
0
 public bool Contains(EditorObject obj)
 {
     return(this.IndexOf(obj) != -1);
 }
Esempio n. 10
0
 public void RemoveObject(EditorObject obj)
 {
     Binding.FCE_ObjectSelection_RemoveObject(this.m_selPtr, obj.Pointer);
 }
Esempio n. 11
0
 public static bool RayCastPhysics(Vec3 raySrc, Vec3 rayDir, EditorObject ignore, out Vec3 hitPos, out float hitDist, out Vec3 hitNormal)
 {
     return Binding.FCE_Editor_RayCastPhysics(raySrc.X, raySrc.Y, raySrc.Z, rayDir.X, rayDir.Y, rayDir.Z, ignore.Pointer, out hitPos.X, out hitPos.Y, out hitPos.Z, out hitDist, out hitNormal.X, out hitNormal.Y, out hitNormal.Z);
 }
Esempio n. 12
0
 public static bool RayCastPhysics(Vec3 raySrc, Vec3 rayDir, EditorObject ignore, out Vec3 hitPos, out float hitDist)
 {
     Vec3 vec;
     return RayCastPhysics(raySrc, rayDir, ignore, out hitPos, out hitDist, out vec);
 }
Esempio n. 13
0
 public static void Focus(EditorObject obj)
 {
     if (!obj.IsValid)
     {
         return;
     }
     AABB worldBounds = obj.WorldBounds;
     Vec3 center = worldBounds.Center;
     Vec3 v = (worldBounds - center).Length * 0.5f;
     Vec3 vec = -Camera.FrontVector;
     Camera.Position = center + vec * (vec * v).Length * 4f;
 }
Esempio n. 14
0
 public static void OnObjectAddedFromTool(EditorObject obj)
 {
     Binding.FCE_ObjectManager_OnObjectAddedFromTool(obj.Pointer);
 }
Esempio n. 15
0
 public static void GetObjectsFromMagicWand(EditorObjectSelection selection, EditorObject obj)
 {
     Binding.FCE_ObjectManager_GetObjectsFromMagicWand(selection.Pointer, obj.Pointer);
 }