Exemplo n.º 1
0
 public static bool RayCastPhysicsFromScreenPoint(Vec2 screenPoint, out Vec3 hitPos)
 {
     Vec3 raySrc;
     Vec3 rayDir;
     GetWorldRayFromScreenPoint(screenPoint, out raySrc, out rayDir);
     float num;
     return RayCastPhysics(raySrc, rayDir, EditorObject.Null, out hitPos, out num);
 }
Exemplo n.º 2
0
 public static bool GetScreenPointFromWorldPos(Vec3 worldPos, out Vec2 screenPoint, bool clipped)
 {
     bool flag = Binding.FCE_Editor_GetScreenPointFromWorldPos(worldPos.X, worldPos.Y, worldPos.Z, out screenPoint.X, out screenPoint.Y);
     if (flag && clipped)
     {
         screenPoint.X = Math.Min(Math.Max(0f, screenPoint.X), 1f);
         screenPoint.Y = Math.Min(Math.Max(0f, screenPoint.Y), 1f);
     }
     return flag;
 }
Exemplo n.º 3
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;
 }
Exemplo n.º 4
0
 public static void ApplyScreenDeltaToWorldPos(Vec2 screenDelta, ref Vec3 worldPos)
 {
     Vec3 vec = Camera.FrontVector;
     if ((double)Math.Abs(vec.X) < 0.001 && (double)Math.Abs(vec.Y) < 0.001)
     {
         vec = Camera.UpVector;
     }
     Vec2 vec2 = -vec.XY;
     vec2.Normalize();
     Vec2 vec3 = new Vec2(-vec2.Y, vec2.X);
     float num = (float)((double)Vec3.Dot(worldPos - Camera.Position, Camera.FrontVector) * Math.Tan((double)Camera.HalfFOV) * 2.0);
     worldPos.X += num * screenDelta.X * vec3.X + num * screenDelta.Y * vec2.X;
     worldPos.Y += num * screenDelta.X * vec3.Y + num * screenDelta.Y * vec2.Y;
 }
Exemplo n.º 5
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;
 }
Exemplo n.º 6
0
 public static float GetAverageHeight(Vec2 center, PaintBrush brush)
 {
     return Binding.FCE_Terrain_GetAverageHeight(center.X, center.Y, brush.Pointer);
 }
Exemplo n.º 7
0
 public static bool GetScreenPointFromWorldPos(Vec3 worldPos, out Vec2 screenPoint)
 {
     return GetScreenPointFromWorldPos(worldPos, out screenPoint, false);
 }
Exemplo n.º 8
0
 public static void RaiseLower(Vec2 center, float amount, PaintBrush brush)
 {
     Binding.FCE_Terrain_RaiseLower(center.X, center.Y, amount, brush.Pointer);
 }
Exemplo n.º 9
0
 public static void RegenerateTileAt(Vec2 pos, bool debugMode)
 {
     Binding.FCE_Navmesh_RegenerateTileAt(pos.X, pos.Y, debugMode);
 }
Exemplo n.º 10
0
 public static float GetHeightAtWithWater(Vec2 point)
 {
     return Binding.FCE_TerrainManager_GetHeightAtWithWater(point.X, point.Y);
 }
Exemplo n.º 11
0
 public static void DrawScreenRectangleOutlined(RectangleF rect, float z, float penWidth, Color color)
 {
     SizeF size = rect.Size;
     Vec2 vec = new Vec2(rect.X + size.Width / 2f, rect.Y + size.Height / 2f);
     Binding.FCE_Draw_ScreenRectangleOutlined(vec.X, vec.Y, z, size.Width, size.Height, penWidth, (float)color.R / 255f, (float)color.G / 255f, (float)color.B / 255f, (float)color.A / 255f);
 }
Exemplo n.º 12
0
 public static EditorObject GetObjectFromScreenPoint(Vec2 pt, out Vec3 hitPos)
 {
     return ObjectManager.GetObjectFromScreenPoint(pt, out hitPos, false, EditorObject.Null);
 }
Exemplo n.º 13
0
 public static void Average(Vec2 center, PaintBrush brush)
 {
     Binding.FCE_Terrain_Average(center.X, center.Y, brush.Pointer);
 }
Exemplo n.º 14
0
 public void AddPoint(Vec2 point)
 {
     Binding.FCE_Spline_AddPoint(this.m_splinePtr, point.X, point.Y);
 }
Exemplo n.º 15
0
 public static ObjectInventoryEntry GetEntryFromScreenPoint(Vec2 screenPoint)
 {
     return new ObjectInventoryEntry(Binding.FCE_ObjectLegoBox_GetEntryFromScreenPoint(screenPoint.X, screenPoint.Y));
 }
Exemplo n.º 16
0
 public void InsertPoint(Vec2 point, int index)
 {
     Binding.FCE_Spline_InsertPoint(this.m_splinePtr, point.X, point.Y, index);
 }
Exemplo n.º 17
0
 public bool HitTestSegments(Vec2 center, float radius, out int hitIndex, out Vec2 hitPos)
 {
     return Binding.FCE_Spline_HitTestSegments(this.m_splinePtr, center.X, center.Y, radius, out hitIndex, out hitPos.X, out hitPos.Y);
 }
Exemplo n.º 18
0
 public bool HitTestPoints(Vec2 point, float penWidth, float hitWidth, out int hitIndex, out Vec2 hitPos)
 {
     return Binding.FCE_Spline_HitTestPoints(this.m_splinePtr, point.X, point.Y, penWidth, hitWidth, out hitIndex, out hitPos.X, out hitPos.Y);
 }
Exemplo n.º 19
0
 public static void Erosion(Vec2 center, float radius, float density, float deformation, float channelDepth, float randomness)
 {
     Binding.FCE_Terrain_Erosion(center.X, center.Y, radius, density, deformation, channelDepth, randomness);
 }
Exemplo n.º 20
0
 public static EditorObject GetObjectFromScreenPoint(Vec2 pt, out Vec3 hitPos, bool includeFrozen)
 {
     return ObjectManager.GetObjectFromScreenPoint(pt, out hitPos, includeFrozen, EditorObject.Null);
 }
Exemplo n.º 21
0
 public static void GetWorldRayFromScreenPoint(Vec2 screenPoint, out Vec3 raySrc, out Vec3 rayDir)
 {
     Binding.FCE_Editor_GetWorldRayFromScreenPoint(screenPoint.X, screenPoint.Y, out raySrc.X, out raySrc.Y, out raySrc.Z, out rayDir.X, out rayDir.Y, out rayDir.Z);
 }
Exemplo n.º 22
0
 public static void DrawTerrainSquare(Vec2 center, float radius, float penWidth, Color color, float zOrder, float zOffset, Color borderColor)
 {
     Binding.FCE_Draw_Terrain_Square(center.X, center.Y, radius, penWidth, (float)color.R / 255f, (float)color.G / 255f, (float)color.B / 255f, (float)color.A / 255f, zOrder, zOffset, (float)borderColor.R / 255f, (float)borderColor.G / 255f, (float)borderColor.B / 255f, (float)borderColor.A / 255f);
 }
Exemplo n.º 23
0
 public static bool RayCastTerrainFromScreenPoint(Vec2 screenPoint, out Vec3 hitPos)
 {
     Vec3 raySrc;
     Vec3 rayDir;
     GetWorldRayFromScreenPoint(screenPoint, out raySrc, out rayDir);
     float num;
     return RayCastTerrain(raySrc, rayDir, out hitPos, out num);
 }
Exemplo n.º 24
0
 public static void Terrace(Vec2 center, float height, float falloff, PaintBrush brush)
 {
     Binding.FCE_Terrain_Terrace(center.X, center.Y, height, falloff, brush.Pointer);
 }
Exemplo n.º 25
0
 public static void DrawScreenCircleOutlined(Vec2 center, float z, float radius, float penWidth, Color color)
 {
     Binding.FCE_Draw_ScreenCircleOutlined(center.X, center.Y, z, radius, penWidth, (float)color.R / 255f, (float)color.G / 255f, (float)color.B / 255f, (float)color.A / 255f);
 }
Exemplo n.º 26
0
 public static void SetViewportPickingPos(Vec2 pt)
 {
     Binding.FCE_ObjectManager_SetViewportPickingPos(pt.X, pt.Y);
 }
Exemplo n.º 27
0
 public static void DrawTerrainSquare(Vec2 center, float radius, float penWidth, Color color, float zOrder, float zOffset)
 {
     Render.DrawTerrainSquare(center, radius, penWidth, color, zOrder, zOffset, Color.Black);
 }
Exemplo n.º 28
0
 public static void Noise(Vec2 center, float amount, PaintBrush brush)
 {
     Binding.FCE_Terrain_Noise(center.X, center.Y, amount, brush.Pointer);
 }
Exemplo n.º 29
0
        private void Viewport_MouseMove(object sender, MouseEventArgs e)
        {
            if (this.CaptureMouse)
            {
                if (Game.IsActive)
                {
                    Point position = base.PointToScreen(new Point(base.Width / 2, base.Height / 2));
                    int num = Cursor.Position.X - position.X;
                    int num2 = Cursor.Position.Y - position.Y;
                    if (num != 0 || num2 != 0)
                    {
                        switch (this.CameraMode)
                        {
                        case CameraModes.Lookaround:
                            Camera.Rotate((float)(EditorSettings.InvertMouseView ? num2 : (-(float)num2)) * 0.005f, 0f, (float)(-(float)num) * 0.005f);
                            break;

                        case CameraModes.Panning:
                            Camera.Position += Camera.RightVector * (float)num * 0.125f + Camera.UpVector * (float)(EditorSettings.InvertMousePan ? num2 : (-(float)num2)) * 0.125f;
                            break;

                        default:
                            Game.OnMouseEvent(MouseEvent.MouseMoveDelta, new MouseEventArgs(e.Button, e.Clicks, num, num2, e.Delta));
                            break;
                        }
                        Cursor.Position = position;
                        return;
                    }
                }
            }
            else
            {
                this.m_normalizedMousePos = new Vec2((float)e.X / (float)base.ClientSize.Width, (float)e.Y / (float)base.ClientSize.Height);
                ObjectManager.SetViewportPickingPos(this.m_normalizedMousePos);
                Game.OnMouseEvent(MouseEvent.MouseMove, e);
            }
        }
Exemplo n.º 30
0
 public static void Smooth(Vec2 center, PaintBrush brush)
 {
     Binding.FCE_Terrain_Smooth(center.X, center.Y, brush.Pointer);
 }