GFX
  • Docs
  • API
Search Results for

    Show / Hide Table of Contents
    • Genesis.Core
      • AssetManager
      • Game
      • GameElement
      • GameEventHandler
      • GenesisWindow
      • IGameBehavior
      • Input
      • Layer
      • Light
      • Scene
      • Scene3D
      • SceneEventHandler
      • SceneSizeEvenHandler
      • Storage
      • Utils
    • Genesis.Core.Behaviors
      • AnimationBehavior
      • CameraFlags
      • CharacterController2D
      • ControllerPreset
      • MoveDirection
      • MovementFlags
      • SpriteMovementController
    • Genesis.Core.Behaviors.Physics2D
      • BufferedSpriteCollider
      • PhysicsBox2D
      • PhysicsPolygon2D
      • Rigidbody2D
    • Genesis.Core.Behaviors.Physics3D
      • BoxCollider
      • CapsuleCollider
      • ConvexHullBehavior
      • QubeConvexHull
      • SphereCollider
      • StaticMeshBehavior
    • Genesis.Core.Behaviors._3D
      • Stance
      • ThirdpersonCharacterController
    • Genesis.Core.GameElements
      • BufferedSprite
      • CameraElement
      • Element3D
      • Empty
      • Model
      • ParticleBuffers
      • ParticleDeffinition
      • ParticleEmitter
      • Qube
      • RectElement
      • Skybox
      • Sprite
      • SpriteShapeDeffinition
      • Terrain2D
      • Terrain3D
      • TerrainData
    • Genesis.Graphics
      • Animation
      • Camera
      • CameraType
      • Face
      • Font
      • Framebuffer
      • Glyphe
      • IRenderDevice
      • Material
      • MaterialBuffer
      • Mesh
      • PerspectiveCamera
      • Shader
      • ShaderProgram
      • TexCoords
      • Texture
      • Viewport
    • Genesis.Graphics.Animation3D
      • Animation
      • Animator
      • AssimpNodeData
      • Bone
      • KeyPosition
      • KeyRotation
      • KeyScale
      • ModelMesh
      • boneinfo
      • vertex
    • Genesis.Graphics.Physics
      • BulletDebugRenderer
    • Genesis.Graphics.RenderDevice
      • ClassicGL
      • GLRenderer
    • Genesis.Graphics.Shaders.OpenGL
      • AnimatedModelShader
      • BasicShader
      • DiffuseLightning
      • DiffuseNormalLightning
      • DiffuseNormalShader
      • DiffuseShader
      • DiffuseSolidShader
      • MVPRectShader
      • MVPShader
      • MVPSolidShader
      • ParticleShader
      • ScreenShader
      • SkyboxShader
      • SpriteShader
      • TerrainShader
      • WireframeShader
    • Genesis.Graphics.Shapes
      • BufferedSpriteShape
      • FrameShape
      • GlypheShape
      • LineShape
      • PlaneShape
      • QubeShape
      • RectShape
      • Shape
      • SpriteShape
    • Genesis.Math
      • Matrix4x4
      • NoisePoint
      • PerlinNoise
      • Rect
      • Vec3
    • Genesis.Physics
      • Aabb
      • HitResult
      • MatrixSet
      • MouseRay2
      • PhysicHandler
      • PhysicHandlerEvent
      • PhysicPropeterys
      • PhysicsBehavior
      • PhysicsBehaviorEvent
      • PhysicsHandler2D
      • PhysicsHandler3D
      • Raycast
    • Genesis.UI
      • Canvas
      • ImageButton
      • Label
      • ListItem
      • ListItemBehavior
      • ListSelector
      • ListSelectorBehavior
      • Panel
      • ProgressBar
      • UIEvent
      • UIParseHandler
      • UIParser
      • Widget

    Class Camera

    Represents a camera in a graphics context for rendering 2D scenes.

    Inheritance
    object
    Camera
    PerspectiveCamera
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Genesis.Graphics
    Assembly: Genesis.dll
    Syntax
    public class Camera

    Constructors

    Camera(Vec3, Vec3, float, float)

    Initializes a new instance of the Camera class with the specified location, size, near and far distances.

    Declaration
    public Camera(Vec3 location, Vec3 size, float near, float far)
    Parameters
    Type Name Description
    Vec3 location

    The initial location of the camera in 3D space.

    Vec3 size

    The size of the camera.

    float near

    The distance to the near clipping plane of the camera.

    float far

    The distance to the far clipping plane of the camera.

    Properties

    Far

    Gets or sets the distance to the far clipping plane of the camera.

    Declaration
    public float Far { get; set; }
    Property Value
    Type Description
    float

    Location

    Gets or sets the location of the camera in 3D space.

    Declaration
    public Vec3 Location { get; set; }
    Property Value
    Type Description
    Vec3

    Near

    Gets or sets the distance to the near clipping plane of the camera.

    Declaration
    public float Near { get; set; }
    Property Value
    Type Description
    float

    Rotation

    Gets or sets the rotation of the camera in 3D space.

    Declaration
    public Vec3 Rotation { get; set; }
    Property Value
    Type Description
    Vec3

    Size

    Gets or sets the size of the camera.

    Declaration
    public Vec3 Size { get; set; }
    Property Value
    Type Description
    Vec3

    Type

    Gets or sets the type of the camera, either orthographic or perspective.

    Declaration
    public CameraType Type { get; set; }
    Property Value
    Type Description
    CameraType

    Methods

    GetRect()

    Gets the rectangular region represented by the camera's location and size.

    Declaration
    public Rect GetRect()
    Returns
    Type Description
    Rect

    A Rect object representing the camera's view region.

    LookAt(GameElement)

    Adjusts the camera to look at the specified game element (only 2D).

    Declaration
    public void LookAt(GameElement element)
    Parameters
    Type Name Description
    GameElement element

    The game element to look at.

    LookAt(GameElement, bool)

    Adjusts the camera to look at the specified game element, with an option to center the view on the element.

    Declaration
    public void LookAt(GameElement element, bool centerOffset)
    Parameters
    Type Name Description
    GameElement element

    The game element to look at.

    bool centerOffset

    If true, centers the view on the element; otherwise, positions the camera at the element's location.

    In this article
    Back to top Generated by DocFX