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 Raycast

    Represents a class for performing raycasting in 3D space.

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

    Constructors

    Raycast(Camera, Viewport)

    Initializes a new instance of the Raycast class.

    Declaration
    public Raycast(Camera camera, Viewport viewport)
    Parameters
    Type Name Description
    Camera camera

    The camera used for raycasting.

    Viewport viewport

    The viewport associated with the raycasting.

    Properties

    Camera

    Gets or sets the camera used for raycasting.

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

    Viewport

    Gets or sets the viewport associated with the raycasting.

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

    Methods

    GetEndVec(Camera, Viewport, int, int)

    Gets the end vector for raycasting based on the mouse cursor position.

    Declaration
    public static vec4 GetEndVec(Camera camera, Viewport vp, int posX, int posY)
    Parameters
    Type Name Description
    Camera camera

    The camera used for raycasting.

    Viewport vp

    The viewport associated with the raycasting.

    int posX

    X-coordinate of the mouse cursor.

    int posY

    Y-coordinate of the mouse cursor.

    Returns
    Type Description
    vec4

    The end vector for raycasting.

    GetMouseWorldPosition(Camera, Viewport, int, int)

    Gets the world position of the mouse cursor based on a given camera and viewport.

    Declaration
    public static Vec3 GetMouseWorldPosition(Camera camera, Viewport viewport, int mouseX, int mouseY)
    Parameters
    Type Name Description
    Camera camera

    The camera used for raycasting.

    Viewport viewport

    The viewport associated with the raycasting.

    int mouseX

    X-coordinate of the mouse cursor.

    int mouseY

    Y-coordinate of the mouse cursor.

    Returns
    Type Description
    Vec3

    World position of the mouse cursor.

    GetMouseWorldPosition(int, int)

    Gets the world position of the mouse cursor.

    Declaration
    public Vec3 GetMouseWorldPosition(int mouseX, int mouseY)
    Parameters
    Type Name Description
    int mouseX

    X-coordinate of the mouse cursor.

    int mouseY

    Y-coordinate of the mouse cursor.

    Returns
    Type Description
    Vec3

    World position of the mouse cursor.

    GetRayDir(vec4, vec4)

    Gets the direction vector for a ray based on start and end vectors.

    Declaration
    public static vec3 GetRayDir(vec4 start, vec4 end)
    Parameters
    Type Name Description
    vec4 start

    The start vector of the ray.

    vec4 end

    The end vector of the ray.

    Returns
    Type Description
    vec3

    The direction vector of the ray.

    GetStartVec(Camera, Viewport, int, int)

    Gets the start vector for raycasting based on the mouse cursor position.

    Declaration
    public static vec4 GetStartVec(Camera camera, Viewport vp, int posX, int posY)
    Parameters
    Type Name Description
    Camera camera

    The camera used for raycasting.

    Viewport vp

    The viewport associated with the raycasting.

    int posX

    X-coordinate of the mouse cursor.

    int posY

    Y-coordinate of the mouse cursor.

    Returns
    Type Description
    vec4

    The start vector for raycasting.

    GetViewProjectionMatrix(Camera)

    Gets the view and projection matrices for raycasting based on a given camera.

    Declaration
    public static MatrixSet GetViewProjectionMatrix(Camera camera)
    Parameters
    Type Name Description
    Camera camera

    The camera for which matrices are calculated.

    Returns
    Type Description
    MatrixSet

    MatrixSet containing the view and projection matrices.

    PerformCast(Camera, Viewport, PhysicHandler, int, int)

    Performs a raycast and returns the hit result based on the mouse cursor position.

    Declaration
    public static HitResult PerformCast(Camera camera, Viewport viewport, PhysicHandler physicHandler, int posX, int posY)
    Parameters
    Type Name Description
    Camera camera

    The camera used for raycasting.

    Viewport viewport

    The viewport associated with the raycasting.

    PhysicHandler physicHandler

    The physics handler used for raycasting.

    int posX

    X-coordinate of the mouse cursor.

    int posY

    Y-coordinate of the mouse cursor.

    Returns
    Type Description
    HitResult

    HitResult containing information about the raycasting hit.

    PerformCast(PhysicHandler, int, int)

    Performs a raycast and returns the hit result based on the mouse cursor position.

    Declaration
    public HitResult PerformCast(PhysicHandler physicHandler, int posX, int posY)
    Parameters
    Type Name Description
    PhysicHandler physicHandler

    The physics handler used for raycasting.

    int posX

    X-coordinate of the mouse cursor.

    int posY

    Y-coordinate of the mouse cursor.

    Returns
    Type Description
    HitResult

    HitResult containing information about the raycasting hit.

    In this article
    Back to top Generated by DocFX