basil3d

package
v0.0.0-...-5ac2c9a Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HasPosition int = 1 << iota
	HasNormal
	HasTangent
	HasTexcoord0
	HasBlendWeight0
	HasWeightIndices0
	HasTexture0
	HasTexture1
	HasTexture2
	HasDoubleSided
	HasAlphaBlend
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Embed []*string               `json:"embed"`
	JSON  map[string]*interface{} `json:"json"`

	Room  map[string]*AppRoom  `json:"room"`
	Mob   map[string]*AppMob   `json:"mob"`
	Stage map[string]*AppStage `json:"stage"`

	HID   AppHID   `json:"hid"`
	GPU   AppGPU   `json:"gpu"`
	Audio AppAudio `json:"audio"`
}

func (*App) AddEmbed

func (p *App) AddEmbed(buf string) int

func (*App) AddEmbedBase64

func (p *App) AddEmbedBase64(buf []byte, compress bool) (int, error)

type AppAudio

type AppAudio struct {
}

type AppColor

type AppColor struct {
	R float32 `json:"r"`
	G float32 `json:"g"`
	B float32 `json:"b"`
	A float32 `json:"a"`
}

type AppGPU

type AppGPU struct {
	Shader  []*AppGPUShader  `json:"shader,omitempty"`
	Buffer  []*AppGPUBuffer  `json:"buffer,omitempty"`
	Texture []*AppGPUTexture `json:"texture,omitempty"`
	Mesh    []*AppGPUMesh    `json:"mesh,omitempty"`
	ID      []*AppGPUID      `json:"id,omitempty"`
}

type AppGPUBuffer

type AppGPUBuffer struct {
	Embed int `json:"embed,omitempty"`
}

type AppGPUID

type AppGPUID struct {
	Name string `json:"name"`
	Mesh []int  `json:"mesh"`
}

type AppGPUMesh

type AppGPUMesh struct {
	Hint int `json:"hint"`

	// Input
	VertexBuffer0 []int `json:"vb0,omitempty"` // [buffer, offset, size], slot: 0, shaderLocation: 0, format: float32x3 (position)
	VertexBuffer1 []int `json:"vb1,omitempty"` // [buffer, offset, size], slot: 1, shaderLocation: 1, format: float32x3 (normal)
	VertexBuffer2 []int `json:"vb2,omitempty"` // [buffer, offset, size], slot: 2, shaderLocation: 2
	VertexBuffer3 []int `json:"vb3,omitempty"` // [buffer, offset, size], slot: 3, shaderLocation: 3
	VertexBuffer4 []int `json:"vb4,omitempty"` // [buffer, offset, size], slot: 4, shaderLocation: 4
	VertexBuffer5 []int `json:"vb5,omitempty"` // [buffer, offset, size], slot: 5, shaderLocation: 5
	IndexBuffer   []int `json:"ib,omitempty"`  // [buffer, offset, size], format: uint16

	// Uniform
	Factor0  []float64 `json:"factor0,omitempty"`  // [Color.r, Color.g, Color.b, Color.a]
	Factor1  []float64 `json:"factor1,omitempty"`  // [Occlusion, Metallic, Roughness, unused]
	Factor2  []float64 `json:"factor2,omitempty"`  // [Emissive.r, Emissive.g, Emissive.b, unused]
	Texture0 int       `json:"texture0,omitempty"` // BaseColorTexture
	Texture1 int       `json:"texture1,omitempty"` // ParameterTexture(OcclusionMetallicRoughness)
	Texture2 int       `json:"texture2,omitempty"` // NormalTexture

	Count int `json:"count"`
}

type AppGPUShader

type AppGPUShader struct {
	Embed int `json:"embed,omitempty"`
}

type AppGPUTexture

type AppGPUTexture struct {
	Embed int `json:"embed,omitempty"`
}

type AppHID

type AppHID struct {
	Timer    string             `json:"timer"`
	Keyboard map[string]*string `json:"keyboard"`
	Mouse    *AppHIDMouse       `json:"mouse"`
	Gamepad  *AppHIDGamepad     `json:"gamepad"`
}

type AppHIDGamepad

type AppHIDGamepad struct {
	Buttons []*string   `json:"buttons"`
	Axes    [][]*string `json:"axes"`
}

type AppHIDMouse

type AppHIDMouse struct {
	Button    []*string `json:"button"`
	MovementX []*string `json:"movementX"`
	MovementY []*string `json:"movementY"`
}

type AppMesh

type AppMesh struct {
	Name    string     `json:"name"`
	Offset  *AppOffset `json:"offset"`
	Factor0 *AppColor  `json:"factor0,omitempty"`
	Factor1 *AppColor  `json:"factor1,omitempty"`
	Factor2 *AppColor  `json:"factor2,omitempty"`
}

type AppMob

type AppMob struct {
	Mesh  []*AppMesh `json:"mesh"`
	Space *AppSpace  `json:"space,omitempty"`
}

type AppOffset

type AppOffset struct {
	X  float32 `json:"x"`
	Y  float32 `json:"y"`
	Z  float32 `json:"z"`
	HA float32 `json:"ha"`
	VA float32 `json:"va"`
}

type AppRoom

type AppRoom struct {
	Mesh   []*AppMesh       `json:"mesh"`
	Layout []*AppRoomLayout `json:"layout"`
}

type AppRoomLayout

type AppRoomLayout struct {
	Node    []*AppRoomNode `json:"node"`
	Unit    float32        `json:"unit"`
	Divisor int            `json:"divisor"`
	Indices []int          `json:"indices"`
}

type AppRoomNode

type AppRoomNode struct {
	Mesh  []int     `json:"mesh"`
	Space *AppSpace `json:"space,omitempty"`
}

type AppSpace

type AppSpace struct {
	Min    *float32 `json:"min,omitempty"`
	Max    *float32 `json:"max,omitempty"`
	Radius *float32 `json:"radius,omitempty"`
}

type AppStage

type AppStage struct {
	Step []*AppStageStep `json:"step"`

	Room   []*AppStageRoom   `json:"room"`
	Mob    []*AppStageMob    `json:"mob"`
	Camera []*AppStageCamera `json:"camera"`
	Light  []*AppStageLight  `json:"light"`
}

type AppStageCamera

type AppStageCamera struct {
	Offset *AppOffset `json:"offset"`
	Fov    float32    `json:"fov"`
	Near   float32    `json:"near"`
	Far    float32    `json:"far"`
}

type AppStageLight

type AppStageLight struct {
	Offset   *AppOffset `json:"offset"`
	Color    *AppColor  `json:"color"`
	Ambient0 *AppColor  `json:"ambient0"`
	Ambient1 *AppColor  `json:"ambient1"`
}

type AppStageMob

type AppStageMob struct {
	Name   string     `json:"name"`
	Offset *AppOffset `json:"offset"`
}

type AppStageRoom

type AppStageRoom struct {
	Name   string     `json:"name"`
	Offset *AppOffset `json:"offset"`
}

type AppStageStep

type AppStageStep struct {
	Label string `json:"label,omitempty"`
	Event string `json:"event,omitempty"`
	Goto  string `json:"goto,omitempty"`
	Yield bool   `json:"yield,omitempty"`
}

type Builder

type Builder struct {
	GLTF  []*gltf.Document
	JSON  map[string]*interface{}
	Room  map[string]*AppRoom
	Mob   map[string]*AppMob
	Stage map[string]*AppStage
}

type Middleware

type Middleware struct {
}

func (Middleware) PreBuild

func (p Middleware) PreBuild(bsl *basil.Basil) error

Jump to

Keyboard shortcuts

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