Documentation ¶
Index ¶
- type Camera
- func (c *Camera) Draw(screen *ebiten.Image)
- func (c *Camera) FovAngle() float64
- func (c *Camera) FovDepth() float64
- func (c *Camera) GetConvergenceDistance() float64
- func (c *Camera) GetConvergencePoint() *geom3d.Vector3
- func (c *Camera) GetConvergenceSprite() Sprite
- func (c *Camera) GetPosition() *geom.Vector2
- func (c *Camera) GetPositionZ() float64
- func (c *Camera) SetAlwaysSetSpriteScreenRect(b bool)
- func (c *Camera) SetFloorTexture(floor *ebiten.Image)
- func (c *Camera) SetFovAngle(fovDegrees, fovDepth float64)
- func (c *Camera) SetGlobalIllumination(illumination float64)
- func (c *Camera) SetHeadingAngle(headingAngle float64)
- func (c *Camera) SetLightFalloff(falloff float64)
- func (c *Camera) SetLightRGB(min, max color.NRGBA)
- func (c *Camera) SetPitchAngle(pitchAngle float64)
- func (c *Camera) SetPosition(pos *geom.Vector2)
- func (c *Camera) SetPositionZ(gridPosZ float64)
- func (c *Camera) SetRenderDistance(distance float64)
- func (c *Camera) SetSkyTexture(sky *ebiten.Image)
- func (c *Camera) SetViewSize(width, height int)
- func (c *Camera) Update(sprites []Sprite)
- func (c *Camera) ViewSize() (int, int)
- type Map
- type Sprite
- type SpriteAnchor
- type TextureHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Camera ¶
type Camera struct {
// contains filtered or unexported fields
}
Camera Class that represents a camera in terms of raycasting. Contains methods to move the camera, and handles projection to, set the rectangle slice position and height,
func (*Camera) Draw ¶
func (c *Camera) Draw(screen *ebiten.Image)
Draw the raycasted camera view to the screen.
func (*Camera) GetConvergenceDistance ¶ added in v1.6.0
Get the distance to the point of convergence raycasted from the center of the camera view
func (*Camera) GetConvergencePoint ¶ added in v1.6.0
Get the 3-Dimensional point of convergence raycasted from the center of the camera view
func (*Camera) GetConvergenceSprite ¶ added in v1.7.1
Get the Sprite (or nil if no sprite) at the point of convergence raycasted from the center of the camera view
func (*Camera) GetPosition ¶
Get camera position vector
func (*Camera) SetAlwaysSetSpriteScreenRect ¶ added in v1.8.0
SetAlwaysSetSpriteScreenRect if set true will always set the sprite screen rect bounds even if behind a wall
func (*Camera) SetFloorTexture ¶
func (c *Camera) SetFloorTexture(floor *ebiten.Image)
SetFloorTexture sets the static floorbox texture
func (*Camera) SetFovAngle ¶ added in v1.0.2
SetFovAngle sets the FOV angle (degrees) and depth
func (*Camera) SetGlobalIllumination ¶ added in v1.0.7
SetGlobalIllumination sets illumination value for whole level (sun brightness)
func (*Camera) SetHeadingAngle ¶
Set camera direction and plane vectors from given heading angle
func (*Camera) SetLightFalloff ¶ added in v1.0.7
SetLightFalloff sets value that simulates torch light, as if player was carrying a radial light. Lower values make torch dimmer.
func (*Camera) SetLightRGB ¶ added in v1.0.7
SetLightRGB sets the min/max color tinting of the textures when fully shadowed (min) or lighted (max)
func (*Camera) SetPitchAngle ¶
Set camera pitch view from given pitch angle
func (*Camera) SetPosition ¶
Set camera position vector
func (*Camera) SetPositionZ ¶
Set camera Z-plane position
func (*Camera) SetRenderDistance ¶ added in v1.0.8
SetRenderDistance sets maximum distance to render raycasted objects (-1 for practically inf)
func (*Camera) SetSkyTexture ¶
func (c *Camera) SetSkyTexture(sky *ebiten.Image)
SetSkyTexture sets the static skybox texture
func (*Camera) SetViewSize ¶ added in v1.0.2
SetViewSize sets the camera resolution
type Sprite ¶
type Sprite interface { // Pos returns the X,Y map position Pos() *geom.Vector2 // PosZ returns the Z (vertical) position PosZ() float64 // Scale returns the scale factor (for no scaling, default to 1.0) Scale() float64 // VerticalAnchor returns the vertical anchor position (only used when scaling image) VerticalAnchor() SpriteAnchor // Texture needs to return the current image to render Texture() *ebiten.Image // TextureRect needs to return the rectangle of the texture coordinates to draw TextureRect() image.Rectangle // Illumination needs to return sprite specific illumination offset (for normal illumination, default to 0) Illumination() float64 // SetScreenRect accepts the raycasted rectangle of the screen coordinates to be rendered (nil if not on screen) SetScreenRect(rect *image.Rectangle) // IsFocusable should return true only if the convergence point can focus on the sprite IsFocusable() bool }
type SpriteAnchor ¶ added in v1.2.0
type SpriteAnchor int
const ( // AnchorBottom anchors the bottom of the sprite to its Z-position AnchorBottom SpriteAnchor = iota // AnchorCenter anchors the center of the sprite to its Z-position AnchorCenter // AnchorTop anchors the top of the sprite to its Z-position AnchorTop )
type TextureHandler ¶
type TextureHandler interface { // TextureAt reutrns image used for rendered wall at the given x, y map coordinates and level number TextureAt(x, y, levelNum, side int) *ebiten.Image // FloorTextureAt returns image used for textured floor at the given x, y map coordinates FloorTextureAt(x, y int) *image.RGBA }