Documentation
¶
Overview ¶
virtual is Virtual World file format, it is used to make binary world more human readable and editable
Index ¶
- Variables
- type ActorAction
- type ActorDef
- type ActorInst
- type ActorLevelOfDetail
- type AmbientLight
- type AsciiReadToken
- type AttachedSkin
- type BSPNode
- type BspNodeUVInfo
- type DMSprite
- type DMSpriteDef
- type DMSpriteDef2
- type DMSpriteDefRenderGroup
- type DMSpriteDefSize6Entry
- type DMSpriteDefSpritePolygon
- type DMSpriteDefVertexPiece
- type Dag
- type Face
- type HierarchicalSpriteDef
- type LightDef
- type MaterialDef
- type MaterialPalette
- type MeshOp
- type Obstacle
- type PointLight
- type PolyhedronDefinition
- type PolyhedronDefinitionFace
- type PropOpt
- type RGBTrack
- type RGBTrackDef
- type Region
- type SimpleSpriteDef
- type SimpleSpriteFrame
- type Sprite3DDef
- type TrackDef
- type TrackFrameTransform
- type TrackInstance
- type VisList
- type VisNode
- type VisTree
- type Wall
- type Wld
- type WorldNode
- type WorldTree
- type Zone
Constants ¶
This section is empty.
Variables ¶
var AsciiVersion = "v0.0.1"
Functions ¶
This section is empty.
Types ¶
type ActorAction ¶ added in v1.4.113
type ActorAction struct { Unk1 uint32 LevelOfDetails []ActorLevelOfDetail }
ActorAction is a declaration of ACTION
type ActorDef ¶ added in v1.4.118
type ActorDef struct { Tag string Callback string BoundsRef int32 CurrentAction uint32 Location [6]float32 Unk1 uint32 Actions []ActorAction Unk2 uint32 }
ActorDef is a declaration of ACTORDEF
func (*ActorDef) Definition ¶ added in v1.4.125
func (*ActorDef) Read ¶ added in v1.4.125
func (a *ActorDef) Read(r *AsciiReadToken) error
type ActorInst ¶ added in v1.4.118
type ActorInst struct { Tag string Active int SpriteVolumeOnly int SphereTag string SoundTag string DefinitionTag string CurrentAction uint32 Location [6]float32 Unk1 uint32 BoundingRadius float32 Scale float32 DMRGBTrackTag string UserData string }
ActorInst is a declaration of ACTORINST
func (*ActorInst) Definition ¶ added in v1.4.125
func (*ActorInst) Read ¶ added in v1.4.125
func (a *ActorInst) Read(r *AsciiReadToken) error
type ActorLevelOfDetail ¶ added in v1.4.118
type ActorLevelOfDetail struct { Sprite3DTag string HierarchicalSpriteTag string DMSpriteTag string Sprite2DTag string MinDistance float32 }
ActorLevelOfDetail is a declaration of LEVELOFDETAIL
type AmbientLight ¶ added in v1.4.128
func (*AmbientLight) Definition ¶ added in v1.4.128
func (a *AmbientLight) Definition() string
func (*AmbientLight) Read ¶ added in v1.4.128
func (a *AmbientLight) Read(r *AsciiReadToken) error
type AsciiReadToken ¶ added in v1.4.120
type AsciiReadToken struct {
// contains filtered or unexported fields
}
func LoadAsciiFile ¶ added in v1.4.121
func LoadAsciiFile(path string, wld *Wld) (*AsciiReadToken, error)
LoadAsciiFile returns a new AsciiReader that reads from r.
func (*AsciiReadToken) Close ¶ added in v1.4.121
func (a *AsciiReadToken) Close() error
func (*AsciiReadToken) Read ¶ added in v1.4.120
func (a *AsciiReadToken) Read(p []byte) (n int, err error)
Read reads up to len(p) bytes into p. It returns the number of bytes read (0 <= n <= len(p)) and any error encountered.
func (*AsciiReadToken) ReadProperty ¶ added in v1.4.120
func (a *AsciiReadToken) ReadProperty(name string, minNumArgs int) ([]string, error)
func (*AsciiReadToken) TotalLineCountRead ¶ added in v1.4.124
func (a *AsciiReadToken) TotalLineCountRead() int
type AttachedSkin ¶ added in v1.4.123
type BSPNode ¶ added in v1.4.118
type BSPNode struct { Vertices []uint32 RenderMethod string Flags uint8 Pen uint32 Brightness float32 ScaledAmbient float32 SpriteTag string Origin [3]float32 UAxis [3]float32 VAxis [3]float32 RenderUVMapEntries []BspNodeUVInfo FrontTree uint32 BackTree uint32 }
BSPNode is a declaration of BSPNODE
type BspNodeUVInfo ¶ added in v1.4.118
type BspNodeUVInfo struct { UvOrigin [3]float32 // UV %0.7f %0.7f %0.7f UAxis [3]float32 // UAXIS %0.7f %0.7f %0.7f VAxis [3]float32 // VAXIS %0.7f %0.7f %0.7f }
BspNodeUVInfo is a declaration of UV
type DMSprite ¶ added in v1.4.130
DMSprite is a declaration of DMSPRITEINSTANCE
func (*DMSprite) Definition ¶ added in v1.4.130
func (*DMSprite) Read ¶ added in v1.4.130
func (d *DMSprite) Read(r *AsciiReadToken) error
type DMSpriteDef ¶ added in v1.4.130
type DMSpriteDef struct { Tag string Flags uint32 Fragment1Maybe int16 Material string Fragment3 uint32 CenterPosition [3]float32 Params2 uint32 Something2 uint32 Something3 uint32 Verticies [][3]float32 TexCoords [][3]float32 Normals [][3]float32 Colors []int32 Polygons []*DMSpriteDefSpritePolygon VertexPieces []*DMSpriteDefVertexPiece PostVertexFlag uint32 RenderGroups []*DMSpriteDefRenderGroup VertexTex [][2]float32 Size6Pieces []*DMSpriteDefSize6Entry }
DMSpriteDef is a declaration of DMSPRITEDEF
type DMSpriteDef2 ¶ added in v1.4.116
type DMSpriteDef2 struct { Tag string Flags uint32 DmTrackTag string Fragment3Ref int32 Fragment4Ref int32 Params2 [3]uint32 MaxDistance float32 Min [3]float32 Max [3]float32 CenterOffset [3]float32 Vertices [][3]float32 UVs [][2]float32 VertexNormals [][3]float32 SkinAssignmentGroups [][2]uint16 MaterialPaletteTag string Colors [][4]uint8 Faces []*Face MeshOps []*MeshOp FaceMaterialGroups [][2]uint16 VertexMaterialGroups [][2]int16 BoundingRadius float32 FPScale uint16 PolyhedronTag string }
DMSpriteDef2 is a declaration of DMSpriteDef2
func (*DMSpriteDef2) Definition ¶ added in v1.4.120
func (d *DMSpriteDef2) Definition() string
func (*DMSpriteDef2) Read ¶ added in v1.4.120
func (d *DMSpriteDef2) Read(r *AsciiReadToken) error
type DMSpriteDefRenderGroup ¶ added in v1.4.130
type DMSpriteDefSize6Entry ¶ added in v1.4.130
type DMSpriteDefSpritePolygon ¶ added in v1.4.130
type DMSpriteDefVertexPiece ¶ added in v1.4.130
type HierarchicalSpriteDef ¶ added in v1.4.123
type HierarchicalSpriteDef struct { Tag string Dags []Dag AttachedSkins []AttachedSkin CenterOffset [3]float32 BoundingRadius float32 DMSpriteTag string DagCollision int }
func (*HierarchicalSpriteDef) Definition ¶ added in v1.4.123
func (h *HierarchicalSpriteDef) Definition() string
func (*HierarchicalSpriteDef) Read ¶ added in v1.4.123
func (h *HierarchicalSpriteDef) Read(r *AsciiReadToken) error
type LightDef ¶ added in v1.4.118
type LightDef struct { Tag string Flags uint32 FrameCurrentRef uint32 Sleep uint32 LightLevels []float32 Colors [][3]float32 }
LightDef is a declaration of LIGHTDEF
func (*LightDef) Definition ¶ added in v1.4.125
func (*LightDef) Read ¶ added in v1.4.125
func (l *LightDef) Read(r *AsciiReadToken) error
type MaterialDef ¶ added in v1.4.116
type MaterialDef struct { Tag string // TAG %s Flags uint32 // FLAGS %d RenderMethod string // RENDERMETHOD %s RGBPen [4]uint8 // RGBPEN %d %d %d Brightness float32 // BRIGHTNESS %0.7f ScaledAmbient float32 // SCALEDAMBIENT %0.7f SimpleSpriteInstTag string // SIMPLESPRITEINST SimpleSpriteInstFlag uint32 // FLAGS %d Pair1 uint32 Pair2 float32 }
MaterialDef is an entry MATERIALDEFINITION
func (*MaterialDef) Definition ¶ added in v1.4.121
func (m *MaterialDef) Definition() string
func (*MaterialDef) Read ¶ added in v1.4.121
func (m *MaterialDef) Read(r *AsciiReadToken) error
type MaterialPalette ¶ added in v1.4.116
type MaterialPalette struct { Tag string Materials []string // contains filtered or unexported fields }
MaterialPalette is a declaration of MATERIALPALETTE
func (*MaterialPalette) Definition ¶ added in v1.4.120
func (m *MaterialPalette) Definition() string
func (*MaterialPalette) Read ¶ added in v1.4.120
func (m *MaterialPalette) Read(r *AsciiReadToken) error
type PointLight ¶ added in v1.4.118
type PointLight struct { Tag string // TAG "%s" LightDefTag string // LIGHT "%s" Flags uint32 // FLAGS %d Location [3]float32 Radius float32 // RADIUSOFINFLUENCE %0.7f }
PointLight is a declaration of POINTLIGHT
func (*PointLight) Definition ¶ added in v1.4.125
func (p *PointLight) Definition() string
func (*PointLight) Read ¶ added in v1.4.125
func (p *PointLight) Read(r *AsciiReadToken) error
type PolyhedronDefinition ¶ added in v1.4.120
type PolyhedronDefinition struct { Tag string Flags uint32 BoundingRadius float32 ScaleFactor float32 Vertices [][3]float32 Faces []*PolyhedronDefinitionFace }
func (*PolyhedronDefinition) Definition ¶ added in v1.4.120
func (p *PolyhedronDefinition) Definition() string
func (*PolyhedronDefinition) Read ¶ added in v1.4.120
func (p *PolyhedronDefinition) Read(r *AsciiReadToken) error
type PolyhedronDefinitionFace ¶ added in v1.4.120
type PolyhedronDefinitionFace struct {
Vertices []uint32
}
type RGBTrack ¶ added in v1.4.133
RGBTrack is a track instance for RGB deformation tracks
func (*RGBTrack) Definition ¶ added in v1.4.133
func (*RGBTrack) Read ¶ added in v1.4.133
func (r *RGBTrack) Read(token *AsciiReadToken) error
type RGBTrackDef ¶ added in v1.4.133
type RGBTrackDef struct { Tag string Data1 uint32 Data2 uint32 Data4 uint32 Sleep uint32 RGBAs [][4]uint8 }
func (*RGBTrackDef) Definition ¶ added in v1.4.133
func (r *RGBTrackDef) Definition() string
func (*RGBTrackDef) Read ¶ added in v1.4.133
func (r *RGBTrackDef) Read(token *AsciiReadToken) error
type Region ¶ added in v1.4.113
type Region struct { RegionTag string AmbientLightTag string RegionVertices [][3]float32 RenderVertices [][3]float32 Walls []*Wall Obstacles []*Obstacle CuttingObstacles []*Obstacle VisTree *VisTree Sphere [4]float32 UserData string }
func (*Region) Definition ¶ added in v1.4.128
func (*Region) Read ¶ added in v1.4.128
func (r *Region) Read(token *AsciiReadToken) error
type SimpleSpriteDef ¶ added in v1.4.116
type SimpleSpriteDef struct { Tag string SimpleSpriteFrames []SimpleSpriteFrame }
SimpleSpriteDef is a declaration of SIMPLESPRITEDEF
func (*SimpleSpriteDef) Definition ¶ added in v1.4.121
func (s *SimpleSpriteDef) Definition() string
func (*SimpleSpriteDef) Read ¶ added in v1.4.121
func (s *SimpleSpriteDef) Read(r *AsciiReadToken) error
type SimpleSpriteFrame ¶ added in v1.4.129
type Sprite3DDef ¶ added in v1.4.118
type Sprite3DDef struct { Tag string CenterOffset [3]float32 BoundingRadius float32 SphereListTag string Vertices [][3]float32 BSPNodes []*BSPNode }
Sprite3DDef is a declaration of SPRITE3DDEF
func (*Sprite3DDef) Definition ¶ added in v1.4.125
func (s *Sprite3DDef) Definition() string
func (*Sprite3DDef) Read ¶ added in v1.4.125
func (s *Sprite3DDef) Read(r *AsciiReadToken) error
type TrackDef ¶ added in v1.4.120
type TrackDef struct { Tag string Flags uint32 FrameTransforms []TrackFrameTransform }
func (*TrackDef) Definition ¶ added in v1.4.120
func (*TrackDef) Read ¶ added in v1.4.120
func (t *TrackDef) Read(r *AsciiReadToken) error
type TrackFrameTransform ¶ added in v1.4.120
type TrackInstance ¶ added in v1.4.120
type TrackInstance struct { Tag string DefinitionTag string Interpolate int Reverse int Sleep uint32 }
func (*TrackInstance) Definition ¶ added in v1.4.120
func (t *TrackInstance) Definition() string
func (*TrackInstance) Read ¶ added in v1.4.120
func (t *TrackInstance) Read(r *AsciiReadToken) error
type Wld ¶
type Wld struct { FileName string GlobalAmbientLight string Version uint32 SimpleSpriteDefs []*SimpleSpriteDef MaterialDefs []*MaterialDef MaterialPalettes []*MaterialPalette DMSpriteDefs []*DMSpriteDef DMSpriteInsts []*DMSprite DMSpriteDef2s []*DMSpriteDef2 ActorDefs []*ActorDef ActorInsts []*ActorInst LightDefs []*LightDef PointLights []*PointLight Sprite3DDefs []*Sprite3DDef TrackInstances []*TrackInstance TrackDefs []*TrackDef HierarchicalSpriteDefs []*HierarchicalSpriteDef PolyhedronDefs []*PolyhedronDefinition WorldTrees []*WorldTree Regions []*Region AmbientLights []*AmbientLight Zones []*Zone RGBTrackDefs []*RGBTrackDef RGBTrackInsts []*RGBTrack }
Wld is a struct representing a Wld file
func (*Wld) WriteAscii ¶ added in v1.4.113
type WorldTree ¶ added in v1.4.128
func (*WorldTree) Definition ¶ added in v1.4.128
func (*WorldTree) Read ¶ added in v1.4.128
func (t *WorldTree) Read(r *AsciiReadToken) error
type Zone ¶ added in v1.4.128
func (*Zone) Definition ¶ added in v1.4.128
func (*Zone) Read ¶ added in v1.4.128
func (z *Zone) Read(r *AsciiReadToken) error