Class PerspectiveCamera3D

透视摄像机

Hierarchy

Constructors

Properties

__class__: "PerspectiveCamera3D"
_entity: Node3D
_projectionMatrix: Matrix4x4
aspect: number

视窗缩放比例(width/height),在渲染器中设置

enabled: boolean

是否启用update方法

far: number

最远距离

fov: number

垂直视角,视锥体顶面和底面间的夹角;单位为角度,取值范围 [1,179]

hideFlags: HideFlags

隐藏标记,用于控制是否在层级界面、检查器显示,是否保存

near: number

最近距离

runEnvironment: RunEnvironment

可运行环境

Accessors

  • get entity(): Node3D
  • 此组件附加到的游戏对象。组件总是附加到游戏对象上。

    Returns Node3D

  • get focalLength(): number
  • 焦距

    Returns number

  • set focalLength(value): void
  • Parameters

    • value: number

    Returns void

  • get frustum(): Frustum
  • 获取摄像机的截头锥体

    Returns Frustum

  • get inversepPojectionMatrix(): Matrix4x4
  • 逆矩阵

    Returns Matrix4x4

  • get isVisibleAndEnabled(): boolean
  • Has the Behaviour had enabled called. 是否所在Object3D显示且该行为已启动。

    Returns boolean

  • get node(): Node
  • 2D节点。

    Returns Node

  • get projectionMatrix(): Matrix4x4
  • 投影矩阵

    Returns Matrix4x4

  • set projectionMatrix(v): void
  • Parameters

    Returns void

  • get viewProjection(): Matrix4x4
  • 视窗投影矩阵,全局空间转投影空间

    Returns Matrix4x4

Methods

  • 投影矩阵失效

    Returns void

  • 处理场景变换改变事件

    Returns void

  • 更新投影矩阵

    Returns void

  • Adds a component class of type componentType to the game object.

    Type Parameters

    • K extends keyof ComponentMap

    Parameters

    • type: K

      组件类定义。

    • Optional params: gPartial<ComponentMap[K]>

    Returns ComponentMap[K]

    被添加的组件。

  • Parameters

    Returns void

  • 销毁

    Returns void

  • 返回游戏对象附加的一个指定类型的组件,如果没有,则返回 null。

    使用 Entity.GetComponent 将返回找到的第一个组件。如果您希望有多个相同类型的组件,请改用 Entity.GetComponents,并循环通过返回的组件测试某些唯一属性。

    Type Parameters

    • K extends keyof ComponentMap

    Parameters

    • component: K

      要检索的组件类型。

    Returns ComponentMap[K]

    要检索的组件。

  • 使用深度优先搜索返回 Entity 或其任何子项中的 Type 组件。

    Type Parameters

    • K extends keyof ComponentMap

    Parameters

    • component: K

      要检索的组件类型。

    • Optional includeInactive: boolean

      是否包含不活跃组件。

    Returns ComponentMap[K]

    匹配类型的组件(如果找到)。

  • 检索 Entity 或其任何父项type中的 Type 组件。

    此方法向上递归,直到找到具有匹配组件的 Entity。仅匹配活动游戏对象上的组件。

    Type Parameters

    • K extends keyof ComponentMap

    Parameters

    • component: K

      要查找的组件类型。

    • Optional includeInactive: boolean

      是否包含不活跃组件。

    Returns ComponentMap[K]

    如果找到与类型匹配的组件,则返回一个组件。否则返回 null。

  • 返回Entity中指定类型的所有组件。

    Type Parameters

    • K extends keyof ComponentMap

    Parameters

    • type: K

      要检索的组件类型。

    • Optional results: ComponentMap[K][]

      列出接收找到的组件。

    Returns ComponentMap[K][]

    实体中指定类型的所有组件。

  • 使用深度优先搜索返回 当前实体 或其任何子子项中 Type 的所有组件。递归工作。

    在子游戏对象上递归搜索组件。这意味着它还包括目标实体的所有子实体,以及所有后续子实体。

    Type Parameters

    • K extends keyof ComponentMap

    Parameters

    • component: K

      要检索的组件类型。

    • Optional includeInactive: boolean

      非活动游戏对象上的组件是否应该包含在搜索结果中?

    • Optional results: ComponentMap[K][]

      列出接收找到的组件。

    Returns ComponentMap[K][]

    所有找到的组件。

  • 返回当前实体或其任何父级中指定的所有组件。

    Type Parameters

    • K extends keyof ComponentMap

    Parameters

    • component: K

      要检索的组件类型。

    • Optional includeInactive: boolean

      非活动组件是否应该包含在搜索结果中?

    • Optional results: ComponentMap[K][]

      列出找到的组件。

    Returns ComponentMap[K][]

    实体或其任何父级中指定的所有组件。

  • 获取全局空间射线。

    Parameters

    • x: number

      GPU空间坐标x值

    • y: number

      GPU空间坐标y值

    • Optional ray: Ray3

    Returns Ray3

  • 获取摄像机能够在指定深度处的视野;镜头在指定深度的尺寸。

    depth为-1,方向为纵向(0, 1)时,返回scale值为近平面一半高度。 depth为-1,方向为纵向(1, 0)时,返回scale值为近平面一半宽度。 depth为1,方向为纵向(0, 1)时,返回scale值为远平面一半高度。 depth为1,方向为纵向(1, 0)时,返回scale值为远平面一半宽度。

    Parameters

    • gpuDepth: number

      GPU空间深度(near处depth值为-1,far处值为1)。

    • Optional dir: Vector2

    Returns number

  • 把事件分享到实体上。

    Returns Entity[]

  • 创建一个摄像机

    Returns void

  • 全局坐标转换为GPU坐标

    Parameters

    Returns Vector3

    GPU坐标

  • Private

    该方法仅在Entity中使用

    Parameters

    • entity: Entity

      游戏对象

    Returns void

  • GPU坐标转换为全局坐标

    Parameters

    • point3d: Vector3

      GPU空间坐标 Z: 到屏幕的距离

    • Optional v: Vector3

      全局坐标

    Returns Vector3

    全局坐标

  • Private

    组件无法直接使用关键字 new 来构造。

    Type Parameters

    • T

    Parameters

    Returns T

    新建的组件实例。

    See

    getInstance

  • 获取组件依赖列表

    Type Parameters

    • K extends keyof ComponentMap

    Parameters

    • component: K

      组件类定义

    Returns "Component"[]

  • 判断组件是否为唯一组件。

    Type Parameters

    • K extends keyof ComponentMap

    Parameters

    • component: K | ComponentMap[K] | Constructor<ComponentMap[K]>

      组件类定义

    Returns boolean

Generated using TypeDoc