scene

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Camera

type Camera struct {
	Name  string
	Type  string
	Pos   mgl32.Vec3
	Front mgl32.Vec3
	Up    mgl32.Vec3
	Yaw   float32
	Pitch float32
	Fov   float32
}

func NewCamera

func NewCamera() Camera

func (*Camera) Move

func (c *Camera) Move(x float32, y float32, z float32)

type CameraXml

type CameraXml struct {
	Name  string  `xml:"name,attr"`
	Type  string  `xml:"type"`
	Pos   string  `xml:"position"`
	Front string  `xml:"front"`
	Up    string  `xml:"up"`
	Yaw   float32 `xml:"yaw"`
	Pitch float32 `xml:"pitch"`
	Fov   float32 `xml:"fov"`
}

type Light

type Light struct {
	Name      string
	Type      int
	Pos       mgl32.Vec3
	Dir       mgl32.Vec3
	Color     mgl32.Vec3
	Diffuse   float32
	Specular  float32
	Intensity float32
	// contains filtered or unexported fields
}

func (*Light) Move

func (l *Light) Move(x float32, y float32, z float32)

func (Light) RenderLight

func (l Light) RenderLight(nearPlane, farPlane float32, depthProgram, depthCubeProgram uint32, s *Scene) mgl32.Mat4

type LightXml

type LightXml struct {
	Name      string  `xml:"name,attr"`
	Type      string  `xml:"type"`
	Pos       string  `xml:"position"`
	Dir       string  `xml:"direction"`
	Color     string  `xml:"color"`
	Diffuse   float32 `xml:"diffuse"`
	Specular  float32 `xml:"specular"`
	Intensity float32 `xml:"intensity"`
}

type Material

type Material struct {
	Alpha     float32
	Ambient   mgl32.Vec3
	Diffuse   mgl32.Vec3
	Specular  mgl32.Vec3
	Shininess float32
	Texture   uint32
	NormalMap uint32
}

type Mesh

type Mesh struct {
	Name          string
	Vertices      []mgl32.Vec3
	NormalCoords  []mgl32.Vec3
	TextureCoords []mgl32.Vec2
	Faces         [][]uint32
	Materials     []Material
	Position      mgl32.Vec3
	// contains filtered or unexported fields
}

func (*Mesh) MoveBy

func (m *Mesh) MoveBy(x float32, y float32, z float32)

func (*Mesh) MoveTo

func (m *Mesh) MoveTo(dest mgl32.Vec3)

type MeshXml

type MeshXml struct {
	Name     string `xml:"name,attr"`
	Position string `xml:"position"`
	Obj      string `xml:"obj"`
	Mtl      string `xml:"mtl"`
}

type Scene

type Scene struct {
	Meshes []Mesh
	Lights []Light
	Skybox Skybox
	Cam    Camera
}

func EmptyScene

func EmptyScene() Scene

func LoadScene

func LoadScene(path string) Scene

func NewScene

func NewScene(path string) Scene

func (*Scene) GetCamera

func (s *Scene) GetCamera() *Camera

func (*Scene) GetLight

func (s *Scene) GetLight(name string) *Light

func (*Scene) GetMesh

func (s *Scene) GetMesh(name string) *Mesh

func (Scene) RenderScene

func (s Scene) RenderScene(cubesProgram uint32, lightSpaceMatrix mgl32.Mat4, farPlane float32)

func (Scene) RenderSkybox

func (s Scene) RenderSkybox(skyboxProgram uint32)

func (*Scene) UpdateMeshes

func (s *Scene) UpdateMeshes()

type SceneXml

type SceneXml struct {
	CamXml    CameraXml  `xml:"camera"`
	MeshesXml []MeshXml  `xml:"mesh"`
	LightsXml []LightXml `xml:"light"`
}

type Skybox

type Skybox struct {
	Vbo uint32
	Vao uint32

	Texture uint32
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL