Class: Raylib::Camera3D

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/raylib/core/structs/camera3_d.rb

Overview

Camera, defines position/orientation in 3d space

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create(position, target, up, fovy, projection) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/raylib/core/structs/camera3_d.rb', line 12

def self.create(position, target, up, fovy, projection)
  new.tap do |instance|
    instance[:position] = position
    instance[:target] = target
    instance[:up] = up
    instance[:fovy] = fovy
    instance[:projection] = projection
  end
end

Instance Method Details

#fovyFloat

Camera field-of-view aperture in Y (degrees) in perspective, used as near plane width in orthographic

Returns:

  • (Float)

    fovy



55
# File 'lib/raylib/core/structs/camera3_d.rb', line 55

def fovy = self[:fovy]

#fovy=(new_fovy) ⇒ Object

Sets Camera field-of-view aperture in Y (degrees) in perspective, used as near plane width in orthographic



58
59
60
# File 'lib/raylib/core/structs/camera3_d.rb', line 58

def fovy=(new_fovy)
  self[:fovy] = new_fovy
end

#positionVector3

Camera position

Returns:



28
# File 'lib/raylib/core/structs/camera3_d.rb', line 28

def position = self[:position]

#position=(new_position) ⇒ Object

Sets Camera position



31
32
33
# File 'lib/raylib/core/structs/camera3_d.rb', line 31

def position=(new_position)
  self[:position] = new_position
end

#projectionInteger

Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC

Returns:

  • (Integer)

    projection



64
# File 'lib/raylib/core/structs/camera3_d.rb', line 64

def projection = self[:projection]

#projection=(new_projection) ⇒ Object

Sets Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC



67
68
69
# File 'lib/raylib/core/structs/camera3_d.rb', line 67

def projection=(new_projection)
  self[:projection] = new_projection
end

#targetVector3

Camera target it looks-at

Returns:



37
# File 'lib/raylib/core/structs/camera3_d.rb', line 37

def target = self[:target]

#target=(new_target) ⇒ Object

Sets Camera target it looks-at



40
41
42
# File 'lib/raylib/core/structs/camera3_d.rb', line 40

def target=(new_target)
  self[:target] = new_target
end

#to_sObject



22
23
24
# File 'lib/raylib/core/structs/camera3_d.rb', line 22

def to_s
  "Raylib::Camera3D##{object_id} position=#{position} target=#{target} up=#{up} fovy=#{fovy} projection=#{projection}"
end

#upVector3

Camera up vector (rotation over its axis)

Returns:



46
# File 'lib/raylib/core/structs/camera3_d.rb', line 46

def up = self[:up]

#up=(new_up) ⇒ Object

Sets Camera up vector (rotation over its axis)



49
50
51
# File 'lib/raylib/core/structs/camera3_d.rb', line 49

def up=(new_up)
  self[:up] = new_up
end