Class: Fake3D::Camera
Overview
Camera of a Fake3D scene
This class is used to help Sprite3D to render at the right position by applying a camera matrix
Constant Summary collapse
- MIN_Z =
Minimum Z the camera can go
0.1
Instance Attribute Summary collapse
-
#pitch ⇒ Numeric
readonly
Get the camera pitch.
-
#roll ⇒ Numeric
readonly
Get the camera roll.
-
#was_updated ⇒ Boolean
readonly
Check if the camera was updated.
-
#yaw ⇒ Numeric
readonly
Get the camera yaw.
-
#z ⇒ Numeric
readonly
Get the z coordinate of the camera.
Instance Method Summary collapse
-
#apply_to(sprite)
Apply the camera to a sprite.
-
#initialize(viewport) ⇒ Camera
constructor
Create a new Camera.
-
#set_position(x, y, z)
Set the camera position.
-
#set_rotation(yaw, pitch, roll)
Set the camera rotation.
-
#x ⇒ Numeric
Get the x coordinate of the camera.
-
#y ⇒ Numeric
Get the y coordinate of the camera.
Constructor Details
#initialize(viewport) ⇒ Camera
Create a new Camera
1755 1756 |
# File 'docs/0_Dependencies.rb', line 1755 def initialize() end |
Instance Attribute Details
#pitch ⇒ Numeric (readonly)
Get the camera pitch
1740 1741 1742 |
# File 'docs/0_Dependencies.rb', line 1740 def pitch @pitch end |
#roll ⇒ Numeric (readonly)
Get the camera roll
1746 1747 1748 |
# File 'docs/0_Dependencies.rb', line 1746 def roll @roll end |
#was_updated ⇒ Boolean (readonly)
Check if the camera was updated
1749 1750 1751 |
# File 'docs/0_Dependencies.rb', line 1749 def was_updated @was_updated end |
#yaw ⇒ Numeric (readonly)
Get the camera yaw
1743 1744 1745 |
# File 'docs/0_Dependencies.rb', line 1743 def yaw @yaw end |
#z ⇒ Numeric (readonly)
Get the z coordinate of the camera
1752 1753 1754 |
# File 'docs/0_Dependencies.rb', line 1752 def z @z end |
Instance Method Details
#apply_to(sprite)
Apply the camera to a sprite
1779 1780 |
# File 'docs/0_Dependencies.rb', line 1779 def apply_to(sprite) end |
#set_position(x, y, z)
Set the camera position
1767 1768 |
# File 'docs/0_Dependencies.rb', line 1767 def set_position(x, y, z) end |
#set_rotation(yaw, pitch, roll)
Set the camera rotation
1761 1762 |
# File 'docs/0_Dependencies.rb', line 1761 def set_rotation(yaw, pitch, roll) end |
#x ⇒ Numeric
Get the x coordinate of the camera
1771 1772 |
# File 'docs/0_Dependencies.rb', line 1771 def x end |
#y ⇒ Numeric
Get the y coordinate of the camera
1775 1776 |
# File 'docs/0_Dependencies.rb', line 1775 def y end |