RRCamera

Objective-C

@interface RRCamera : NSObject

/**
 This property defines the background color used for rendering
 */
@property(strong, nonatomic) UIColor* backgroundColor;

/**
 This property defines the type of the camera
 @see `RRCameraType`
 */
@property(nonatomic) RRCameraType cameraType;

/**
 This property defines the camera position in world coordinates
 */
@property(nonatomic) simd_float3 position;

/**
 This property defines the direction towards which the camera points in world coordinates
 */
@property(nonatomic) simd_float3 direction;

/**
 This property returns the rotation only transformation matrix of the camera view matrix
 */
@property(nonatomic, readonly) simd_float4x4 rotationMatrix;

/**
 This property returns the rotation angles of the camera view matrix
 */
@property(nonatomic, readonly) simd_float3 rotationAngles;

/**
 This method provides functionality to let the camera point towards a target position in world coordinates
 */
-(void) lookAtTarget:(simd_float3) target;

/**
 This property defines the camera's up facing vector in world coordinates
 */
@property(nonatomic) simd_float3 upVector;

/**
 This property defines the camera's vertical field of view in degrees
 */
@property(nonatomic) CGFloat fieldOfView;

/**
 This property defines the camera's near plane used for clipping
 */
@property(nonatomic) CGFloat nearPlane;

/**
 This property defines the camera's far plane used for clipping
 */
@property(nonatomic) CGFloat farPlane;

/**
 This property defines a 2D screen-space offset that is provided in OpenGL's clipping space coordinate system
 */
@property(nonatomic) simd_float2 screenSpaceOffset;

/**
 This method provides the functionality to define the frame for orthogonal cameras
 */
-(void) setOrthogonalFrameLeft:(CGFloat) left top:(CGFloat) top right:(CGFloat) right bottom:(CGFloat) bottom;

/**
 This property returns the frame for orthogonal cameras as a vector of the following format: (left, top, right, bottom)
 */
@property(nonatomic, readonly) simd_float4 orthogonalFrame;

/**
 This property defines the camera's view matrix
 */
@property(nonatomic) simd_float4x4 viewMatrix;

@end

Swift

class RRCamera : NSObject

Undocumented

  • This property defines the background color used for rendering

    Declaration

    Objective-C

    @property (nonatomic, strong) UIColor *_Nonnull backgroundColor;

    Swift

    var backgroundColor: UIColor { get set }
  • This property defines the type of the camera

    Declaration

    Objective-C

    @property (nonatomic) RRCameraType cameraType;

    Swift

    var cameraType: RRCameraType { get set }
  • This property defines the camera position in world coordinates

    Declaration

    Objective-C

    @property (nonatomic) simd_float3 position;

    Swift

    var position: simd_float3 { get set }
  • This property defines the direction towards which the camera points in world coordinates

    Declaration

    Objective-C

    @property (nonatomic) simd_float3 direction;

    Swift

    var direction: simd_float3 { get set }
  • This property returns the rotation only transformation matrix of the camera view matrix

    Declaration

    Objective-C

    @property (nonatomic, readonly) simd_float4x4 rotationMatrix;

    Swift

    var rotationMatrix: simd_float4x4 { get }
  • This property returns the rotation angles of the camera view matrix

    Declaration

    Objective-C

    @property (nonatomic, readonly) simd_float3 rotationAngles;

    Swift

    var rotationAngles: simd_float3 { get }
  • This method provides functionality to let the camera point towards a target position in world coordinates

    Declaration

    Objective-C

    - (void)lookAtTarget:(simd_float3)target;

    Swift

    func look(atTarget target: simd_float3)
  • This property defines the camera’s up facing vector in world coordinates

    Declaration

    Objective-C

    @property (nonatomic) simd_float3 upVector;

    Swift

    var upVector: simd_float3 { get set }
  • This property defines the camera’s vertical field of view in degrees

    Declaration

    Objective-C

    @property (nonatomic) CGFloat fieldOfView;

    Swift

    var fieldOfView: CGFloat { get set }
  • This property defines the camera’s near plane used for clipping

    Declaration

    Objective-C

    @property (nonatomic) CGFloat nearPlane;

    Swift

    var nearPlane: CGFloat { get set }
  • This property defines the camera’s far plane used for clipping

    Declaration

    Objective-C

    @property (nonatomic) CGFloat farPlane;

    Swift

    var farPlane: CGFloat { get set }
  • This property defines a 2D screen-space offset that is provided in OpenGL’s clipping space coordinate system

    Declaration

    Objective-C

    @property (nonatomic) simd_float2 screenSpaceOffset;

    Swift

    var screenSpaceOffset: simd_float2 { get set }
  • This method provides the functionality to define the frame for orthogonal cameras

    Declaration

    Objective-C

    - (void)setOrthogonalFrameLeft:(CGFloat)left
                               top:(CGFloat)top
                             right:(CGFloat)right
                            bottom:(CGFloat)bottom;

    Swift

    func setOrthogonalFrameLeft(_ left: CGFloat, top: CGFloat, right: CGFloat, bottom: CGFloat)
  • This property returns the frame for orthogonal cameras as a vector of the following format: (left, top, right, bottom)

    Declaration

    Objective-C

    @property (nonatomic, readonly) simd_float4 orthogonalFrame;

    Swift

    var orthogonalFrame: simd_float4 { get }
  • This property defines the camera’s view matrix

    Declaration

    Objective-C

    @property (nonatomic) simd_float4x4 viewMatrix;

    Swift

    var viewMatrix: simd_float4x4 { get set }