GLTFCamera
Represents a GLTF camera.
GLTFCamera.swift:11class GLTFCamera
Represents a camera as defined by the base GLTF spec.
Superclasses
class Resource
Base class for serializable objects.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
static func fromDictionary(GDictionary
) -> GLTFCamera? Creates a new GLTFCamera instance by parsing the given
GDictionary
.static func fromNode(cameraNode: Camera3D?
) -> GLTFCamera? Create a new GLTFCamera instance from the given Godot
Camera3D
node.class var godotClassName: StringName
Instance members
var depthFar: Double
The distance to the far culling boundary for this camera relative to its local Z axis, in meters. This maps to GLTF’s
zfar
property.var depthNear: Double
The distance to the near culling boundary for this camera relative to its local Z axis, in meters. This maps to GLTF’s
znear
property.var fov: Double
The FOV of the camera. This class and GLTF define the camera FOV in radians, while Godot uses degrees. This maps to GLTF’s
yfov
property. This value is only used for perspective cameras, whenperspective
is true.var perspective: Bool
Whether or not the camera is in perspective mode. If false, the camera is in orthographic/orthogonal mode. This maps to GLTF’s camera
type
property. Seeprojection
and the GLTF spec for more information.var sizeMag: Double
The size of the camera. This class and GLTF define the camera size magnitude as a radius in meters, while Godot defines it as a diameter in meters. This maps to GLTF’s
ymag
property. This value is only used for orthographic/orthogonal cameras, whenperspective
is false.func toDictionary(
) -> GDictionary Serializes this GLTFCamera instance into a
GDictionary
.func toNode(
) -> Camera3D? Converts this GLTFCamera instance into a Godot
Camera3D
node.